Ansible Tower - Drew Bomhof, Brandon Dunne - ManageIQ Design Summit 2016

26
Ansible Tower Integration Brandon Dunne, Drew Bomhof

Transcript of Ansible Tower - Drew Bomhof, Brandon Dunne - ManageIQ Design Summit 2016

Page 1: Ansible Tower - Drew Bomhof, Brandon Dunne - ManageIQ Design Summit 2016

Ansible Tower IntegrationBrandon Dunne, Drew Bomhof

Page 2: Ansible Tower - Drew Bomhof, Brandon Dunne - ManageIQ Design Summit 2016

IntroductionsBrandon Dunne

Email: [email protected]

Github: bdunne

Drew Bomhof

Email: [email protected]

Github: syncrou

Greg Mccullough

Email: [email protected]

Github: gmcculloug

Page 3: Ansible Tower - Drew Bomhof, Brandon Dunne - ManageIQ Design Summit 2016

AgendaIntroduction

Use Cases

Implementation

Demo

Future

Q&A

Page 4: Ansible Tower - Drew Bomhof, Brandon Dunne - ManageIQ Design Summit 2016

Intro - What is Ansible?Ansible is a software platform for configuring and managing computers which combines software deployment, ad-hoc task execution, and configuration management.

- CLI Interface

- Uses SSH or WinRM to connect to host systems

- One-off or script based Playbook execution

- Automate IT infrastructure and system configurations

Page 5: Ansible Tower - Drew Bomhof, Brandon Dunne - ManageIQ Design Summit 2016

Intro - What is Ansible Tower?- Web UI and REST API

- Jobs launched based on Job Templates (fewer details required from the user)

- Dynamic inventory from Inventory Sources (Cloud / Virt)

- User permission system to allow delegation to users without access to credential properties

- Can dynamically update playbook on Job Template launch

Page 6: Ansible Tower - Drew Bomhof, Brandon Dunne - ManageIQ Design Summit 2016

Intro - Another Configuration ManagerForeman:

- Bare-metal provisioning integration with ManageIQ

- Desired State configuration, relies on scheduled checkins

- Agent based, driven from the agent, uses Puppet

Ansible Tower:

- Used to configure new and existing systems

- One-off or Scheduled Jobs based on Job Templates

- Drives configuration through local Ansible installation

Page 7: Ansible Tower - Drew Bomhof, Brandon Dunne - ManageIQ Design Summit 2016

Implemented Use Cases- Basic Inventory

- Ansible Tower as a service

- Custom Button

- Enhance provisioning state machines

Page 8: Ansible Tower - Drew Bomhof, Brandon Dunne - ManageIQ Design Summit 2016

Implementation - AnsibleTowerClient Gem- Ansible Tower has a browsable API making development easy

- Simple API wrapper to provide Ruby classes for each object type

- Methods are dynamically built based on the API content for the object type allowing the gem to adapt as new features are added

- Collection paging is implemented with lazy enumerators. Allows for quick initial results without the hassle of users requesting the next page

Page 9: Ansible Tower - Drew Bomhof, Brandon Dunne - ManageIQ Design Summit 2016

Implementation in ManageIQ (Modeling)

ManageIQ AnsibleTower Foreman (Satellite 6)

Configured System Host Host

Configuration Profile N/A Host Group

Configuration Script Job Template Puppet Script? (Not implemented in MIQ)

Orchestration Stack Job Reports? (Not Implemented in MIQ)

Page 10: Ansible Tower - Drew Bomhof, Brandon Dunne - ManageIQ Design Summit 2016

Implementation in ManageIQ (Refresh)Inventory (Root) Group

- name, ems_ref (id)

Configuration Scripts (Job Templates)

- description, inventory_root_group (inventory relation), manager_ref (id), name, survey_spec, variables (extra_vars)

Configured Systems (Hosts)

