Ansible Tips
Just a collection of things I’ve found useful for ansible/semaphore-ui
Nested inventory
Section titled “Nested inventory”With semaphore-ui .ini files don’t work as a nested inventory. Have to use .yml
Semaphore using nested inventory create it as /inventory/xxx
Global configuration
Section titled “Global configuration”Semaphore will pull in the ansible.cfg file and apply setting there
Some nice defaults are:
[defaults]# This makes the console output look like a clean document# rather than a giant JSON blob.result_format=yamlbin_ansible_callbacks = Truehost_key_checking = Falseinterpreter_python = auto_silentSeamphore database stuff
Section titled “Seamphore database stuff”due to anticipated retirement of boltdb, I migrated to postgresql running in a docker container
boltdb to postgres migration
Section titled “boltdb to postgres migration”semaphore migrate --from-boltdb /var/lib/semaphore/database.boltdb --merge-existing-usersBackup postgresql command
Section titled “Backup postgresql command”docker exec POSTGRES_CONTAINER pg_dumpall -U POSTGRES_USER > /tmp/postgres_full_backup.sql