]> WPIA git - infra.git/commitdiff
add: synchronous initial puppet runs
authorFelix Dörre <felix@dogcraft.de>
Sat, 15 Apr 2017 23:34:39 +0000 (01:34 +0200)
committerFelix Dörre <felix@dogcraft.de>
Sun, 16 Apr 2017 20:33:36 +0000 (22:33 +0200)
Change-Id: I675e7cbd833ab15e5fff2df6bd740257d0b67df6

modules/lxc/manifests/init.pp

index 07cf459621528b44a9f8bdd7a960ee38a45c1c48..0ba4a20f96aa09dbfee7603af916c22aaa88520b 100644 (file)
@@ -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'
         }
     }