Upload
diego-pacheco
View
101
Download
2
Tags:
Embed Size (px)
Citation preview
Ansible
Is the language used to write ansible.
Is the agent-less it just needs
It`s based in recopies, for ansibleThis recopies are called: playbooks.
~$ 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
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
Installing Ansible
~$ ~/.boto
[Credentials]aws_acess_key_id = ‘YOUR_KEY’aws_secret_acess_key = ‘YOUR_SECRET’
~$ python ec2.py –list
Running Ansible
~$ ansible-playbook test_pb.yml -f 1 --private-key zerotocloud.pem
test_pb.yml---- hosts: machine1
remote_user: ubuntutasks:
- name: test connectionping:remote_user: ubuntu