Part 3: Ansible and Dynamic Inventory
Before you forget, make sure to cp your aws credentials AND EC2 key to the jenkins user if that's the route you are going to take:
We want to have ansible run and utilize a Dynamic Inventory to account for EC2 instances coming and going.
For this we need the following directory/files:
/etc/ansible/aws_ec2.yaml
/etc/ansible/group_vars/tag_group_web.yaml
/etc/ansible/ansible.cfg
./ansible/static-site/site.yaml
so let's start with the /etc/ folder. Recall that the boto_profile is your credential for JENKINS in this case.
/var/lib/jenkins/.aws/credentials
/etc/ansible/aws_ec2.yaml
/etc/ansible/group_vars/tag_group_web.yaml
/etc/ansible/ansible.cfg
and finally our ansible playbook in our directory (note the image at the end should be YOUR docker image:
./ansible/static-site/site.yaml
And that's all for Ansible.
Comments
Post a Comment