summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2014-08-14 14:01:02 -0300
committerSilvio Rhatto <rhatto@riseup.net>2014-08-14 14:01:02 -0300
commit71fe930f19e9c4026009aa4722486c39a8259339 (patch)
tree267ce4e30625d0f96a8b81fb6dcea3dd3da98710
parent9bc51a55045a80bc9d8917c67f6cb70f4e7ff6f2 (diff)
downloadpuppet-puppet-71fe930f19e9c4026009aa4722486c39a8259339.tar.gz
puppet-puppet-71fe930f19e9c4026009aa4722486c39a8259339.tar.bz2
Putting puppet::repo::update in separate file and adding missing class parameters
-rw-r--r--manifests/repo.pp34
-rw-r--r--manifests/repo/update.pp29
2 files changed, 33 insertions, 30 deletions
diff --git a/manifests/repo.pp b/manifests/repo.pp
index 1623a3c..4b69c98 100644
--- a/manifests/repo.pp
+++ b/manifests/repo.pp
@@ -1,5 +1,8 @@
# manage a git repo that updates /etc/puppet
-class puppet::repo {
+class puppet::repo(
+ $ensure = present,
+ $method = 'cron',
+) {
include puppet
# make sure we have a puppet repo
@@ -43,32 +46,3 @@ class puppet::repo {
}
}
}
-
-class puppet::repo::update(
- $ensure = present,
- $method = hiera('puppet::update::method', 'cron')
-) {
- include puppet::repo
-
- # puppet update script
- file { "/usr/local/sbin/update-puppet-conf.sh":
- source => "puppet:///modules/puppet/update-puppet-conf.sh",
- owner => "puppet",
- group => "puppet",
- mode => 0750,
- ensure => present,
- }
-
- # cron rule to update puppet config repository every 5 minutes
- cron { "puppet-update":
- command => "/usr/local/sbin/update-puppet-conf.sh > /dev/null 2>&1",
- user => puppet,
- minute => "*/5",
- ensure => $method ? {
- 'cron' => $ensure,
- default => absent,
- },
- require => [ File["/usr/local/sbin/update-puppet-conf.sh"], User["puppet"] ],
- }
-
-}
diff --git a/manifests/repo/update.pp b/manifests/repo/update.pp
new file mode 100644
index 0000000..6dc4254
--- /dev/null
+++ b/manifests/repo/update.pp
@@ -0,0 +1,29 @@
+class puppet::repo::update(
+ $ensure = present,
+ $method = hiera('puppet::update::method', 'cron')
+) {
+ class { 'puppet::repo':
+ method => $method,
+ }
+
+ # puppet update script
+ file { "/usr/local/sbin/update-puppet-conf.sh":
+ source => "puppet:///modules/puppet/update-puppet-conf.sh",
+ owner => "puppet",
+ group => "puppet",
+ mode => 0750,
+ ensure => present,
+ }
+
+ # cron rule to update puppet config repository every 5 minutes
+ cron { "puppet-update":
+ command => "/usr/local/sbin/update-puppet-conf.sh > /dev/null 2>&1",
+ user => puppet,
+ minute => "*/5",
+ ensure => $method ? {
+ 'cron' => $ensure,
+ default => absent,
+ },
+ require => [ File["/usr/local/sbin/update-puppet-conf.sh"], User["puppet"] ],
+ }
+}