From: Felix Dörre Date: Sat, 15 Apr 2017 23:34:39 +0000 (+0200) Subject: add: synchronous initial puppet runs X-Git-Url: https://code.wpia.club/?p=infra.git;a=commitdiff_plain;h=de1b5a9303bef6166335f08b82a785f8c0607ad9 add: synchronous initial puppet runs Change-Id: I675e7cbd833ab15e5fff2df6bd740257d0b67df6 --- diff --git a/modules/lxc/manifests/init.pp b/modules/lxc/manifests/init.pp index 07cf459..0ba4a20 100644 --- a/modules/lxc/manifests/init.pp +++ b/modules/lxc/manifests/init.pp @@ -142,18 +142,23 @@ class lxc { file {"/var/lib/lxc/$contname/rootfs/var/lib/puppet/ssl/certs/$contname.pem": source => "file:///var/lib/puppet/ssl/certs/$contname.pem", notify => Exec["lxc-$contname-puppet-restart"], - } -> + } exec {"lxc-$contname-puppet-restart": - command => "/usr/bin/lxc-attach -n $contname -- systemctl restart puppet", + command => "/usr/bin/lxc-attach -n $contname -- systemctl stop puppet", timeout => '0', refreshonly => 'true' - } -> + } ~> exec {"lxc-$contname-refresh": command => "/usr/bin/lxc-attach -n $contname -- puppet agent --onetime --no-daemonize --verbose", timeout => '0', # TODO figure out a way to verify puppet launches creates => "/var/lib/lxc/$contname/rootfs/certified" ##creates => "/var/lib/lxc/$contname/rootfs/lib/systemd/system/puppet.service" + } ~> + exec {"lxc-$contname-puppet-start": + command => "/usr/bin/lxc-attach -n $contname -- systemctl start puppet", + timeout => '0', + refreshonly => 'true' } }