summaryrefslogtreecommitdiff
path: root/manifests
diff options
context:
space:
mode:
Diffstat (limited to 'manifests')
-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"] ],
+ }
+}