|
|
@ -1,6 +1,6 @@ |
|
|
|
## ++++++++++ start of kickstarts / albert / post.sh +++++++++++++ |
|
|
|
|
|
|
|
echo "albert post.sh now..." |
|
|
|
echo "## BEGIN: Albert post.sh..." |
|
|
|
|
|
|
|
echo "Adding a few keys" |
|
|
|
# -- add in a couple of keys here, just for backups |
|
|
@ -13,20 +13,10 @@ chmod 600 /root/.ssh/authorized_keys |
|
|
|
|
|
|
|
echo "starting Ansible stuff now......" |
|
|
|
## -- this is all the basic ansible config to ensure it can begin pulling configs down. |
|
|
|
|
|
|
|
cd /usr/local/sbin |
|
|
|
## -- seems wget was already installed... |
|
|
|
#wget https://config.tombstones.org.uk:23000/tombstones/files/raw/branch/master/usr.local.sbin/synch-from-repos.sh |
|
|
|
#wget https://config.tombstones.org.uk:23000/tombstones/files/raw/branch/master/usr.local.sbin/apply-ansible.sh |
|
|
|
wget https://config.tombstones.org.uk:23000/tombstones/files/raw/branch/master/usr.local.sbin/update-and-apply-ansible.sh |
|
|
|
chmod 750 *.sh |
|
|
|
|
|
|
|
## -- this is where all the self-management stuff will lie |
|
|
|
#mkdir /var/lib/ansible |
|
|
|
#cd /var/lib/ansible |
|
|
|
#git clone deploy:/tombstones/10-ansible-common.git |
|
|
|
|
|
|
|
|
|
|
|
## -- initial run |
|
|
|
## -- seems it needs to be an absolute path |
|
|
|
##/usr/local/sbin/apply-ansible.sh >> /var/log/ansible-init.log 2>&1 |
|
|
@ -35,13 +25,13 @@ chmod 750 *.sh |
|
|
|
|
|
|
|
## .. but still didn't work. Cronned to run on reboot (as firewallD isn't running) |
|
|
|
|
|
|
|
echo "Cronning Ansible..." |
|
|
|
mkdir -p /var/spool/cron |
|
|
|
## .. can use ansible-playbook *.yaml |
|
|
|
## also need to cron this... |
|
|
|
echo '@reboot * * * * /usr/local/sbin/update-and-apply-ansible.sh albert 2>&1 1>>/var/log/ansible-apply.log ' > /var/spool/cron/root |
|
|
|
echo '*/5 * * * * /usr/local/sbin/update-and-apply-ansible.sh albert 2>&1 1>>/var/log/ansible-apply.log ' >> /var/spool/cron/root |
|
|
|
|
|
|
|
echo "ALBERT post.sh - finished. Rebooting to let cron kick in." |
|
|
|
reboot |
|
|
|
echo "## END: Albert post.sh..." |
|
|
|
|
|
|
|
## ================ end of kickstarts / albert / post.sh |
|
|
|