From 71fe930f19e9c4026009aa4722486c39a8259339 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Thu, 14 Aug 2014 14:01:02 -0300 Subject: Putting puppet::repo::update in separate file and adding missing class parameters --- manifests/repo.pp | 34 ++++------------------------------ manifests/repo/update.pp | 29 +++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 30 deletions(-) create mode 100644 manifests/repo/update.pp 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"] ], + } +} -- cgit v1.2.3