Smau Milano 2016 - Fabio Alessandro Locati

30
Ansible Configuration Management System done right Fabio Alessandro Locati 25 October 2016

Transcript of Smau Milano 2016 - Fabio Alessandro Locati

Page 1: Smau Milano 2016 - Fabio Alessandro Locati

AnsibleConfiguration Management System done right

Fabio Alessandro Locati25 October 2016

Page 2: Smau Milano 2016 - Fabio Alessandro Locati

Outline

Intro

Ansible

1

Page 3: Smau Milano 2016 - Fabio Alessandro Locati

Intro

Page 4: Smau Milano 2016 - Fabio Alessandro Locati

About me

• IT Consultant since 2004• Ansible user since 2013

2

Page 5: Smau Milano 2016 - Fabio Alessandro Locati

About me

• IT Consultant since 2004

• Ansible user since 2013

2

Page 6: Smau Milano 2016 - Fabio Alessandro Locati

About me

• IT Consultant since 2004• Ansible user since 2013

2

Page 7: Smau Milano 2016 - Fabio Alessandro Locati

Idempotence

DefinitionIdempotence is the property of certain operations in mathematics and computerscience, that can be applied multiple times without changing the result beyond theinitial application.

3

Page 8: Smau Milano 2016 - Fabio Alessandro Locati

Ansible

• Written in Python• Mainly push mode• Advantages

• Infrastructure as Data (in YAML format)• Very gentle learning curve• Very simple setup• Balanced tool

• Disadvantages

• Not very good introspection tools• Community is young

4

Page 9: Smau Milano 2016 - Fabio Alessandro Locati

Ansible

• Written in Python

• Mainly push mode• Advantages

• Infrastructure as Data (in YAML format)• Very gentle learning curve• Very simple setup• Balanced tool

• Disadvantages

• Not very good introspection tools• Community is young

4

Page 10: Smau Milano 2016 - Fabio Alessandro Locati

Ansible

• Written in Python• Mainly push mode

• Advantages

• Infrastructure as Data (in YAML format)• Very gentle learning curve• Very simple setup• Balanced tool

• Disadvantages

• Not very good introspection tools• Community is young

4

Page 11: Smau Milano 2016 - Fabio Alessandro Locati

Ansible

• Written in Python• Mainly push mode• Advantages

• Infrastructure as Data (in YAML format)• Very gentle learning curve• Very simple setup• Balanced tool

• Disadvantages

• Not very good introspection tools• Community is young

4

Page 12: Smau Milano 2016 - Fabio Alessandro Locati

Ansible

• Written in Python• Mainly push mode• Advantages

• Infrastructure as Data (in YAML format)

• Very gentle learning curve• Very simple setup• Balanced tool

• Disadvantages

• Not very good introspection tools• Community is young

4

Page 13: Smau Milano 2016 - Fabio Alessandro Locati

Ansible

• Written in Python• Mainly push mode• Advantages

• Infrastructure as Data (in YAML format)• Very gentle learning curve

• Very simple setup• Balanced tool

• Disadvantages

• Not very good introspection tools• Community is young

4

Page 14: Smau Milano 2016 - Fabio Alessandro Locati

Ansible

• Written in Python• Mainly push mode• Advantages

• Infrastructure as Data (in YAML format)• Very gentle learning curve• Very simple setup

• Balanced tool

• Disadvantages

• Not very good introspection tools• Community is young

4

Page 15: Smau Milano 2016 - Fabio Alessandro Locati

Ansible

• Written in Python• Mainly push mode• Advantages

• Infrastructure as Data (in YAML format)• Very gentle learning curve• Very simple setup• Balanced tool

• Disadvantages

• Not very good introspection tools• Community is young

4

Page 16: Smau Milano 2016 - Fabio Alessandro Locati

Ansible

• Written in Python• Mainly push mode• Advantages

• Infrastructure as Data (in YAML format)• Very gentle learning curve• Very simple setup• Balanced tool

• Disadvantages

• Not very good introspection tools• Community is young

4

Page 17: Smau Milano 2016 - Fabio Alessandro Locati

Ansible

• Written in Python• Mainly push mode• Advantages

• Infrastructure as Data (in YAML format)• Very gentle learning curve• Very simple setup• Balanced tool

• Disadvantages• Not very good introspection tools

• Community is young

4

Page 18: Smau Milano 2016 - Fabio Alessandro Locati

Ansible

• Written in Python• Mainly push mode• Advantages

• Infrastructure as Data (in YAML format)• Very gentle learning curve• Very simple setup• Balanced tool

