Skip to content

Instantly share code, notes, and snippets.

@floatingatoll
Forked from anonymous/-
Created January 22, 2015 18:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save floatingatoll/d68d483baad9886b2308 to your computer and use it in GitHub Desktop.
Save floatingatoll/d68d483baad9886b2308 to your computer and use it in GitHub Desktop.
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-wait',
subscribe => Package['mig-agent'],
notify => Service['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