Skip to content

Instantly share code, notes, and snippets.

@calum-github
Last active October 21, 2015 03:36
Show Gist options
  • Select an option

  • Save calum-github/b492d0aff39a37577b37 to your computer and use it in GitHub Desktop.

Select an option

Save calum-github/b492d0aff39a37577b37 to your computer and use it in GitHub Desktop.
puppet
# Ensure we have docker running and enabled (starts at boot)
service {"docker":
ensure => running,
enable => true,
}
# Ensure we have docker installed and it is the required version.
package { "docker":
ensure => "1.7.1-115.el7",
}
# Ensure our docker containers are stopped and restarted after the upgrade
exec {"Refresh docker containers":
command => "systemctl stop $(systemctl list-units --type=scope | awk -F \' \' \'/docker/ {print $1}\' | head -n1); systemctl stop $(systemctl list-units --type=scope | awk -F \' \' \'/docker/ {print $1}\' | tail -1); systemctl restart docker",
path => [ "/bin/", "/sbin/" , "/usr/bin/", "/usr/sbin/" ],
refreshonly => true,
subscribe => Package['docker'],
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment