Provisioning
The hardware in the cluster is fully provisioned and managed using Ansible. Specifically the provisioning and updating procedures of all cluster nodes are automated using two separate playbooks.
Inventory
Inside this file all hosts for the cluster and their connection details are defined.
# cluster
[masters]
coruscant.iske.cloud ansible_user=pi
kashyyyk.iske.cloud ansible_user=pi
alderaan.iske.cloud ansible_user=pi
[workers]
dathomir.iske.cloud ansible_user=pi
mustafar.iske.cloud ansible_user=pi
jakku.iske.cloud ansible_user=pi
[cluster:children]
masters
workers
# backup
[backup]
ryloth.iske.cloud ansible_user=pascaliske
Playbooks
provision.yml
TL;DR — ansible/playbooks/provision.yml
For a initial and complete provisioning of all nodes the following command can be used:
To only run specific parts of the playbook the --tags flag can be appended to the command:
The following tags are available for usage with --tags:
mastersworkerscommonjournallog2ramlogrotatetailscalek3sminio
update.yml
TL;DR — ansible/playbooks/update.yml
The update playbook allows me to simply update / patch all nodes:
To only run specific parts of the playbook the --tags flag can be appended to the command:
The following tags are available for usage with --tags:
mastersworkers
cleanup.yml
TL;DR — ansible/playbooks/cleanup.yml
Sometimes, logrotate and log2ram can't keep up with the log files. For this rare cases I have an cleanup playbook which allows me to cleanup the /var/log folders of all cluster nodes to prevent an overflow of the available disk space:
To only run specific parts of the playbook the --tags flag can be appended to the command:
The following tags are available for usage with --tags:
mastersworkerslogs
Limit
All playbooks can be executed on a limited set of hosts using the --limit flag:
Any hosts from the inventory can be used with this flag.
Vault
Some values needed for the above playbooks are stored as an encrypted secrets file using Ansible Vault.
To encrypt or decrypt I use the following commands: