Opened 12 months ago

Last modified 7 days ago

#58 accepted Task

Update/Document Ansible Scripts.

Reported by: D Delmar Davis Owned by: D Delmar Davis
Priority: Priority Milestone: Make Shit Happen / Own Your Shit.
Component: Infrastructure Keywords: ansible, lxc, documentation
Cc: Joe Dumoulin

Description (last modified by D Delmar Davis)

I need to make ansible do more work here and should probably make some documentation about my love (/FUCKING HATE) for ansible.

lets start here...
AnsibleScriptsForContainers.

Top of the list.

  • <del>Check for and stop duplicate running containers.</del>Done.
  • <del>Make nightly duplicates and cleanup any duplicates created.</del>Done.
  • <del>(related) Shift containers between machines.</del> This can wait.
  • <del>Adapt or r</del>Rewrite scripts *in python* to shift Host from kb2018 to <del>bs2020</del>aoc2024
  • Make archives work with vm's as well as containers
  • Document usage of existing scripts.

Change History (9)

comment:1 Changed 12 months ago by D Delmar Davis

Priority: ImportantPriority

comment:2 Changed 12 months ago by D Delmar Davis

Status: assignedaccepted

comment:3 Changed 10 months ago by D Delmar Davis

The ansible playbooks on kb2018 should be generalized so that they can be used on the local servers. To do this I need to separate the playbooks from the configuration files. The configuration files should then be placed in their own repositories and the playbooks maintained as a sub module.

Refs

comment:4 Changed 9 months ago by D Delmar Davis

Wrote crontab to keep Snapshots from running on bs2020:

root@bs2020:/home/feurig# cat /etc/cron.d/norunningsnapshots 
*/2 * * * * root lxc list|grep RUN|grep Snapshot|sed 's/^| //'|cut -f1 -d' '|sed 's/^/lxc stop /'|sh

For some reason this did not work from kb2018

comment:5 Changed 9 months ago by D Delmar Davis

The ansible playbooks can be used on the home servers by using a localized inventory.

root@annie:/etc/ansible# ansible-playbook -i merlot.hosts playbooks/create-lxd-containers.yml

comment:6 Changed 9 months ago by D Delmar Davis

Migrating nightly snapshots to python only (using ansible runner to get host info and move container snapshots).

https://bitbucket.org/suspectdevicesadmin/ansible/src/master/python/NightlySnapshots.py

Once the cleanup scripts are finished I will crontab these.

comment:7 Changed 9 months ago by D Delmar Davis

Added nightly snapshots to /etc/cron.daily/ should run nightly.

comment:8 Changed 9 months ago by D Delmar Davis

Met NOOOOOO!

root@kb2018:~# crontab -l
....
# m h  dom mon dow   command
#@midnight /etc/ansible/python/NightlySnapshots.py
0 0 * * * /etc/ansible/python/NightlySnapshots.py

comment:9 Changed 7 days ago by D Delmar Davis

Description: modified (diff)
Note: See TracTickets for help on using tickets.