self-service it - red hat...self-service it with ansible tower & microsoft azure chris...

69
SELF-SERVICE IT WITH ANSIBLE TOWER & MICROSOFT AZURE Chris Houseknecht Dave Johnson June 2016 #redhat #rhsummit 1

Upload: others

Post on 24-Jun-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: SELF-SERVICE IT - Red Hat...SELF-SERVICE IT WITH ANSIBLE TOWER & MICROSOFT AZURE Chris Houseknecht Dave Johnson June 2016 #redhat #rhsummit 1. THE HARD PART IS BUILDING THE MACHINE

SELF-SERVICE ITW I T HA N S I B L E TO W E R & M I C R O S O F T A Z U R E

Chris HouseknechtDave Johnson

June 2016

#redhat #rhsummit

1

Page 2: SELF-SERVICE IT - Red Hat...SELF-SERVICE IT WITH ANSIBLE TOWER & MICROSOFT AZURE Chris Houseknecht Dave Johnson June 2016 #redhat #rhsummit 1. THE HARD PART IS BUILDING THE MACHINE

THE HARD PART ISBUILDING THE MACHINETHAT BUILDS THEPRODUCT

—Dennis Crowley, Co-Founder/CEO of Foursquare

2 . 1

Page 3: SELF-SERVICE IT - Red Hat...SELF-SERVICE IT WITH ANSIBLE TOWER & MICROSOFT AZURE Chris Houseknecht Dave Johnson June 2016 #redhat #rhsummit 1. THE HARD PART IS BUILDING THE MACHINE

T H O S E W H O A R E M O S TS U C C E S S F U L A R E C A PA B L E O F‘ H I G H E R L E V E L T H I N K I N G ’ —T H E Y A R E A B L E TO S T E P B AC KA N D D E S I G N A ‘ M AC H I N E ’C O N S I S T I N G O F T H E R I G H TP E O P L E D O I N G T H E R I G H TT H I N G S TO G E T W H AT T H E Y WA N T.

—Ray Dalio, Founder of Bridgewater Associates

2 . 2

Page 4: SELF-SERVICE IT - Red Hat...SELF-SERVICE IT WITH ANSIBLE TOWER & MICROSOFT AZURE Chris Houseknecht Dave Johnson June 2016 #redhat #rhsummit 1. THE HARD PART IS BUILDING THE MACHINE

"already allowed us to save at least 10-15 hours per weekmanaging our systems"

"we’ve been able to cut down certain processes from 17 hoursto 3 minutes"

2 . 3

Page 5: SELF-SERVICE IT - Red Hat...SELF-SERVICE IT WITH ANSIBLE TOWER & MICROSOFT AZURE Chris Houseknecht Dave Johnson June 2016 #redhat #rhsummit 1. THE HARD PART IS BUILDING THE MACHINE

AUTOMATION

CATALOG

PLATFORM

2 . 4

Page 6: SELF-SERVICE IT - Red Hat...SELF-SERVICE IT WITH ANSIBLE TOWER & MICROSOFT AZURE Chris Houseknecht Dave Johnson June 2016 #redhat #rhsummit 1. THE HARD PART IS BUILDING THE MACHINE

AUTOMATION

CATALOG

PLATFORM

2 . 5

Page 7: SELF-SERVICE IT - Red Hat...SELF-SERVICE IT WITH ANSIBLE TOWER & MICROSOFT AZURE Chris Houseknecht Dave Johnson June 2016 #redhat #rhsummit 1. THE HARD PART IS BUILDING THE MACHINE

PLATFORM

AUTOMATION

CATALOG

2 . 6

Page 8: SELF-SERVICE IT - Red Hat...SELF-SERVICE IT WITH ANSIBLE TOWER & MICROSOFT AZURE Chris Houseknecht Dave Johnson June 2016 #redhat #rhsummit 1. THE HARD PART IS BUILDING THE MACHINE

PLATFORM

AUTOMATION

CATALOG

2 . 7

Page 9: SELF-SERVICE IT - Red Hat...SELF-SERVICE IT WITH ANSIBLE TOWER & MICROSOFT AZURE Chris Houseknecht Dave Johnson June 2016 #redhat #rhsummit 1. THE HARD PART IS BUILDING THE MACHINE

#redhat #rhsummit

3 . 1

Page 10: SELF-SERVICE IT - Red Hat...SELF-SERVICE IT WITH ANSIBLE TOWER & MICROSOFT AZURE Chris Houseknecht Dave Johnson June 2016 #redhat #rhsummit 1. THE HARD PART IS BUILDING THE MACHINE

MICROSOFT AZURE

NEW ANSIBLE MODULES FOR AZURE

DYNAMIC INVENTORY SYNC

FULL SUPPORT FOR RESOURCE MANAGER

# Red Hat #rhsummit

3 . 2

Page 11: SELF-SERVICE IT - Red Hat...SELF-SERVICE IT WITH ANSIBLE TOWER & MICROSOFT AZURE Chris Houseknecht Dave Johnson June 2016 #redhat #rhsummit 1. THE HARD PART IS BUILDING THE MACHINE

MICROSOFT AZURER E S O U R C E M A N AG E R

Resource GroupsTemplate DeploymentTagsAccess Control

# Red Hat #rhsummit

3 . 3

Page 12: SELF-SERVICE IT - Red Hat...SELF-SERVICE IT WITH ANSIBLE TOWER & MICROSOFT AZURE Chris Houseknecht Dave Johnson June 2016 #redhat #rhsummit 1. THE HARD PART IS BUILDING THE MACHINE

MICROSOFT AZURE

Updated dynamic inventory synchronization [1]

[1] https://github.com/ansible/ansible/blob/devel/contrib/inventory/azure_rm.py

Automatically groups hosts by:

Resource GroupLocationSecurity GroupTag KeyTag Key : Value

Optionally, turn off one or all groupings

Conditionally select hosts with matching group values

Controll from azure_rm.ini

DY N A M I C I N V E N TO RY

3 . 4

Page 13: SELF-SERVICE IT - Red Hat...SELF-SERVICE IT WITH ANSIBLE TOWER & MICROSOFT AZURE Chris Houseknecht Dave Johnson June 2016 #redhat #rhsummit 1. THE HARD PART IS BUILDING THE MACHINE

MICROSOFT AZURE

azure_rm_storageaccountazure_rm_storageblobazure_rm_securitygroupazure_rm_virtualnetworkazure_rm_subnetazure_rm_networkinterfaceazure_rm_publicipaddressazure_rm_resourcegroupazure_rm_virtualmachineazure_rm_deployment

N E W A Z U R E M O D U L E S

3 . 5

Page 14: SELF-SERVICE IT - Red Hat...SELF-SERVICE IT WITH ANSIBLE TOWER & MICROSOFT AZURE Chris Houseknecht Dave Johnson June 2016 #redhat #rhsummit 1. THE HARD PART IS BUILDING THE MACHINE

MICROSOFT AZUREN E W A Z U R E M O D U L E S

Core supportShared library

AuthenticationValidationTag handlingParameters

# Red Hat #rhsummit

3 . 6

Page 15: SELF-SERVICE IT - Red Hat...SELF-SERVICE IT WITH ANSIBLE TOWER & MICROSOFT AZURE Chris Houseknecht Dave Johnson June 2016 #redhat #rhsummit 1. THE HARD PART IS BUILDING THE MACHINE

MICROSOFT AZURE

Getting started with Azure guide [1]

[1] http://docs.ansible.com/ansible/guide_azure.html

N E W A Z U R E M O D U L E S

Requirements and setupAuthenticationCreating a virtual machineUsing dynamic inventory

# Red Hat #rhsummit

3 . 7

Page 16: SELF-SERVICE IT - Red Hat...SELF-SERVICE IT WITH ANSIBLE TOWER & MICROSOFT AZURE Chris Houseknecht Dave Johnson June 2016 #redhat #rhsummit 1. THE HARD PART IS BUILDING THE MACHINE

MICROSOFT AZURE

Pull Requests Welcome!Issues on Github at ansible/anible-modules-core#ansible on IRCAnsible Project and Ansible Development mailing lists onGoogle

N E W A Z U R E M O D U L E S

# Red Hat #rhsummit

3 . 8

Page 17: SELF-SERVICE IT - Red Hat...SELF-SERVICE IT WITH ANSIBLE TOWER & MICROSOFT AZURE Chris Houseknecht Dave Johnson June 2016 #redhat #rhsummit 1. THE HARD PART IS BUILDING THE MACHINE

#redhat #rhsummit

4 . 1

Page 18: SELF-SERVICE IT - Red Hat...SELF-SERVICE IT WITH ANSIBLE TOWER & MICROSOFT AZURE Chris Houseknecht Dave Johnson June 2016 #redhat #rhsummit 1. THE HARD PART IS BUILDING THE MACHINE

WHAT IS ANSIBLE?

It’s a simple automation language that canperfectly describe an IT application infrastructure inAnsible Playbooks.

It’s an automation engine that runs AnsiblePlaybooks.

4 . 2

Page 19: SELF-SERVICE IT - Red Hat...SELF-SERVICE IT WITH ANSIBLE TOWER & MICROSOFT AZURE Chris Houseknecht Dave Johnson June 2016 #redhat #rhsummit 1. THE HARD PART IS BUILDING THE MACHINE

Human readable automation

No special coding skills needed

Tasks executed in order

Get productive quickly

App deployment

Configuration management

Workflow orchestration

Orchestrate the app lifecycle

Agentless architecture

Uses OpenSSH & WinRM

No agents to exploit or update

More efficient & more secure

SIMPLE POWERFUL AGENTLESS

4 . 3

Page 20: SELF-SERVICE IT - Red Hat...SELF-SERVICE IT WITH ANSIBLE TOWER & MICROSOFT AZURE Chris Houseknecht Dave Johnson June 2016 #redhat #rhsummit 1. THE HARD PART IS BUILDING THE MACHINE

4 . 4

Page 21: SELF-SERVICE IT - Red Hat...SELF-SERVICE IT WITH ANSIBLE TOWER & MICROSOFT AZURE Chris Houseknecht Dave Johnson June 2016 #redhat #rhsummit 1. THE HARD PART IS BUILDING THE MACHINE

