Skip to main content
| Ansible @ PyWaw

Ansible
Grzegorz Nosek
PyWaw 21.01.2013
| Ansible @ PyWaw

Ansible
Grzegorz Nosek
PyWaw 21.01.2013
| Ansible @ PyWaw

Ansible
fictitious machine capable of instantaneous
or superluminal communication
– http://en.wikipedia.org/wiki/Ansible
| Ansible @ PyWaw

Ansible
the easiest way to deploy, manage, and orchestrate
computer systems you've ever seen
– http://ansible.cc/
| Ansible @ PyWaw
www1
ssh

www2

master
db1

db2
| Ansible @ PyWaw

# pip install ansible
# mkdir /etc/ansible
# cat > /etc/ansible/hosts << EOF
master

master

[www]
www1
www2
[db]
db1
db2
EOF
| Ansible @ PyWaw
www1

www2

. python (2.6)
. authorized_keys
db1

db2
| Ansible @ PyWaw

mass ssh
ansible all -m ping
ansible www -m service -a „name=nginx
state=restarted”
ansible db1 -m command -a „killall pgdump”
| Ansible @ PyWaw

deploy (fabric)
ansible-playbook deploy.yml
--- hosts: www
actions:
- action: git repo=... dest=...
notify: restart gunicorn
handlers:
- name: restart gunicorn
action: service name=gunicorn
state=restarted
- hosts: db
actions:
- ...
| Ansible @ PyWaw

deploy (fabric)
+ declarative
+ idempotent

wget
./configure && make
make install
template src=... dest=...
service foo state=started
| Ansible @ PyWaw

config mgmt (puppet)
--- hosts: www
actions:
- action: apt pkg=$item
with_items:
- nginx
- python-virtualenv
- action: template src=... dest=...
- action: command foo creates=/etc/bar
| Ansible @ PyWaw

config mgmt (puppet)
+ imperative
+ non-idempotent
+ cross-machine
| Ansible @ PyWaw

provisioning
. EC2
. VMWare
. VirtualBox
. HP iLO
. ...
| Ansible @ PyWaw

Ansible modules
. command
. git
. fetch
. template
. service
. +∞
„

| Ansible @ PyWaw

Boże, żebyśmy my to
mieli w $(job-1)
– Marcin, nasz nowy admin :)
| Ansible @ PyWaw

http://ansible.cc/
QA?