In this project, a flask web app is configured in an EC2 instance using Ansible.
Change hosts to localhost in ansible/main-remote.yml
And run the following command:
$ ansible-playbook ansible/main-remote.yml --verbose --ask-become-pass
First, we need to define an inventory file with all the IP addresses of the
instances where we want Ansible to connect, and for that, I created a shell
script in the ansible
directory within this project.
To create the inventory file run the following in your terminal:
$ ansible/create_inventory.sh
Run the following command:
$ ansible-playbook ansible/main-remote.yml -i $INVENTORY_FILE --private-key $EC2_KEY_PATH
The deployment of this project is done through AWS Cloudformation. For the deployment I decided to use an EC2 instance with ubuntu 18.
aws cloudformation deploy \
--template-file infrastructure/server.yml \
--stack-name simple-deploy \
--region us-east-1 \
--profile personal