PLAYBOOKS ARE WRITTEN IN YAML

Tasks are executed sequentiallyInvoke Ansible modules

4 . 5

Page 22: SELF-SERVICE IT - Red Hat...SELF-SERVICE IT WITH ANSIBLE TOWER & MICROSOFT AZURE Chris Houseknecht Dave Johnson June 2016 #redhat #rhsummit 1. THE HARD PART IS BUILDING THE MACHINE

MODULES ARE “TOOLS IN THE TOOLKIT”

Python, Powershell, or any languageExtend Ansible simplicity to entire stack

4 . 6

Page 23: SELF-SERVICE IT - Red Hat...SELF-SERVICE IT WITH ANSIBLE TOWER & MICROSOFT AZURE Chris Houseknecht Dave Johnson June 2016 #redhat #rhsummit 1. THE HARD PART IS BUILDING THE MACHINE

Azure, EC2, OpenStack, VMware,Rackspace, GCE,Red Hat Satellite, CloudFormsHanlon, CobblerCustom CMDB

4 . 7

Page 24: SELF-SERVICE IT - Red Hat...SELF-SERVICE IT WITH ANSIBLE TOWER & MICROSOFT AZURE Chris Houseknecht Dave Johnson June 2016 #redhat #rhsummit 1. THE HARD PART IS BUILDING THE MACHINE

#redhat #rhsummit

5 . 1

Page 25: SELF-SERVICE IT - Red Hat...SELF-SERVICE IT WITH ANSIBLE TOWER & MICROSOFT AZURE Chris Houseknecht Dave Johnson June 2016 #redhat #rhsummit 1. THE HARD PART IS BUILDING THE MACHINE

WHAT IS ANSIBLE TOWER?Ansible tower is an enterprise framework for controlling,securing and managing your Ansible automation – with a UIand restful API.

1 Role-based access control

2 Push-button deployment

3 Centralized logging

4 RESTful API

5 . 2

Page 26: SELF-SERVICE IT - Red Hat...SELF-SERVICE IT WITH ANSIBLE TOWER & MICROSOFT AZURE Chris Houseknecht Dave Johnson June 2016 #redhat #rhsummit 1. THE HARD PART IS BUILDING THE MACHINE

PLAYBOOKS!

#redhat #rhsummit

6 . 1

Page 27: SELF-SERVICE IT - Red Hat...SELF-SERVICE IT WITH ANSIBLE TOWER & MICROSOFT AZURE Chris Houseknecht Dave Johnson June 2016 #redhat #rhsummit 1. THE HARD PART IS BUILDING THE MACHINE

PLAYBOOKS

#redhat #rhsummit

PLAY • BOOK

/'plā,book/

noun

A book containing a sports team's strategies and plays,especially in football.

6 . 2

Page 28: SELF-SERVICE IT - Red Hat...SELF-SERVICE IT WITH ANSIBLE TOWER & MICROSOFT AZURE Chris Houseknecht Dave Johnson June 2016 #redhat #rhsummit 1. THE HARD PART IS BUILDING THE MACHINE

PLAYBOOKS

#redhat #rhsummit

PLAY • BOOK

/'plā,book/

noun

A book containing a sports team's strategies and plays,especially in football.

6 . 3

Page 29: SELF-SERVICE IT - Red Hat...SELF-SERVICE IT WITH ANSIBLE TOWER & MICROSOFT AZURE Chris Houseknecht Dave Johnson June 2016 #redhat #rhsummit 1. THE HARD PART IS BUILDING THE MACHINE

PLAYBOOKS

#redhat #rhsummit

PLAY • BOOK

/'plā,book/

noun

A playbook is Ansible’s configuration, deployment, andorchestration language.

6 . 4

Page 30: SELF-SERVICE IT - Red Hat...SELF-SERVICE IT WITH ANSIBLE TOWER & MICROSOFT AZURE Chris Houseknecht Dave Johnson June 2016 #redhat #rhsummit 1. THE HARD PART IS BUILDING THE MACHINE

PLAYBOOKS

#redhat #rhsummit

PLAY • BOOK

/'plā,book/

noun

A playbook is Ansible’s configuration, deployment, andorchestration language.

A playbook can be used to manage configurations of anddeployments to remote machines. At a more advancedlevel, they can sequence multi-tier rollouts and delegateactions to other hosts.

6 . 5

Page 31: SELF-SERVICE IT - Red Hat...SELF-SERVICE IT WITH ANSIBLE TOWER & MICROSOFT AZURE Chris Houseknecht Dave Johnson June 2016 #redhat #rhsummit 1. THE HARD PART IS BUILDING THE MACHINE

PLAYBOOKS

#redhat #rhsummit

PLAY • BOOK

/'plā,book/

noun

A playbook is Ansible’s configuration, deployment, andorchestration language.

A playbook can be used to manage configurations of anddeployments to remote machines. At a more advancedlevel, they can sequence multi-tier rollouts and delegateactions to other hosts.

Playbooks are human-readable, written in a simple textlanguage called YAML.

6 . 6

