Ansible Overview Guide
Ansible Overview Guide
Ansible Overview Guide
[appservers]
app1.example.com
app1.example.com
[webservers]
webserver1.example.com
webserver2.example.com
PLAYBOOKS AND ROLES
PLAYBOOKS
DOING STUFF AND THINGS
Playbooks are a way to combine many tasks, written in YAML, to be carried out against one
or many hosts.
---
- name: common things to run on all hosts - name: webserver-only tasks
hosts: all hosts: webservers
tasks: tasks:
- name: make sure bash is installed - name: start and enable httpd service
yum: service:
pkg: bash name: httpd
state: installed state: started
enabled: yes
INCLUDES
DON’T JUST COPY/PASTE … COWSAY IS WATCHING
Include file defines a set of tasks that can be included by a playbook, this allows sharing
sets of tasks without copy/pasting everywhere.
enablewebservice.yml webserver.yml
--- ---
- name: start and enable httpd - name: Webserver Playbook
service: hosts: webservers
name: httpd tasks:
state: enabled - include: enablewebservice.yml ____________________________
< Don't copy/paste, include! >
----------------------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
Playbooks can also include other playbooks! || ||
ROLES
YOUR MOM WAS RIGHT, IT’S BETTER TO SHARE
Roles are reusable logical groupings of tasks that (normally) define Typical Role Layout
a service
● Role-level subdirs for namespaced variable defaults, files, myrole/
├── defaults
templates, and handlers │ └── main.yml
● Can pass variables to roles to modify behavior per-use ├── files
├── handlers
● Searched for and/or shared via Ansible Galaxy │ └── main.yml
○ https://galaxy.ansible.com/ ├── tasks
│ └── main.yml
--- ├── templates
- name: using myrole └── vars
- hosts: webservers └── main.yml
- roles:
- myrole
WHAT IS ANSIBLE?
USING ANSIBLE FOR EVERYTHING
WHY WOULD I WANT TO DO THAT?
Networking ● Netvisor
● Open vSwitch
● A10 Networks
● Palo Alto Networks PAN-OS
● Apstra AOS
● Nokia SR OS
● Arista EOS
● VyOS
● Avi Networks
● BigSwitch Databases
● Cisco (ASA, IOS/IOS-XR, and NX-OS)
● InfluxDB
● Cumulus Networks (Cumulus Linux)
● Redis
● Dell EMC (OS6, OS9, and OS10)
● Riak
● F5 BigIP ● MS-SQL
● Fortios Firewall
● MySQL
● JunOS
● Postgresql
● Lenovo CNOS
● Vertica
PROVISIONING - CONTINUED
SERIOUSLY? MORE STUFF?
Software Deployment is the act of making software available on systems; most often, this is
a sequence of steps that must be performed in-order. (In-order task execution anyone?)
Example:
● Sync some data
● Database schema migration
● Remove systems from load balancer
● Push new code
● Put systems back in load balancer
○ Rinse/Repeat on previously not upgraded set
● Verify services are functional
● Status update
Remember what a Playbook does?
APPLICATION LIFECYCLE MANAGEMENT
DO IT LIVE!
Flow controlled automation by data from the environment allowing the automation tasks to
make “intelligent” decisions.
COMMAND LINE TOOLING
BUT WHAT ABOUT MY PERL ONE-LINERS?
Make Ansible your new command line tooling API, stop re-inventing the wheel
● Ansible provides a very capable Python API for modules
● Modules can be written in any programming language that understands JSON
● Provides a consistent “UX” for all tasks
● Gives you and your ops team an “on ramp” to scaling your tasks across the
infrastructure
Nicolas FANJEAU
Airbus Infrastructure
Red Hat Summit 2017
Airbus
Passion
Moscow
Fuhlsbüttel
Filton Stade Hamburg
Broughton Bremen Buxtehude
St. Nazaire Nantes
Blagnac
Wichita Ashburn Barajas St. Martin
Getafe Beijing
Washington Tianjin
Mobile
Miami Abu Dhabi Dubai
Bangalore
106 000 users 96 000 users 94 000 users 72 000 users 368 000
19 billions transactions
13 000 Servers per year on SAP
4 200 MIPS on Mainframe Data to end 2015
A Project
• Solves the IT Service
Management (ITSM)
Use the „dilemma“ and reduces the
opportunity to number of tools
Our needs
Functional Solution
Entry in Service
Robust
Library
Maintenance Integrated
Job Scheduler Scalable
Deployment
Public Cloud
High Availability
Linux Private Cloud
Secure
Windows
Interoperable
Plug and play Cost
Segregation
Reporting Agent less
Automation as Self Service
EXPECTATIONS
• Reduce time and cost to deploy application
• Move to DevOps philosophy
• Give back the responsibility to Application Owner
• Simplify process
SOLUTION
• Propose customer oriented service for Automation
• Develop the service for and with the customers
• Propose tailored solutions to all customers via a
catalogue of services
• Awareness on Automation
• Training : Platform usage, How to implement Playbook
• Playbook On Demand, conversion of Install Manual to Playbook
• eLearning, User Manual, Best practices
From the PoC to the Project
PoC
• Objective is to evaluate the solution Key Figures
• Test the deployment of 5 applications (Win & Linux)
with 6 automation solutions PoC on 100 Hosts
Result
• Despite missing functionalities of Tower vs Target 10 000 Hosts
Competitors, Tower finish first one based on the
criteria matrix First deployment 6 months
• Deployed in Production during the PoC for two
critical applications for
• Release deployment
• Job scheduler
10 000 hosts
10/2016 02/2017 2000 hosts 6 000 hosts
04/2017
PoC Decision Start deployment 2018 2019
@TheMaxamillion