DV Dasari: Use Ansible for AWS Provisioning and Configuration Management
The playbook.yml
and files/
, group_vars/
& templates/
directories in the /provisioning/
directory control the configuration of the Vagrant machine. The file system in the /ansible/
directory is used by the Vagrant-Powered Ansible management system.
/provisioning/group_vars/all
should be created on your instance with your own AWS credentials supplied for the corresponding variables.
/provisioning/files/awsprivatekey.txt
should be created on your instance with your own AWS EC2 key pair's private key (required for EC2 instance deployment)
/ansible/vault_pass.txt
should be created on your instance with the password to be used for Ansible Vault encoding/decoding.
config.yaml
should be edited to select the desired Ansible version in the configs::use
value. Current versions supported:
2.8
: Ansible 2.8.x on Rocky Linux 8/Python 3.92.9
: Ansible 2.9.x on Rocky Linux 8/Python 3.92.10
: Ansible 2.10.x on Rocky Linux 8/Python 3.93.x
: Ansible 3.x on Rocky Linux 8/Python 3.94.x
: Ansible 4.x on Rocky Linux 8/Python 3.9 (default)5.x
: Ansible 5.x on Rocky Linux 8/Python 3.9
vagrant up
and vagrant ssh
into your virtual Ansible development environment.
After the Ansible management VM has been created, you can run vagrant provision
to adjust the running configuration when required. It's recommended to run vagrant provision
every time the VM is resumed after creation. (See below.)
Thanks to DV Dasari for inspiring this toolset.
The method for configuring support for multiple Ansible versions was inspired by this StackOverflow response.