Page 32: SELF-SERVICE IT - Red Hat...SELF-SERVICE IT WITH ANSIBLE TOWER & MICROSOFT AZURE Chris Houseknecht Dave Johnson June 2016 #redhat #rhsummit 1. THE HARD PART IS BUILDING THE MACHINE

PLAYBOOKS

#redhat #rhsummit

PLAY • BOOK

/'plā,book/

noun

Playbooks are Ansible’s configuration, deployment, andorchestration language.

A playbook can be used to manage configurations of anddeployments to remote machines. At a more advancedlevel, they can sequence multi-tier rollouts and delegateactions to other hosts.

Playbooks are human-readable, written in a simple textlanguage calledYAML.

A playbook is composed of one or more ‘plays’ in a list.

6 . 7

Page 33: SELF-SERVICE IT - Red Hat...SELF-SERVICE IT WITH ANSIBLE TOWER & MICROSOFT AZURE Chris Houseknecht Dave Johnson June 2016 #redhat #rhsummit 1. THE HARD PART IS BUILDING THE MACHINE

PLAYBOOKS

#redhat #rhsummit

- name: Create Virtual Machinehosts: localhostconnection: localgather_facts: notasks:

- name: Create resource groupazure_rm_resourcegroup:

name: "{{ resourcegroup_name }}"location: eastustags: "{{ tags }}"

-name: Create virtual machineazure_rm_virtualmachine:

name: testing-001

6 . 8

Page 34: SELF-SERVICE IT - Red Hat...SELF-SERVICE IT WITH ANSIBLE TOWER & MICROSOFT AZURE Chris Houseknecht Dave Johnson June 2016 #redhat #rhsummit 1. THE HARD PART IS BUILDING THE MACHINE

PLAYBOOKS

#redhat #rhsummit

- name: Create Virtual Machinehosts: localhostconnection: localgather_facts: notasks:

- name: Create resource groupazure_rm_resourcegroup:

name: "{{ resourcegroup_name }}"location: eastustags: "{{ tags }}"

-name: Create virtual machineazure_rm_virtualmachine:

name: testing-001

PLAY

/plā/

noun

Maps a group of hosts to a set oftasks.

6 . 9

Page 35: SELF-SERVICE IT - Red Hat...SELF-SERVICE IT WITH ANSIBLE TOWER & MICROSOFT AZURE Chris Houseknecht Dave Johnson June 2016 #redhat #rhsummit 1. THE HARD PART IS BUILDING THE MACHINE

PLAYBOOKS

#redhat #rhsummit

- name: Create Virtual Machinehosts: localhostconnection: localgather_facts: notasks:

- name: Create resource groupazure_rm_resourcegroup:

name: "{{ resourcegroup_name }}"location: eastustags: "{{ tags }}"

-name: Create virtual machineazure_rm_virtualmachine:

name: testing-001

6 . 10

Page 36: SELF-SERVICE IT - Red Hat...SELF-SERVICE IT WITH ANSIBLE TOWER & MICROSOFT AZURE Chris Houseknecht Dave Johnson June 2016 #redhat #rhsummit 1. THE HARD PART IS BUILDING THE MACHINE

PLAYBOOKS

#redhat #rhsummit

- name: Create Virtual Machine

hosts: localhostconnection: localgather_facts: notasks:

- name: Create resource groupazure_rm_resourcegroup:

name: "{{ resourcegroup_name }}"location: eastustags: "{{ tags }}"

-name: Create virtual machineazure_rm_virtualmachine:

name: testing-001

6 . 11

Page 37: SELF-SERVICE IT - Red Hat...SELF-SERVICE IT WITH ANSIBLE TOWER & MICROSOFT AZURE Chris Houseknecht Dave Johnson June 2016 #redhat #rhsummit 1. THE HARD PART IS BUILDING THE MACHINE

PLAYBOOKS

#redhat #rhsummit

- name: Create Virtual Machinehosts: localhost

connection: localgather_facts: notasks:

- name: Create resource groupazure_rm_resourcegroup:

name: "{{ resourcegroup_name }}"location: eastustags: "{{ tags }}"

-name: Create virtual machineazure_rm_virtualmachine:

name: testing-001

6 . 12

Page 38: SELF-SERVICE IT - Red Hat...SELF-SERVICE IT WITH ANSIBLE TOWER & MICROSOFT AZURE Chris Houseknecht Dave Johnson June 2016 #redhat #rhsummit 1. THE HARD PART IS BUILDING THE MACHINE

PLAYBOOKS

#redhat #rhsummit

- name: Create Virtual Machinehosts: localhostconnection: localgather_facts: notasks:

- name: Create resource groupazure_rm_resourcegroup:

name: "{{ resourcegroup_name }}"location: eastustags: "{{ tags }}"

-name: Create virtual machineazure_rm_virtualmachine:

name: testing-001

FACTS

/fakts/

noun

Useful variables about remotehosts that can be used within aplaybook.

6 . 13

Page 39: SELF-SERVICE IT - Red Hat...SELF-SERVICE IT WITH ANSIBLE TOWER & MICROSOFT AZURE Chris Houseknecht Dave Johnson June 2016 #redhat #rhsummit 1. THE HARD PART IS BUILDING THE MACHINE

PLAYBOOKS

#redhat #rhsummit

- name: Create Virtual Machinehosts: localhostconnection: localgather_facts: no

tasks:- name: Create resource group

azure_rm_resourcegroup:name: "{{ resourcegroup_name }}"location: eastustags: "{{ tags }}"

-name: Create virtual machineazure_rm_virtualmachine:

name: testing-001

6 . 14

Page 40: SELF-SERVICE IT - Red Hat...SELF-SERVICE IT WITH ANSIBLE TOWER & MICROSOFT AZURE Chris Houseknecht Dave Johnson June 2016 #redhat #rhsummit 1. THE HARD PART IS BUILDING THE MACHINE

PLAYBOOKS

#redhat #rhsummit

- name: Create Virtual Machinehosts: localhostconnection: localgather_facts: no

tasks:

- name: Create resource groupazure_rm_resourcegroup:

name: "{{ resourcegroup_name }}"location: eastustags: "{{ tags }}"

-name: Create virtual machineazure_rm_virtualmachine:

name: testing-001

Task

/task/

noun

A unit of work. At a basic level, atask is a call to an Ansiblemodule.

6 . 15

Page 41: SELF-SERVICE IT - Red Hat...SELF-SERVICE IT WITH ANSIBLE TOWER & MICROSOFT AZURE Chris Houseknecht Dave Johnson June 2016 #redhat #rhsummit 1. THE HARD PART IS BUILDING THE MACHINE

PLAYBOOKS

#redhat #rhsummit

- name: Create Virtual Machinehosts: localhostconnection: localgather_facts: notasks:

- name: Create resource groupazure_rm_resourcegroup:

name: "{{ resourcegroup_name }}"location: eastustags: "{{ tags }}"

-name: Create virtual machineazure_rm_virtualmachine:

name: testing-001

6 . 16

Page 42: SELF-SERVICE IT - Red Hat...SELF-SERVICE IT WITH ANSIBLE TOWER & MICROSOFT AZURE Chris Houseknecht Dave Johnson June 2016 #redhat #rhsummit 1. THE HARD PART IS BUILDING THE MACHINE

PLAYBOOKS

#redhat #rhsummit

- name: Create Virtual Machinehosts: localhostconnection: localgather_facts: notasks:

- name: Create resource group

azure_rm_resourcegroup:name: "{{ resourcegroup_name }}"location: "{{ location }}"tags: "{{ tags }}"

-name: Create virtual machineazure_rm_virtualmachine:

name: testing-001

6 . 17

Page 43: SELF-SERVICE IT - Red Hat...SELF-SERVICE IT WITH ANSIBLE TOWER & MICROSOFT AZURE Chris Houseknecht Dave Johnson June 2016 #redhat #rhsummit 1. THE HARD PART IS BUILDING THE MACHINE

PLAYBOOKS

#redhat #rhsummit

- name: Create Virtual Machinehosts: localhostconnection: localgather_facts: notasks:

- name: Create resource group

azure_rm_resourcegroup:

name: "{{ resourcegroup_name }}"

location: "{{ location }}"

tags: "{{ tags }}"

-name: Create virtual machineazure_rm_virtualmachine:

name: testing-001

6 . 18

Page 44: SELF-SERVICE IT - Red Hat...SELF-SERVICE IT WITH ANSIBLE TOWER & MICROSOFT AZURE Chris Houseknecht Dave Johnson June 2016 #redhat #rhsummit 1. THE HARD PART IS BUILDING THE MACHINE

PLAYBOOKS

#redhat #rhsummit

- name: Create Virtual Machinehosts: localhostconnection: localgather_facts: notasks:

- name: Create resource group

azure_rm_resourcegroup:

name: "{{ resourcegroup_name }}"

location: "{{ location }}"

tags: "{{ tags }}"

-name: Create virtual machineazure_rm_virtualmachine:

name: testing-001

6 . 19

Page 45: SELF-SERVICE IT - Red Hat...SELF-SERVICE IT WITH ANSIBLE TOWER & MICROSOFT AZURE Chris Houseknecht Dave Johnson June 2016 #redhat #rhsummit 1. THE HARD PART IS BUILDING THE MACHINE

PLAYBOOKS

#redhat #rhsummit

-name: Create virtual machineazure_rm_virtualmachine:

name: testing-001resource_group: "{{ resourcegroup_name }}"vm_size: Standard_D1admin_username: adminssh_public_keys: "{{ ssh_keys }}"image: "{{ image }}"

-name: Add new VM to inventory

add_host:

6 . 20

Page 46: SELF-SERVICE IT - Red Hat...SELF-SERVICE IT WITH ANSIBLE TOWER & MICROSOFT AZURE Chris Houseknecht Dave Johnson June 2016 #redhat #rhsummit 1. THE HARD PART IS BUILDING THE MACHINE

PLAYBOOKS

#redhat #rhsummit

-name: Create virtual machineazure_rm_virtualmachine:

name: testing-001resource_group: "{{ resourcegroup_name }}"vm_size: Standard_D1admin_username: adminssh_public_keys: "{{ ssh_keys }}"

