Browse Source

Shifted ansible stuff into here

master
dave 8 months ago
parent
commit
8bcb2a2932
  1. 35
      albert/post.cfg

35
albert/post.cfg

@ -2,6 +2,10 @@
echo "albert post.cfg now..."
## -- just to provide "netstat"
yum -y install net-tools
echo "Adding a few keys"
# -- add in a couple of keys here, just for backups
echo "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA3Z5QcAbTioCTWahnGnLmv0Q5NLbBW6UjvPUAQIjGjt2ZtMndiqM5lMGHgu52i3by35vEXfqGweCzAeypgvLKMklWaJVKa0ZlYDZ+BmtovwYDrCLPHEMR3AgxkZKa7dqOrcQNsQ7iFMJ1OJc61eLlBOVEtDDFLzoaUtE1K9tYB86SXRmizNN8zigvb4yCVMG01rNvFvBhCKRItdvmVYtsWff8HYjaTyxwUTJVkrPHyv5H0J1f5S67fI2QjqttrOWVWs331DZ8lREbMxpys9Yx/Ig9zYve76NxDYhp7VeEP+yv8KIKl1YwhMWzrIBMg6I4bnnxQFmQLDLT8uzMHfL9cw== dave@quark.tombstones.org.uk" >> /root/.ssh/authorized_keys
@ -12,8 +16,33 @@ echo "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCmO9RGpc0ASgD+bLMZOiQkWOnChsLOAdQXvh
chmod 600 /root/.ssh/authorized_keys
echo "starting Ansible stuff now......"
### .. removed the ansible stuff for the moment
%include https://config.tombstones.org.uk:23000/tombstones/kickstarts/raw/branch/master/albert/ansible-dave.cfg
#%include https://config.tombstones.org.uk:23000/tombstones/kickstarts/raw/branch/master/albert/ansible-fmb.cfg
## -- 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
#ansible-playbook albert-init.yaml >> /var/log/ansible-run.log
##ansible-playbook playbook.yaml >> /var/log/ansible-run.log
## .. but still didn't work. Cronned to run on reboot (as firewallD isn't running)
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
## ================ end of kickstarts / albert / post.cfg

Loading…
Cancel
Save