Skip to content

umich-arc/ansible_demo

Repository files navigation

About

This repo is meant to be used as part of a presentation to introduction people to Ansible. Each branch represent a lesson, and the presenter should iterate through each branch describing each Ansible concept. A minimum of 2 Linux systems is required for demonstrating concepts. Talking points and links to documentation are provided in for each branch.

Branch Names:

00/cleanStart

Clean install directory layout.

01/basicPlaybook

Populate the inventory file and simple playbook.

02/shellAndDebugTasks

Use shell module, how to register(store) output from the shell command into a variable, and use debug module to print the values to the screen.

  • Run a shell command to gather disk usage and store results in a variable. Read:
  • Use the debug module to print out the variable contents in two different ways.

03/shellTaskNoChange

Shell commands will always report a change even if you are just doing a directory listing. Behavior can be overwritten with changed_when property.

04/copyFile

Playbook to copy a file demonstrating rename from src to dest and backup options.

05/copyFileWithItems

Copy more than one file in a task, demonstrating the with_items feature of Ansible

06/copyFileWithItemsAdv

A continuation of standard loops (with_items) using list of hashes.

07/templatesAndVars

Concept of group and host variables in reference to the inventory, and how to use the template module to render templates as files on destination system.

08/groupAndHostVarsLayout

Group/Host variables organizational layouts options.

09/hostVarsOverwirte

Variable overwrite concept and Variable precedence

10/roles

Ansible roles and structure, demonstrating a role with 3 tasks

11/rolesTemplatesVSCopy

Choosing template over copy and how comment filter in templates makes it a better choice over copy

12/rolesTemplatesJinja2Syntax

JINJA2 syntax in combination with group_vars, demonstrating for loop and if conditional

13/tags

Run specific parts of a playbook with tags.

Releases

No releases published

Packages

No packages published

Languages