image: "{{ image }}"

-name: Add new VM to inventory

add_host:

6 . 21

Page 47: SELF-SERVICE IT - Red Hat...SELF-SERVICE IT WITH ANSIBLE TOWER & MICROSOFT AZURE Chris Houseknecht Dave Johnson June 2016 #redhat #rhsummit 1. THE HARD PART IS BUILDING THE MACHINE

PLAYBOOKS

#redhat #rhsummit

-name: Create virtual machine

azure_rm_virtualmachine:name: testing-001resource_group: "{{ resourcegroup_name }}"vm_size: Standard_D1admin_username: adminssh_public_keys: "{{ ssh_keys }}"

image: "{{ image }}"

-name: Add new VM to inventory

add_host:

6 . 22

Page 48: SELF-SERVICE IT - Red Hat...SELF-SERVICE IT WITH ANSIBLE TOWER & MICROSOFT AZURE Chris Houseknecht Dave Johnson June 2016 #redhat #rhsummit 1. THE HARD PART IS BUILDING THE MACHINE

PLAYBOOKS

#redhat #rhsummit

-name: Create virtual machine

azure_rm_virtualmachine:

name: testing-001

resource_group: "{{ resourcegroup_name }}"

vm_size: "{{ vm_size }}"

admin_username: admin

ssh_public_keys: "{{ ssh_keys }}"

image: "{{ image }}"

-name: Add new VM to inventory

add_host:

6 . 23

Page 49: SELF-SERVICE IT - Red Hat...SELF-SERVICE IT WITH ANSIBLE TOWER & MICROSOFT AZURE Chris Houseknecht Dave Johnson June 2016 #redhat #rhsummit 1. THE HARD PART IS BUILDING THE MACHINE

PLAYBOOKS

#redhat #rhsummit

-name: Create virtual machine

azure_rm_virtualmachine:

name: testing-001resource_group: "{{ resourcegroup_name }}"vm_size: "{{ vm_size }}"

admin_username: adminssh_public_keys: "{{ ssh_keys }}"

image: "{{ image }}"

-name: Add new VM to inventory

add_host:

6 . 24

Page 50: SELF-SERVICE IT - Red Hat...SELF-SERVICE IT WITH ANSIBLE TOWER & MICROSOFT AZURE Chris Houseknecht Dave Johnson June 2016 #redhat #rhsummit 1. THE HARD PART IS BUILDING THE MACHINE

PLAYBOOKS

#redhat #rhsummit

-name: Create virtual machine

azure_rm_virtualmachine:

name: testing-001

resource_group: "{{ resourcegroup_name }}"

vm_size: "{{ vm_size }}"

admin_username: admin

ssh_public_keys: "{{ ssh_keys }}"

image: "{{ image }}"

-name: Add new VM to inventory

add_host:

6 . 25

Page 51: SELF-SERVICE IT - Red Hat...SELF-SERVICE IT WITH ANSIBLE TOWER & MICROSOFT AZURE Chris Houseknecht Dave Johnson June 2016 #redhat #rhsummit 1. THE HARD PART IS BUILDING THE MACHINE

PLAYBOOKS

#redhat #rhsummit

-name: Add new VM to inventory

name: testing-001

groups: galaxy

add_host:

ansible_host: "{{...publicIPAddress.properties.ipAddress }}"fqdn: "{{...publicIPAddress.properties.dnsSettings.fqdn }}"

- name: Configure Galaxy VM

hosts: galaxy

become: yes

become: root

roles:

- role: galaxy_configure

6 . 26

Page 52: SELF-SERVICE IT - Red Hat...SELF-SERVICE IT WITH ANSIBLE TOWER & MICROSOFT AZURE Chris Houseknecht Dave Johnson June 2016 #redhat #rhsummit 1. THE HARD PART IS BUILDING THE MACHINE

PLAYBOOKS

#redhat #rhsummit

-name: Add new VM to inventory

name: testing-001

groups: galaxy

add_host:

ansible_host: "{{...publicIPAddress.properties.ipAddress }}"

fqdn: "{{...publicIPAddress.properties.dnsSettings.fqdn }}"

- name: Configure Galaxy VM

hosts: galaxy

become: yes

become: root

roles:

- role: galaxy_configure

6 . 27

Page 53: SELF-SERVICE IT - Red Hat...SELF-SERVICE IT WITH ANSIBLE TOWER & MICROSOFT AZURE Chris Houseknecht Dave Johnson June 2016 #redhat #rhsummit 1. THE HARD PART IS BUILDING THE MACHINE

PLAYBOOKS

#redhat #rhsummit

-name: Add new VM to inventory

name: testing-001

groups: galaxy

add_host:

ansible_host: "{{...publicIPAddress.properties.ipAddress }}"

fqdn: "{{...publicIPAddress.properties.dnsSettings.fqdn }}"

- name: Configure Galaxy VM

hosts: galaxy

become: yes

become: root

roles:

- role: galaxy_configure

6 . 28

Page 54: SELF-SERVICE IT - Red Hat...SELF-SERVICE IT WITH ANSIBLE TOWER & MICROSOFT AZURE Chris Houseknecht Dave Johnson June 2016 #redhat #rhsummit 1. THE HARD PART IS BUILDING THE MACHINE

