Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (1 vote)
656 views4 pages

Automation With Ansible

Automation with Ansible

Uploaded by

arvind
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (1 vote)
656 views4 pages

Automation With Ansible

Automation with Ansible

Uploaded by

arvind
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

RED HAT®

TRAINING

Comprehensive, hands-on training that solves real world problems

Automation with Ansible


Student Workbook

© 2016 Red Hat, Inc. DO407-A2.0-en-1-20160610


Document Conventions                                                                                                                                                                                                       ix
Notes and Warnings ................................................................................................ ix

Introduction                                                                                                                                                                                                                                       xi
Automation with Ansible .......................................................................................... xi
Orientation to the Classroom Environment ................................................................ xii
Internationalization ................................................................................................. xv

1. Introducing Ansible                                                                                                                                                                                                               1
Overview of Ansible Architecture .............................................................................. 2
Quiz: Ansible Architecture ........................................................................................ 6
Overview of Ansible Deployments ............................................................................. 8
Quiz: Ansible Deployments ...................................................................................... 10
Describing Ansible Inventory .................................................................................... 12
Quiz: Ansible Inventory ............................................................................................ 15
Quiz: Introducing Ansible ......................................................................................... 17
Summary ............................................................................................................... 19

2. Deploying Ansible                                                                                                                                                                                                             21
Installing Ansible .................................................................................................... 22
Guided Exercise: Installing Ansible ........................................................................... 29
Managing Ansible Configuration Files ........................................................................ 31
Guided Exercise: Managing Ansible Configuration Files ............................................... 36
Running Ad Hoc Commands .................................................................................... 39
Guided Exercise: Running Ad Hoc Commands ........................................................... 44
Managing Dynamic Inventory .................................................................................. 48
Guided Exercise: Managing Dynamic Inventory ........................................................... 51
Lab: Deploying Ansible ........................................................................................... 54
Summary .............................................................................................................. 60

3. Implementing Playbooks                                                                                                                                                                                           61
Writing YAML Files ................................................................................................. 62
Guided Exercise: Writing YAML Files ........................................................................ 68
Implementing Modules ............................................................................................. 71
Guided Exercise: Implementing Modules ................................................................... 78
Implementing Ansible Playbooks .............................................................................. 81
Guided Exercise: Implementing Ansible Playbooks ..................................................... 93
Lab: Implementing Playbooks ................................................................................. 100
Summary ............................................................................................................. 108

4. Managing Variables and Inclusions                                                                                                                                                         109


Managing Variables ................................................................................................ 110
Guided Exercise: Managing Variables ...................................................................... 120
Managing Facts ..................................................................................................... 124
Guided Exercise: Managing Facts ............................................................................ 132
Managing Inclusions .............................................................................................. 137
Guided Exercise: Managing Inclusions ..................................................................... 145
Lab: Managing Variables and Inclusions .................................................................. 150
Summary ............................................................................................................. 159

5. Implementing Task Control                                                                                                                                                                                 161


Constructing Flow Control ...................................................................................... 162
Guided Exercise: Constructing Flow Control ............................................................. 169
Implementing Handlers .......................................................................................... 173

DO407-A2.0-en-1-20160610 v
Automation with Ansible

Guided Exercise: Implementing Handlers ................................................................. 176


Implementing Tags ................................................................................................ 180
Guided Exercise: Implementing Tags ....................................................................... 187
Handling Errors .................................................................................................... 192
Guided Exercise: Handling Errors ........................................................................... 200
Lab: Implementing Task Control ............................................................................ 206
Summary ............................................................................................................. 220

6. Implementing Jinja2 Templates                                                                                                                                                                 221


Describing Jinja2 Templates .................................................................................. 222
Quiz: Describing Jinja2 Templates .......................................................................... 225
Implementing Jinja2 Templates .............................................................................. 227
Guided Exercise: Implementing Jinja2 Templates ...................................................... 231
Lab: Implementing Jinja2 Templates ...................................................................... 234
Summary ............................................................................................................. 239

7. Implementing Roles                                                                                                                                                                                                     241


Describing Role Structure ..................................................................................... 242
Quiz: Describing Role Structure ............................................................................. 246
Creating Roles ..................................................................................................... 248
Guided Exercise: Creating Roles .............................................................................. 251
Deploying Roles with Ansible Galaxy ...................................................................... 258
Guided Exercise: Deploying Roles with Ansible Galaxy .............................................. 263
Lab: Implementing Roles ....................................................................................... 268
Summary ............................................................................................................. 279

8. Optimizing Ansible                                                                                                                                                                                                       281


Configuring Connection Types ............................................................................... 282
Guided Exercise: Configuring Connection Types ....................................................... 286
Configuring Delegation ......................................................................................... 290
Guided Exercise: Configuring Delegation ................................................................. 295
Configuring Parallelism .......................................................................................... 301
Guided Exercise: Configuring Parallelism ................................................................ 305
Lab: Optimizing Ansible ......................................................................................... 310
Summary ............................................................................................................. 322

9. Implementing Ansible Vault                                                                                                                                                                           323


Configuring Ansible Vault ...................................................................................... 324
Guided Exercise: Configuring Ansible Vault ............................................................. 327
Executing with Ansible Vault ................................................................................. 330
Guided Exercise: Executing with Ansible Vault ......................................................... 335
Lab: Implementing Ansible Vault ............................................................................ 339
Summary ............................................................................................................ 350

10. Troubleshooting Ansible                                                                                                                                                                                     351


Troubleshooting Playbooks .................................................................................... 352
Guided Exercise: Troubleshooting Playbooks ........................................................... 355
Troubleshooting Ansible Managed Hosts .................................................................. 361
Guided Exercise: Troubleshooting Ansible Managed Hosts ........................................ 364
Lab: Troubleshooting Ansible ................................................................................. 367
Summary ............................................................................................................. 376

11. Implementing Ansible Tower                                                                                                                                                                         377


Describing Ansible Tower ...................................................................................... 378

vi DO407-A2.0-en-1-20160610
Quiz: Describing Ansible Tower ............................................................................... 381
Deploying Ansible Tower ....................................................................................... 383
Guided Exercise: Deploying Ansible Tower .............................................................. 388
Configuring Users in Ansible Tower ........................................................................ 393
Guided Exercise: Configuring Users in Ansible Tower ................................................ 399
Managing Hosts with Ansible Tower ........................................................................ 401
Guided Exercise: Managing Hosts with Ansible Tower ............................................... 406
Managing Jobs in Ansible Tower ........................................................................... 409
Guided Exercise: Managing Jobs in Ansible Tower .................................................... 418
Lab: Implementing Ansible Tower ........................................................................... 421
Summary ............................................................................................................. 433
12. Implementing Ansible in a DevOps Environment                                                                                                               435
Provisioning Vagrant Machines .............................................................................. 436
Guided Exercise: Provisioning Vagrant Machines ...................................................... 442
Deploying Vagrant in a DevOps Environment .......................................................... 445
Guided Exercise: Deploying Vagrant in a DevOps Environment .................................. 450
Lab: Implementing Ansible in a DevOps Environment ............................................... 454
Summary ............................................................................................................ 460
13. Comprehensive Review: Automation with Ansible                                                                                                             461
Comprehensive Review ........................................................................................ 462
Lab: Deploying Ansible ......................................................................................... 465
Lab: Deploying Ansible Tower and Executing Jobs ................................................... 470
Lab: Creating Roles and using Dynamic Inventory ................................................... 482
Lab: Optimizing Ansible ........................................................................................ 498

DO407-A2.0-en-1-20160610 vii

You might also like