Last active
June 17, 2016 15:34
-
-
Save algotrader-dotcom/ec559c8cc85074ae583d147972eb1235 to your computer and use it in GitHub Desktop.
ansible aws ec2 dynamic inventory
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 0. Requirements | |
| - Ansible latest version | |
| - AWS access key | |
| - SSH key | |
| 1. Install ansible | |
| cd /opt | |
| git clone https://github.com/ansible/ansible.git | |
| cd ansible | |
| source ./hacking/env-setup | |
| pip install paramiko pyyaml jinja2 --upgrade | |
| 2. Configurations | |
| export AWS_ACCESS_KEY_ID='your-access-key' | |
| export AWS_SECRET_ACCESS_KEY='your-secret-key' | |
| export ANSIBLE_HOST_KEY_CHECKING=False | |
| 3. Check with ping module | |
| ansible -m ping all -i /opt/ansible/contrib/inventory/ec2.py --private-key ~/.ssh/Tools.pem | |
| 4. Up comming | |
| - I will create docker later | |
| - You can config --private-key in /etc/ansible/ansible.cfg |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment