Skip to content

Instantly share code, notes, and snippets.

/-

Created Jan 22, 2015
Embed
What would you like to do?
class mig::agent {
case $::operatingsystem {
'CentOS', 'RedHat': {
package {
'mig-agent':
ensure => latest,
}
}
'Ubuntu': {
package {
'mig-agent':
ensure => latest,
}
}
}
if ($fqdn == 'opsec1.private.phx1.mozilla.com'){
# when the package is upgraded, exec a new instance of the agent
exec {
'restart mig':
command => '/sbin/mig-agent -q=shutdown; /bin/sleep 2; /sbin/mig-agent',
subscribe => Package['mig-agent'],
refreshonly => true
}
}
file {
'/usr/local/sbin/update-mig-agent':
ensure => file,
owner => root,
mode => 0755,
source => 'puppet:///modules/mig/bin/update-mig-agent',
}
file {
'/etc/cron.d/update-mig-agent':
ensure => file,
owner => root,
mode => 0644,
source => 'puppet:///modules/mig/cron.d/update-mig-agent',
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment