Skip to content

Instantly share code, notes, and snippets.

@algotrader-dotcom
Last active June 17, 2016 15:34
Show Gist options
  • Select an option

  • Save algotrader-dotcom/ec559c8cc85074ae583d147972eb1235 to your computer and use it in GitHub Desktop.

Select an option

Save algotrader-dotcom/ec559c8cc85074ae583d147972eb1235 to your computer and use it in GitHub Desktop.
ansible aws ec2 dynamic inventory
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