This is an experiment to see how Ansible and Terraform can work together.
In this experiment, Ansible calls Terraform, saves the hosts into an in-memory inventory and runs Ansible to those hosts.
+--- playbook.yml ----+
| - run terraform |
| - save hostnames |
| - run Ansible roles |
+---------------------+
The state of the used roles:
| Role name | GitHub Action | GitLab CI | Version |
|---|---|---|---|
| apt_autostart | |||
| bootstrap | |||
| buildtools | |||
| ca_certificates | |||
| certbot | |||
| cron | |||
| digitalocean-agent | |||
| epel | |||
| fail2ban | |||
| firewall | |||
| httpd | |||
| openssl | |||
| python_pip | |||
| selinux | |||
| update |
ansible-galaxy install -r roles/requirements.yml -f
cd terraform/
terraform init
cd ../
./playbookcd terraform/
terraform destroy
cd ../