From de1b5a9303bef6166335f08b82a785f8c0607ad9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Felix=20D=C3=B6rre?= Date: Sun, 16 Apr 2017 01:34:39 +0200 Subject: [PATCH] add: synchronous initial puppet runs Change-Id: I675e7cbd833ab15e5fff2df6bd740257d0b67df6 --- modules/lxc/manifests/init.pp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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' } } -- 2.39.5