Skip to content

Add a terraform flavor

A "terraform flavor" is the thin layer of terraform to spawn the reference infrastructure for deployment.

In init phase, (/playbooks/init.yml), a dedicated group_vars/all.yml is rendered. Look for toc_infra_flavor: variable in it to point to a terraform flavor.

Files

  • Terraform code: /roles/infra/files/<flavor>
  • Templates in: /roles/infra/templates/<flavor>
  • _group_vars.toc.yml.j2: template rendered for global variables.
  • _group_vars.toc_keepers.yml.j2: template rendered for keeper group variables.
  • _group_vars.toc_watchers.yml.j2: template rendered for watcher group variables.
  • _group_vars.toc_workers.yml.j2: template rendered for worker group variables.
  • _inventory.j2: inventory template block
  • _ssh.cfg.j2: ssh.cfg template block

Conformity

Check terraform output names compatibility against this ansible task: APPLY - Terraform output extract in /roles/infra/tasks/_apply.yml.

Validation

After a Terraform application:

ansible -m ping all