• Disadvantages• Not very good introspection tools• Community is young

4

Page 19: Smau Milano 2016 - Fabio Alessandro Locati

Ansible

Page 20: Smau Milano 2016 - Fabio Alessandro Locati

Ansible concepts

• Host: Target of the execution• Module: Modules can control system resources, like services, packages, or files

(anything really), or handle executing system commands.• Module library: Default set of modules coming with Ansible basic installation• Task: An istance of a Module• Role: A way to abstract a collection of tasks that has a specific role and is

idempotent• Playbook: A collection of Tasks and Roles that could be idempotent (or not)

5

Page 21: Smau Milano 2016 - Fabio Alessandro Locati

Ansible concepts

• Host: Target of the execution

• Module: Modules can control system resources, like services, packages, or files(anything really), or handle executing system commands.

• Module library: Default set of modules coming with Ansible basic installation• Task: An istance of a Module• Role: A way to abstract a collection of tasks that has a specific role and is

idempotent• Playbook: A collection of Tasks and Roles that could be idempotent (or not)

5

Page 22: Smau Milano 2016 - Fabio Alessandro Locati

Ansible concepts

• Host: Target of the execution• Module: Modules can control system resources, like services, packages, or files

(anything really), or handle executing system commands.

• Module library: Default set of modules coming with Ansible basic installation• Task: An istance of a Module• Role: A way to abstract a collection of tasks that has a specific role and is

idempotent• Playbook: A collection of Tasks and Roles that could be idempotent (or not)

5

Page 23: Smau Milano 2016 - Fabio Alessandro Locati

Ansible concepts

• Host: Target of the execution• Module: Modules can control system resources, like services, packages, or files

(anything really), or handle executing system commands.• Module library: Default set of modules coming with Ansible basic installation

• Task: An istance of a Module• Role: A way to abstract a collection of tasks that has a specific role and is

idempotent• Playbook: A collection of Tasks and Roles that could be idempotent (or not)

5

Page 24: Smau Milano 2016 - Fabio Alessandro Locati

Ansible concepts

• Host: Target of the execution• Module: Modules can control system resources, like services, packages, or files

(anything really), or handle executing system commands.• Module library: Default set of modules coming with Ansible basic installation• Task: An istance of a Module

• Role: A way to abstract a collection of tasks that has a specific role and isidempotent

• Playbook: A collection of Tasks and Roles that could be idempotent (or not)

5

Page 25: Smau Milano 2016 - Fabio Alessandro Locati

Ansible concepts

• Host: Target of the execution• Module: Modules can control system resources, like services, packages, or files

(anything really), or handle executing system commands.• Module library: Default set of modules coming with Ansible basic installation• Task: An istance of a Module• Role: A way to abstract a collection of tasks that has a specific role and is

idempotent

• Playbook: A collection of Tasks and Roles that could be idempotent (or not)

5

Page 26: Smau Milano 2016 - Fabio Alessandro Locati

Ansible concepts

• Host: Target of the execution• Module: Modules can control system resources, like services, packages, or files

(anything really), or handle executing system commands.• Module library: Default set of modules coming with Ansible basic installation• Task: An istance of a Module• Role: A way to abstract a collection of tasks that has a specific role and is

idempotent• Playbook: A collection of Tasks and Roles that could be idempotent (or not)

5

Page 27: Smau Milano 2016 - Fabio Alessandro Locati

Ansible infrastructure

+---------------------+|-->| ws01.fale.io || +---------------------+|

+---------------------+ | +---------------------+| Ansible Controller |-----|-->| ws02.fale.io |+---------------------+ | +---------------------+

|| +---------------------+|-->| db01.fale.io |

+---------------------+

6

Page 28: Smau Milano 2016 - Fabio Alessandro Locati

Basic Commands

ansible all -u root -m setup

7

Page 29: Smau Milano 2016 - Fabio Alessandro Locati

Layout

8

Page 30: Smau Milano 2016 - Fabio Alessandro Locati

Links

• Slides: https://slides.fale.io/20161025-en-ansible-ws.pdf• Demo source: https://github.com/Fale/ansible_lamp• Official documentation: http://docs.ansible.com• Videos: https://www.ansible.com/videos• Ebooks: https://www.ansible.com/ebooks• Fedora Infrastructure: https://infrastructure.fedoraproject.org/cgit/ansible.git• Ceph: https://github.com/ceph/ceph-ansible• OpenStack: https://github.com/openstack/openstack-ansible• OpenShift: https://github.com/openshift/openshift-ansible

9