slackbuilds_ponce/system/ansible/doinst.sh
Alex Diaconu a9a2f3683a system/ansible: Added (a ssh based config management framework)
Signed-off-by: Robby Workman <rworkman@slackbuilds.org>
2013-07-07 09:11:41 -03:00

16 lines
439 B
Bash

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