Automation: Git and Ansible
Configuration under git: who changed what, how to get the working version back and update a server from a repository; Ansible: inventory, ad-hoc commands and an idempotent playbook — up to configuring a second machine from the first.
6 stages3 labs~3 hours medium
The track has not been started. The first stage is «The history of configuration changes», ~50 min.
Module 1
Git for configuration
Who changed what in a config and how to get the working version back without rewriting history; updating a working copy on a server without losing a local change.
3 stages · ~2 hours
-
Stage 1 of 6
1 · The history of configuration changesThe history of configuration changes
6 steps · 1 lab · ~50 min 6 steps · 1 lab · ~50 min- nginx did not come up after an edit exercises 0 of 1 on a machine 5 min
- 2 What changed since the commit on a machine 8 min
- 3 Who changed the line and when on a machine 6 min
- 4 Undo a commit and keep the history on a machine 9 min
- 5 The pricing service is down lab 20 min
- 6 Summary summary 2 min
-
Stage 2 of 6
2 · Config from a repository: pull and conflictsConfig from a repository: pull and conflicts
7 steps · 1 lab · ~50 min 7 steps · 1 lab · ~50 min- git pull refuses exercises 0 of 1 on a machine 5 min
- 2 Where pull gets commits from theory 5 min
- 3 Set the edit aside and update on a machine 5 min
- 4 Send your own edit on a machine 7 min
- 5 Conflict: both sides changed the same line on a machine 6 min
- 6 The server does not pick up changes lab 20 min
- 7 Summary summary 2 min
-
3 · Module test 10 questions · pass mark 70%
Module 2
Ansible: first playbooks
Machines in an inventory, ad-hoc commands and what ok and changed mean; a playbook with a handler and a template that changes nothing the second time.
3 stages · ~2 hours
-
Stage 4 of 6
4 · Inventory and ad-hoc commandsInventory and ad-hoc commands
5 steps · ~30 min 5 steps · ~30 min- Ansible did not connect to the machine exercises 0 of 1 on a machine 6 min
- 2 The inventory: name, address, user on a machine 8 min
- 3 An ad-hoc command: CHANGED and SUCCESS on a machine 8 min
- 4 Root rights and a machine without SSH on a machine 5 min
- 5 Summary summary 3 min
-
Stage 5 of 6
5 · A playbook: tasks, handlers, templatesA playbook: tasks, handlers, templates
6 steps · 1 lab · ~55 min 6 steps · 1 lab · ~55 min- Running it again changes everything again exercises 0 of 1 on a machine 5 min
- 2 A playbook and state modules on a machine 8 min
- 3 A handler: a restart after an edit on a machine 8 min
- 4 A template and a trial run on a machine 7 min
- 5 An unfinished playbook lab 25 min
- 6 Summary summary 2 min
-
6 · Module test 10 questions · pass mark 70%
Module 3
Roles
A playbook split into a role, variables and secrets in a vault.
0 stages
-
Roles, variables and secrets soon
-
The role does not apply soon
-
Module test soon
-
-
Final test 18 questions · pass mark 80%