summaryrefslogtreecommitdiff
path: root/system/ansible/doinst.sh
diff options
context:
space:
mode:
authorAlex Diaconu <alex.diaconu@gmx.com>2013-07-05 15:25:23 -0500
committerNiels Horn <niels.horn@slackbuilds.org>2013-07-07 09:11:41 -0300
commita9a2f3683a6b007dd29c9780497f23877b13668a (patch)
tree8cd6dd80710dd52596cde2ca48c346e8b4bbe348 /system/ansible/doinst.sh
parent49f20361ff32be6654915ae77b71fd0ed78e76bd (diff)
downloadslackbuilds-a9a2f3683a6b007dd29c9780497f23877b13668a.tar.gz
system/ansible: Added (a ssh based config management framework)
Signed-off-by: Robby Workman <rworkman@slackbuilds.org>
Diffstat (limited to 'system/ansible/doinst.sh')
-rw-r--r--system/ansible/doinst.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/system/ansible/doinst.sh b/system/ansible/doinst.sh
new file mode 100644
index 0000000000..def7b58d1d
--- /dev/null
+++ b/system/ansible/doinst.sh
@@ -0,0 +1,16 @@
+config() {
+ NEW="$1"
+ OLD="$(dirname $NEW)/$(basename $NEW .new)"
+ # If there's no config file by that name, mv it over:
+ if [ ! -r $OLD ]; then
+ mv $NEW $OLD
+ elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
+ # toss the redundant copy
+ rm $NEW
+ fi
+ # Otherwise, we leave the .new copy for the admin to consider...
+}
+
+config etc/ansible/ansible.cfg.new
+config etc/ansible/hosts.new
+