]> git.immae.eu Git - perso/Immae/Projets/Puppet.git/commitdiff
Add a way to lock puppet
authorIsmaël Bouya <ismael.bouya@normalesup.org>
Sun, 22 Apr 2018 13:27:34 +0000 (15:27 +0200)
committerIsmaël Bouya <ismael.bouya@normalesup.org>
Sun, 22 Apr 2018 13:27:34 +0000 (15:27 +0200)
modules/base_installation/files/scripts/puppet_lock [new file with mode: 0644]
modules/base_installation/manifests/puppet.pp

diff --git a/modules/base_installation/files/scripts/puppet_lock b/modules/base_installation/files/scripts/puppet_lock
new file mode 100644 (file)
index 0000000..cf5c429
--- /dev/null
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+lockfile=/var/run/puppet-apply.lock
+path=`dirname $0`
+path=`cd $path/..; pwd`
+
+if [ $(id -u) -gt 0 ]; then
+  echo "You must be root to run this script." >&2
+  exit 2
+fi
+
+if [ "$1" = "off" ]; then
+  rm -f "$lockfile"
+else
+  touch "$lockfile"
+fi
index c64ddfdccf141095002805c97498f2cd1dc248b2..fa2db6920dcbad5089f6726b22a418c5e76d5b44 100644 (file)
@@ -27,6 +27,12 @@ class base_installation::puppet (
   }
   ###
 
+  file { '/usr/local/sbin/i_puppet_lock':
+    mode   => "0755",
+    ensure => present,
+    source => "puppet:///modules/base_installation/scripts/puppet_lock"
+  }
+
   file { '/usr/local/sbin/i_puppet_reset_and_apply':
     mode   => "0755",
     ensure => present,