ansible api

13
Leveraging the Ansible API Tyler Turk – DevOps Engineer at WP Engine

Upload: tylerturk

Post on 08-May-2015

446 views

Category:

Technology


3 download

DESCRIPTION

A short and sweet presentation going over the API within Ansible that was provided at the Austin Ansible Meet Up on June 25th.

TRANSCRIPT

Page 1: Ansible API

Leveraging the Ansible APITyler Turk – DevOps Engineer at WP Engine

Page 2: Ansible API

Who am I?

DevOps Engineer at WP Engine

Enjoys Operations, Development, and long walks on the beach

Page 3: Ansible API

Ansible API

Page 4: Ansible API

Ansible API Use Cases

• Server Provisioning Automation

• Wrapping Ansible calls in scripts

• Gaining deeper understanding of

the Ansible internals

Page 5: Ansible API

Best Examples – Ansible Code Itself!

Ansible Ansible Playbook

Page 6: Ansible API

Breaking it Down – Ansible API

3 module parameters

• Module Name

• Module Path

• Module Arguments

Several Authentication Options

• Remote user / pass

• User / pass / options for su(do)

• Vault password

• Private Key

Page 7: Ansible API

Breaking it Down – Ansible API• Inventory / Pattern / Subset

• Timeout

• Forks

• Callbacks

• Transport method

• Check / Diff options

Page 8: Ansible API

Breaking it Down – Ansible-Playbook API

Shares many of the same arguments

Includes new arguments:

• Playbook (obviously!)

• Callbacks for runner and playbook

• Stats

• Extra variables

• Tag logic (skip, only)

• Force / flush handlers

Page 9: Ansible API

Inventory Management

• Need to define inventory

• Can define subset

• Easy to instantiate

Page 10: Ansible API

Ansible Plugins

Types of plugins:

• Connection Type

• Lookup

• Vars

• Filter

• Callbacks

Page 11: Ansible API

Callback Plugins – Ooo, interesting…

• Customize actions

• Aggregate/manipulate results

• Create historic logs and

dashboards

Page 12: Ansible API

Examples!

Page 13: Ansible API

Questions? There are some “less good” ones…