- manager_ref (id), hostname (name), inventory_root_group (inventory relation), virtual_instance_ref (Cloud / Infra Provider ID)

- Cross provider link to existing VM / Instance

Page 11: Ansible Tower - Drew Bomhof, Brandon Dunne - ManageIQ Design Summit 2016

Adding a new provider

Configuration Management menuAdding a new provider

Page 12: Ansible Tower - Drew Bomhof, Brandon Dunne - ManageIQ Design Summit 2016

Adding a new provider

Type selection:

URL can be a URL or hostname, we’ll fill in the missing pieces and save as a URL

Page 13: Ansible Tower - Drew Bomhof, Brandon Dunne - ManageIQ Design Summit 2016

Inventory

Provider

Inventory Group

Configured Systems

Page 14: Ansible Tower - Drew Bomhof, Brandon Dunne - ManageIQ Design Summit 2016

InventoryLimited Inventory, based on what is required to support current use cases.

Configured System to VM link data collected, not exposed in the UI yet.

Page 15: Ansible Tower - Drew Bomhof, Brandon Dunne - ManageIQ Design Summit 2016

Inventory - Configuration Script Summary

Page 16: Ansible Tower - Drew Bomhof, Brandon Dunne - ManageIQ Design Summit 2016

Custom ButtonsNavigate to Automate / Customization

Select VM and Instance / [Unassigned Buttons]

Configuration / Add a new Button

Page 17: Ansible Tower - Drew Bomhof, Brandon Dunne - ManageIQ Design Summit 2016

Custom Buttons

Request Type is Ansible_Tower_Job

Here you can select the Job Template by name

Params prefixed by “dialog_param_” PR#8960

Page 18: Ansible Tower - Drew Bomhof, Brandon Dunne - ManageIQ Design Summit 2016

Custom ButtonsAdd a new Button Group

Fill in the fields, add your button

Page 19: Ansible Tower - Drew Bomhof, Brandon Dunne - ManageIQ Design Summit 2016

Custom Buttons

Page 20: Ansible Tower - Drew Bomhof, Brandon Dunne - ManageIQ Design Summit 2016

Service DialogsA Service Dialog can be created from any Job Template

Page 21: Ansible Tower - Drew Bomhof, Brandon Dunne - ManageIQ Design Summit 2016

Service DialogsGive the Dialog a name

Navigate to ServicesCatalog ItemsAdd a new Catalog Item

Page 22: Ansible Tower - Drew Bomhof, Brandon Dunne - ManageIQ Design Summit 2016

Service Dialogs

Give the Service Catalog a name and description

Select the Catalog

Select the just created dialog

Select the provider

Select the Job Template

The pre-populated entry point is the default state machine

Page 23: Ansible Tower - Drew Bomhof, Brandon Dunne - ManageIQ Design Summit 2016

Service Dialogs

- Default creation includes all survey data, variables and limit

- Fields can be modified as below to match the desired needs of the delivered service (from Automate, Customization, Service Dialogs)

‘Limit’ was pulled out for this service dialog

Navigate to Service Catalogs - click Order

Page 24: Ansible Tower - Drew Bomhof, Brandon Dunne - ManageIQ Design Summit 2016

Demo- Awesome Demo

Page 25: Ansible Tower - Drew Bomhof, Brandon Dunne - ManageIQ Design Summit 2016

Future- Eventing, could poll Activity Stream for events to trigger refreshes

- More use cases to drive inventory collection

Page 26: Ansible Tower - Drew Bomhof, Brandon Dunne - ManageIQ Design Summit 2016

Q&ALink to Talk topic:

http://talk.manageiq.org/t/launching-ansible-tower-job-templates-from-manageiq/1394

Sprint 39 Demo (Ansible Tower features):

https://www.youtube.com/watch?v=uZYzX4ZqTEQ#t=44m07s

Minecraft Playbook:

https://github.com/syncrou/minecraft-pe-ec2-ansible