infra-waku/ansible
Jakub Sokołowski cac71062d5
requirements: bump nim-waku to include toml config file
Signed-off-by: Jakub Sokołowski <jakub@status.im>
2024-03-06 10:00:54 +01:00
..
files Initial commit 2023-10-05 14:08:18 +02:00
group_vars waku.test: replace ws url with http for rln-relay 2024-02-16 13:09:28 +01:00
inventory terraform: add sandbox stage 2024-02-23 12:12:18 +01:00
lookup_plugins Initial commit 2023-10-05 14:08:18 +02:00
README.md Initial commit 2023-10-05 14:08:18 +02:00
bootstrap.yml Initial commit 2023-10-05 14:08:18 +02:00
main.yml conn-limit: not needed as nim-waku has a built-in feature 2023-11-06 15:26:14 +01:00
requirements.yml requirements: bump nim-waku to include toml config file 2024-03-06 10:00:54 +01:00
terraform.py Initial commit 2023-10-05 14:08:18 +02:00
upgrade.yml Initial commit 2023-10-05 14:08:18 +02:00
versioncheck.py Initial commit 2023-10-05 14:08:18 +02:00

README.md

Description

Herein lie all ansible related files except for ansible.cfg at the root of the repo for easier usage without having to cd here.

Usage

Simply run the play related to the specific type of configuration you want to deploy:

 > ls -1 ansible/*.yml 
ansible/bootstrap.yml
ansible/upgrade.yml
ansible/main.yml
ansible-playbook ansible/main.yml

Bootstrap

All hosts are bootstraped right after provisioning using these roles:

If you want to re-run any bootstrap step you can do it like so:

ansible-playbook ansible/bootstrap.yml -t role::bootstrap:hostname

In this case only the hostname set of tasks will be executed due to the role::bootstrap:hostname tag.

Inventory

The inventory we use is crated by Terraform via the terraform-provider-ansible which generates the necessary data structures in the Consul Key/Value store that is later used by the terraform.py script to provide hosts and their variables to Ansible.

Some ways to view existing hosts:

ansible localhost -m debug -a 'var=groups'
ansible all -o -m debug -a 'var=ansible_host' | columns -t

Variables

Ansible variables can be provided to Ansible using the --extra-vars/-e flag. An example of such a flag is

compose_state: 'present'
compose_recreate: 'smart'
compose_restart: false

These are used in every role that starts docker containers. You can use them to change the behaviour of roles. For example to re-create all metric related containers use:

ansible-playbook ansible/main.yml -e compose_recreate=always

Secrets

Secrets are stored and provided in two ways: