Professional Documents
Culture Documents
Advanced automation
techniques with Ansible and
Red Hat Training
John Walter
Solutions Architect
2
AGENDA
● What is Ansible?
○ Ansible Engine
○ Ansible Tower
● Best Practices
○ Infrastructure as Code
○ How to Execute
○ Leveraging Ansible Tower
● Demo
○ CI/CD, querying APIs
● Red Hat Training
○ Ansible Curriculum
● Q&A
Ansible Technical Overview
4
What is Ansible Automation?
No special coding skills needed Configuration management Uses OpenSSH & WinRM
Get productive quickly Orchestrate the app lifecycle More efficient & more secure
6
What can I do using Ansible?
Automate the deployment and management of your entire IT footprint.
Do this...
On these...
7
Ansible Best Practices
8
AUTOMATION IS CODE
9
CODE NEEDS TO HAVE STYLE GUIDELINES
Do it with style
10
CODE MUST BE
ORGANIZED
USE GIT!
Do it with style
12
GIT - ONE OR MANY?
13
SO, WHAT DO
WE HAVE?
USE READABLE INVENTORY NAMES
15
TAKE ADVANTAGE OF GROUPING
17
VARIABLES
JUST WORDS,
RIGHT?
DESCRIBE VARIABLES WITH THEIR NAMES
a: 25 apache_max_keepalive: 25
data: ab apache_port: 80
data2: abc tomcat_port: 8080
id: 123
19
PREFIX ROLE VARIABLES
apache_max_keepalive: 25
apache_port: 80
tomcat_port: 8080
20
MAKE YOUR PLAYBOOK
READABLE
USE NATIVE YAML SYNTAX
NO!
22
USE FOLDING ONLY IF REALLY REQUIRED
Better, but no
23
USE KEY:VALUE PAIRS
Yes!
24
DO NOT OMIT THE TASK NAME
Exhibit A
TASK [service]
********************************
ok: [web1]
25
USE TASK NAMES
Exhibit B
How to execute
27
PROPER
LAUNCHING
TROUBLESHOOT ON EXECUTION
-vvvv
--step
--check
--diff
--start-at-task
29
ANALYZE WHAT YOUR ARE RUNNING
30
QUICKLY LAUNCH WITHOUT INVENTORY
31
THE RIGHT
TOOLS
CHECK IMMEDIATELY WHAT WAS DONE
33
USE NATIVE MODULES WHERE POSSIBLE
36
GET TOWER TO ADOPT ANSIBLE IN YOUR DATA CENTER
37
TOWER FUNCTIONS
38
TOWER FUNCTIONS
39
BRANCHES, ANYONE?
TAKE ADVANTAGE OF GIT BRANCHES
41
MANY, MANY ROLES
TOWER & ROLES
43
WHAT ARE WE
TALKING TO?
TOWER FUNCTIONS
QUICK TIP
Try right clicking on the icon and using
“Replace Image” to insert your own icons.
45
DOING GOOD JOBS
USE THE POWER OF JOB TEMPLATES
47
1+1+1 = 1
USE WORKFLOWS FOR COMPLEX TASKS
49
DO ASK PROPER QUESTIONS
TOWER FUNCTIONS
QUICK TIP
Try right clicking on the icon and using
“Replace Image” to insert your own icons.
51
NOTIFY YOURSELF!
LET TOWER SEND NOTIFICATIONS TO YOU
53
LOGS, ANYONE?
CONNECT TOWER TO CENTRAL LOGGING
55
ALWAYS KEEP
THE LIGHTS ON
USE HA, DEPLOY ISOLATED NODES
57
Demo
58
Training at Red Hat
59
Onsite Training Classroom Training Virtual Training Online Learning
Private On-site training and Training and test in a professional Live instructor-led online training 90 days of access to course
exams delivered at your location classroom environment led by with the same high-quality, content and up to 80 hours of
or at one of our training centers Red Hat Certified Instructors hands-on labs you'd find in our hands on labs – all available
classrooms online, at your pace, and your
schedule.
60
A prescriptive, reliable, learning solution for rapid skills transformation on Red Hat technologies
61
Take advantage of 7-days of free access to Red Hat Training’s on-demand learning solution.
Required Suggested
Pre-req Overview Complementary
Course Exam
Advanced Automation: Ansible Best Practices (DO447)
Take your Red Hat Ansible Automation skills to the next level and manage automation at scale
Advanced Automation: Ansible Best Practices (DO447) is for experienced Red Hat® Ansible® Automation
users who want to take their Ansible skills to the next level, enabling scalable design and operation of Ansible
Automation in the enterprise. You will explore better ways to automate tasks and use Red Hat Ansible Engine
effectively, as well as how to leverage advanced features of Ansible to perform more complex tasks. You will
also learn how to install and use Red Hat Ansible Tower to centrally coordinate your use of Ansible, control
access to hosts and systems, and manage Ansible workflows through the web interface and the Red Hat Ansible
Tower API.
Topics covered include managing playbooks/inventories with Git, controlling applications through their REST
API with Ansible Playbooks, and implementing a CI/CD pipeline with Git and Red Hat Ansible Tower.
Prerequisites: Be a Red Hat Certified Specialist in Ansible Automation or Red Hat Certified Engineer (RHCE®)
on Red Hat Enterprise Linux 8, or demonstrate equivalent Ansible experience
Certification: Red Hat Certified Specialist in Advanced Automation: Ansible Best Practices (EX447)
64
Questions?
65
CONFIDENTIAL Designator
youtube.com/user/RedHatVideos
Red Hat is the world’s leading provider of
services make
twitter.com/RedHat
Red Hat a trusted adviser to the Fortune 500.
66