PLAYBOOKS

#redhat #rhsummit

-name: Add new VM to inventory

name: "{{ arm_vm_name }}"

groups: galaxy

add_host:

ansible_host: "{{...publicIPAddress.properties.ipAddress }}"

fqdn: "{{...publicIPAddress.properties.dnsSettings.fqdn }}"

- name: Configure Galaxy VM

hosts: galaxy

become: yes

become: root

roles:

- role: galaxy_configure

6 . 29

Page 55: SELF-SERVICE IT - Red Hat...SELF-SERVICE IT WITH ANSIBLE TOWER & MICROSOFT AZURE Chris Houseknecht Dave Johnson June 2016 #redhat #rhsummit 1. THE HARD PART IS BUILDING THE MACHINE

PLAYBOOKS

#redhat #rhsummit

-name: Add new VM to inventory

name: testing-001

groups: galaxy

add_host:

ansible_host: "{{...publicIPAddress.properties.ipAddress }}"

fqdn: "{{...publicIPAddress.properties.dnsSettings.fqdn }}"

- name: Configure Galaxy VM

hosts: galaxy

become: yes

become: root

roles:

- role: galaxy_configure

6 . 30

Page 56: SELF-SERVICE IT - Red Hat...SELF-SERVICE IT WITH ANSIBLE TOWER & MICROSOFT AZURE Chris Houseknecht Dave Johnson June 2016 #redhat #rhsummit 1. THE HARD PART IS BUILDING THE MACHINE

PLAYBOOKS

#redhat #rhsummit

-name: Add new VM to inventory

name: testing-001

groups: galaxy

add_host:

ansible_host: "{{...publicIPAddress.properties.ipAddress }}"

fqdn: "{{...publicIPAddress.properties.dnsSettings.fqdn }}"

- name: Configure Galaxy VM

hosts: galaxy

become: yes

become: root

roles:

- role: galaxy_configure

6 . 31

Page 57: SELF-SERVICE IT - Red Hat...SELF-SERVICE IT WITH ANSIBLE TOWER & MICROSOFT AZURE Chris Houseknecht Dave Johnson June 2016 #redhat #rhsummit 1. THE HARD PART IS BUILDING THE MACHINE

PLAYBOOKS

#redhat #rhsummit

-name: Add new VM to inventory

name: testing-001

groups: galaxy

add_host:

ansible_host: "{{...publicIPAddress.properties.ipAddress }}"

fqdn: "{{...publicIPAddress.properties.dnsSettings.fqdn }}"

- name: Configure Galaxy VM

hosts: galaxy

become: yes

become: root

roles:

- role: galaxy_configure

6 . 32

Page 58: SELF-SERVICE IT - Red Hat...SELF-SERVICE IT WITH ANSIBLE TOWER & MICROSOFT AZURE Chris Houseknecht Dave Johnson June 2016 #redhat #rhsummit 1. THE HARD PART IS BUILDING THE MACHINE

PLAYBOOKS

#redhat #rhsummit

-name: Add new VM to inventory

name: testing-001

groups: galaxy

add_host:

ansible_host: "{{...publicIPAddress.properties.ipAddress }}"

fqdn: "{{...publicIPAddress.properties.dnsSettings.fqdn }}"

- name: Configure for Galaxy deployment

hosts: galaxy

become: yes

beome: root

roles:

- role: galaxy_configure

6 . 33

Page 59: SELF-SERVICE IT - Red Hat...SELF-SERVICE IT WITH ANSIBLE TOWER & MICROSOFT AZURE Chris Houseknecht Dave Johnson June 2016 #redhat #rhsummit 1. THE HARD PART IS BUILDING THE MACHINE

PLAYBOOKS

#redhat #rhsummit

-name: Add new VM to inventory

name: testing-001

groups: galaxy

add_host:

ansible_host: "{{...publicIPAddress.properties.ipAddress }}"

fqdn: "{{...publicIPAddress.properties.dnsSettings.fqdn }}"

- name: Configure for Galaxy deployment

hosts: galaxy

become: yes

become: root

roles:

- role: galaxy_configure

6 . 34

Page 60: SELF-SERVICE IT - Red Hat...SELF-SERVICE IT WITH ANSIBLE TOWER & MICROSOFT AZURE Chris Houseknecht Dave Johnson June 2016 #redhat #rhsummit 1. THE HARD PART IS BUILDING THE MACHINE

PLAYBOOKS

#redhat #rhsummit

-name: Add new VM to inventory

name: testing-001

groups: galaxy

add_host:

ansible_host: "{{...publicIPAddress.properties.ipAddress }}"

fqdn: "{{...publicIPAddress.properties.dnsSettings.fqdn }}"

- name: Configure for Galaxy deployment

hosts: galaxy become: yes

become: root

roles:

- role: galaxy_configure

6 . 35

Page 61: SELF-SERVICE IT - Red Hat...SELF-SERVICE IT WITH ANSIBLE TOWER & MICROSOFT AZURE Chris Houseknecht Dave Johnson June 2016 #redhat #rhsummit 1. THE HARD PART IS BUILDING THE MACHINE

