Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Ansible on AWS

660 views

Published on

Ansible on AWS

Published in: Technology
  • Login to see the comments

Ansible on AWS

  1. 1. @diego_pacheco Software Architect | Agile Coach Ansible
  2. 2. Ansible Is a Orchestration And Automation Engine
  3. 3. Ansible Is the language used to write ansible. Is the agent-less it just needs It`s based in recopies, for ansible This recopies are called: playbooks.
  4. 4. Who is using Ansible?
  5. 5. Overview
  6. 6. Tower
  7. 7. Comparison
  8. 8. Comparison
  9. 9. Comparison
  10. 10. AWS
  11. 11. Boto https://github.com/boto/boto
  12. 12. Keypair
  13. 13. Instance
  14. 14. Instance
  15. 15. Instance
  16. 16. Instance
  17. 17. Instance
  18. 18. Instance
  19. 19. Instance
  20. 20. Instance
  21. 21. SSH to AWS
  22. 22. PEM: Copy PEM file with winscp
  23. 23. ~$ sudo apt-get update ~$ sudo apt-get install python-pip ~$ sudo pip install boto ~$ sudo pip install paramiko PyYAML Jinja2 httplib2 Installing Ansible ~$ sudo apt-get install git ~$ git clone git://github.com/ansible/ansible.git –recursive ~$ cd ansible/ ~$ source ./hacking/env-setup ~$ sudo mkdir /etc/ansible ~$ sudo touch /etc/ansible/hosts
  24. 24. Installing Ansible ~$ wget https://raw.githubusercontent.com/ansible/ansible/devel/plugins/inventory/ec2.py ~$ wget https://raw.githubusercontent.com/ansible/ansible/devel/plugins/inventory/ec2.ini ~$ export ANSIBLE_HOSTS=/home/ubuntu/ec2.py ~$ export EC2_INI_PATH=/home/ubuntu/ec2.ini ~$ chmod +x /home/ubuntu/ec2.py ~$ ssh-agent bash ~$ chmod 400 zerotocloud.pem ~$ ssh-add zerotocloud.pem ~$ touch ~/.boto
  25. 25. Installing Ansible ~$ ~/.boto [Credentials] aws_acess_key_id = ‘YOUR_KEY’ aws_secret_acess_key = ‘YOUR_SECRET’ ~$ python ec2.py –list
  26. 26. Ansible Hosts
  27. 27. Testing Ansible ~$ ansible all -m ping -i ansible_hosts --private-key zerotocloud.pem
  28. 28. Create Another Instance
  29. 29. Security Group: SSH ACESS
  30. 30. Running Ansible ~$ ansible-playbook test_pb.yml -f 1 --private-key zerotocloud.pem test_pb.yml --- - hosts: machine1 remote_user: ubuntu tasks: - name: test connection ping: remote_user: ubuntu
  31. 31. Running Ansible
  32. 32. https://galaxy.ansible.com/ Ansible Galaxy
  33. 33. @diego_pacheco Software Architect | Agile Coach Ansible Obrigado! Thank You!

×