Codemotion 2015

27
Ansible by example CAS2015

Transcript of Codemotion 2015

Page 1: Codemotion 2015

Ansible by exampleCAS2015

Page 2: Codemotion 2015

MeOperations

@TicketbisEng

Ticket marketplace

1M Tickets over 50 countries

90M € in 2015

David González

@penguinjournals

Page 3: Codemotion 2015

Ansible

- IT automation, provision, deploy, ad hoc commands

- Agentless

- Python + SSH

- From basics to full control

Page 4: Codemotion 2015

Task1https://github.com/penguinjournals/ansible-101/blob/master/task1/task1.md

Page 5: Codemotion 2015

NO software improvement,

just tech porn.

Page 6: Codemotion 2015

Inventory and configuration file

- Gather all your machines

- Group them

- Use it to run commands against single or multiple machines

Page 7: Codemotion 2015

Task2https://github.com/penguinjournals/ansible-101/blob/master/task2/task2.md

Page 8: Codemotion 2015

Improvement:

- Your infrastructure is documented

- Groups of hosts, no ssh cowboys

Page 9: Codemotion 2015
Page 10: Codemotion 2015

Modules, tasks, plays, playbooks

- Modules are used to control system resources

http://docs.ansible.com/ansible/modules.html

- Plays map tasks to roles

- Playbooks are descriptions of the desired state of your systems

http://docs.ansible.com/ansible/playbooks_intro.html

- Repeatable and reliable

Page 11: Codemotion 2015

Task3https://github.com/penguinjournals/ansible-101/blob/master/task3/task3.md

Page 12: Codemotion 2015

Improvement:

- Setup documented

- Setup is the same in all hosts

- Setup is repeatable in new hosts

Page 13: Codemotion 2015

USE VERSION CONTROL

Page 14: Codemotion 2015
Page 15: Codemotion 2015

Roles

- DRY, reusable pieces of playbooks with a defined purpose (common, nginx,

tomcat)

- Good practice: separate setup roles from application deployment roles

Page 16: Codemotion 2015

Task4https://github.com/penguinjournals/ansible-101/blob/master/task4/task4.md

Page 17: Codemotion 2015

Improvement:

- Reutilization at infrastructure level

- DRY

Page 18: Codemotion 2015

Application deployment

- http://www.ansible.com/application-deployment

Page 19: Codemotion 2015

Task5https://github.com/penguinjournals/ansible-101/blob/master/task5/task5.md

Page 20: Codemotion 2015

Improvement:

- Automated deployments

- Push button deployments

Page 21: Codemotion 2015

Cloud

- Dynamic inventories, default and custom

- Amazon cloud modules (Amazon AWS, GCE, Azure, DigitalOcean, Linode...)

http://docs.ansible.com/ansible/list_of_cloud_modules.html

Page 22: Codemotion 2015

Task6https://github.com/penguinjournals/ansible-101/blob/master/task6/task6.md

Page 23: Codemotion 2015

Improvement:

- Autoescalable deployment

- Integrate cloud management in

deployment tasks

Page 24: Codemotion 2015

From adhoc

commands, to full

management of your

infrastructure.

Page 25: Codemotion 2015

Resources

- http://www.ansible.com/resources

- http://docs.ansible.com/ansible/modules.html

- https://galaxy.ansible.com

- https://groups.google.com/forum/#!forum/ansible-project

- https://www.google.com

Page 26: Codemotion 2015

WE ARE HIRING!

[email protected]

Page 27: Codemotion 2015