PLAYBOOKS

#redhat #rhsummit

-name: Add new VM to inventory

name: testing-001

groups: galaxy

add_host:

ansible_host: "{{...publicIPAddress.properties.ipAddress }}"

fqdn: "{{...publicIPAddress.properties.dnsSettings.fqdn }}"

- name: Configure for Galaxy deployment

hosts: galaxy

become: yes become root:

roles:

- role: galaxy_configure

6 . 36

Page 62: SELF-SERVICE IT - Red Hat...SELF-SERVICE IT WITH ANSIBLE TOWER & MICROSOFT AZURE Chris Houseknecht Dave Johnson June 2016 #redhat #rhsummit 1. THE HARD PART IS BUILDING THE MACHINE

PLAYBOOKS

#redhat #rhsummit

-name: Add new VM to inventory

name: testing-001

groups: galaxy

add_host:

ansible_host: "{{...publicIPAddress.properties.ipAddress }}"

fqdn: "{{...publicIPAddress.properties.dnsSettings.fqdn }}"

- name: Configure for Galaxy deployment

hosts: galaxy

become: yes

become: root roles:

- role: galaxy_configure

6 . 37

Page 63: SELF-SERVICE IT - Red Hat...SELF-SERVICE IT WITH ANSIBLE TOWER & MICROSOFT AZURE Chris Houseknecht Dave Johnson June 2016 #redhat #rhsummit 1. THE HARD PART IS BUILDING THE MACHINE

PLAYBOOKS

#redhat #rhsummit

-name: Add new VM to inventory

name: testing-001

groups: galaxy

add_host:

ansible_host: "{{...publicIPAddress.properties.ipAddress }}"

fqdn: "{{...publicIPAddress.properties.dnsSettings.fqdn }}"

- name: Configure for Galaxy deployment

hosts: galaxy

become: yes

become: root

roles: - role: galaxy_configure

ROLE

/rōl/

noun

All the tasks, variables, handlers,templates and files needed tocomplete a unit of work. A role is selfcontained and completely reusable.

6 . 38

Page 64: SELF-SERVICE IT - Red Hat...SELF-SERVICE IT WITH ANSIBLE TOWER & MICROSOFT AZURE Chris Houseknecht Dave Johnson June 2016 #redhat #rhsummit 1. THE HARD PART IS BUILDING THE MACHINE

PLAYBOOKS

#redhat #rhsummit

-name: Add new VM to inventory

name: testing-001

groups: galaxy

add_host:

ansible_host: "{{...publicIPAddress.properties.ipAddress }}"

fqdn: "{{...publicIPAddress.properties.dnsSettings.fqdn }}"

- name: Configure Galaxy VM

hosts: galaxy

become: yes

become: root

roles:

- role: galaxy_configure

6 . 39

Page 65: SELF-SERVICE IT - Red Hat...SELF-SERVICE IT WITH ANSIBLE TOWER & MICROSOFT AZURE Chris Houseknecht Dave Johnson June 2016 #redhat #rhsummit 1. THE HARD PART IS BUILDING THE MACHINE

PLAYBOOKS

#redhat #rhsummit

SO... WHAT DOES A PLAYBOOK ACTUALLY LOOK LIKE?

6 . 40

Page 66: SELF-SERVICE IT - Red Hat...SELF-SERVICE IT WITH ANSIBLE TOWER & MICROSOFT AZURE Chris Houseknecht Dave Johnson June 2016 #redhat #rhsummit 1. THE HARD PART IS BUILDING THE MACHINE

PLAYBOOKS

#redhat #rhsummit

G A L A X YHTTP://GALAXY.ANSIBLE.COM

6 . 41

Page 67: SELF-SERVICE IT - Red Hat...SELF-SERVICE IT WITH ANSIBLE TOWER & MICROSOFT AZURE Chris Houseknecht Dave Johnson June 2016 #redhat #rhsummit 1. THE HARD PART IS BUILDING THE MACHINE

DEMONSTRATION!

#redhat #rhsummit

7

Page 68: SELF-SERVICE IT - Red Hat...SELF-SERVICE IT WITH ANSIBLE TOWER & MICROSOFT AZURE Chris Houseknecht Dave Johnson June 2016 #redhat #rhsummit 1. THE HARD PART IS BUILDING THE MACHINE

GETTING STARTED

Have you used Ansible already? Try Tower for free:ansible.com/tower-trial

Would you like to learn Ansible? It’s easy to get started:ansible.com/get-started

Want to learn more?ansible.com/whitepapers

Ansible for Azure:

docs.ansible.com/ansible/guide_azure.html

docs.ansible.com/ansible/list_of_cloud_modules.html#azure

8

Page 69: SELF-SERVICE IT - Red Hat...SELF-SERVICE IT WITH ANSIBLE TOWER & MICROSOFT AZURE Chris Houseknecht Dave Johnson June 2016 #redhat #rhsummit 1. THE HARD PART IS BUILDING THE MACHINE

LEARN. NETWORK.EXPERIENCE OPEN SOURCE.

#redhat #rhsummit

[email protected]

[email protected]

9