Using Ansible Dynamic Inventory to deploy Web Server on AWS

Task 2:

Statement : Deploy Web Server on AWS through ANSIBLE!

  1. Basic knowledge of Ansible like roles, playbook, vault, etc.
  2. Already configured Ansible tool
  3. Boto library pip3 install boto plugin file for ec2 dynamic inventory
  4. Optional: My Github repository
ansible --version
mkdir /home/ansible_task2
chmod +x ec2.py
ansible-galaxy init ec2_instance 
ansible-galaxy init web_server
ansible-galaxy list
  • Create a template file in <templates/> directory in web_server role and you can write your configuration in this.
ansible-playbook <playbook_name_ec2_instance> --ask-vault-pass
ansible-playbook <playbook_name_web_server>