Documente Academic
Documente Profesional
Documente Cultură
John Walter
Solutions Architect, Training + Certification
1
AGENDA
● Ansible Automation
○ Technical Overview
● Ansible Best Practices
○ Curriculum Overview
○ Demo
● Ways to Train and the Red Hat Learning Subscription
○ Advanced Automation: Ansible Best Practices course - DO447
● Q&A
Ansible Technical Overview
3
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
5
What can I do using Ansible?
Automate the deployment and management of your entire IT footprint.
Do this...
On these...
6
Ansible automates technologies you use
Time to automate is measured in minutes
8
PUBLIC / PRIVATE
CLOUD PUBLIC / PRIVATE
CMDB CLOUD
USERS
HOSTS
INVENTORY CLI
MODULES PLUGINS
NETWORK
ANSIBLE DEVICES
PLAYBOOK
9
Ansible Best Practices
10
AUTOMATION IS CODE
11
CODE NEEDS TO HAVE STYLE GUIDELINES
Do it with style
12
CODE MUST BE
ORGANIZED
USE GIT!
Do it with style
14
GIT - ONE OR MANY?
15
SO, WHAT DO
WE HAVE?
USE READABLE INVENTORY NAMES
17
TAKE ADVANTAGE OF GROUPING
19
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
21
PREFIX ROLE VARIABLES
apache_max_keepalive: 25
apache_port: 80
tomcat_port: 8080
22
PLACE VARIABLES APPROPRIATELY
● Find the appropriate place for your variables based on what, where and
when they are set or modified
● Separate logic (tasks) from variables and reduce repetitive patterns
● Do not use every possibility to store variables - settle to a defined
scheme and as few places as possible
23
MAKE YOUR PLAYBOOK
READABLE
USE NATIVE YAML SYNTAX
NO!
25
USE FOLDING ONLY IF REALLY REQUIRED
Better, but no
26
USE KEY:VALUE PAIRS
Yes!
27
DO NOT OMIT THE TASK NAME
Exhibit A
TASK [service]
********************************
ok: [web1]
28
USE TASK NAMES
Exhibit B
- block:
copy:
src: critical.conf
dest: /etc/critical/crit.conf
service:
name: critical
state: restarted
rescue:
command: shutdown -h now
31
EXECUTING THE ANSIBLE COMMANDS
How to execute
32
PROPER
LAUNCHING
TROUBLESHOOT ON EXECUTION
-vvvv
--step
--check
--diff
--start-at-task
34
ANALYZE WHAT YOUR ARE RUNNING
35
QUICKLY LAUNCH WITHOUT INVENTORY
36
THE RIGHT
TOOLS
CHECK IMMEDIATELY WHAT WAS DONE
38
USE NATIVE MODULES WHERE POSSIBLE
{{ ansible_managed | comment }}
40
ROLES AND
GALAXIES
USE ROLES WHERE POSSIBLE
42
USE GALAXY - WITH CARE
43
ACCESS RIGHTS
USE BECOME, DON’T BE A ROOT
45
DEBUG YOUR
PROBLEM
HAVE A LOOK AT THE NODE LEVEL
47
IN WORST CASE, DEBUG ACTUAL CODE
Execute with:
48
USE THE DEBUG MODULE
49
GET TOWER TO ADOPT ANSIBLE IN YOUR DATA CENTER
50
TOWER FUNCTIONS
51
TOWER FUNCTIONS
52
BRANCHES, ANYONE?
TAKE ADVANTAGE OF GIT BRANCHES
54
MANY, MANY ROLES
TOWER & ROLES
56
WHAT ARE WE
TALKING TO?
TOWER FUNCTIONS
QUICK TIP
Try right clicking on the icon and using
“Replace Image” to insert your own icons.
58
DOING GOOD JOBS
USE THE POWER OF JOB TEMPLATES
60
1+1+1 = 1
USE WORKFLOWS FOR COMPLEX TASKS
62
DO ASK PROPER QUESTIONS
TOWER FUNCTIONS
QUICK TIP
Try right clicking on the icon and using
“Replace Image” to insert your own icons.
64
A POWERFUL
TEAM
USE TOWER TEAMS, SEPARATIONS
66
ONE KEY TO RULE
THEM ALL ...
USE TOWER SPECIFIC ACCESS CREDENTIALS
68
NOTIFY YOURSELF!
LET TOWER SEND NOTIFICATIONS TO YOU
70
LOGS, ANYONE?
CONNECT TOWER TO CENTRAL LOGGING
72
ALWAYS KEEP
THE LIGHTS ON
USE HA, DEPLOY ISOLATED NODES
74
Training at Red Hat
75
WAYS TO TRAIN
76
RED HAT LEARNING SUBSCRIPTION
A prescriptive, reliable, learning solution for rapid skills transformation on Red Hat technologies
77
RED HAT LEARNING SUBSCRIPTION TRIAL
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)
80
Questions?
81
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.
82