Introduction |
|
xxii | |
|
Part I Introduction to Ansible |
|
|
|
Chapter 1 Understanding Configuration Management |
|
|
3 | (12) |
|
"Do I Know This Already?" Quiz |
|
|
3 | (3) |
|
|
6 | (1) |
|
|
6 | (3) |
|
|
6 | (1) |
|
Understanding the DevOps Way of Working |
|
|
7 | (1) |
|
Understanding Infrastructure as Code |
|
|
8 | (1) |
|
Other Automation Solutions |
|
|
8 | (1) |
|
Understanding Ansible Essential Components |
|
|
9 | (2) |
|
|
9 | (1) |
|
|
9 | (1) |
|
Understanding Ansible Tower |
|
|
10 | (1) |
|
Understanding the Ansible Way |
|
|
11 | (1) |
|
Understanding Ansible Use Cases |
|
|
11 | (1) |
|
Using Ansible for Configuration Management |
|
|
11 | (1) |
|
Using Ansible for Provisioning |
|
|
12 | (1) |
|
Using Ansible for Continuous Delivery |
|
|
12 | (1) |
|
|
12 | (1) |
|
|
12 | (1) |
|
|
12 | (1) |
|
|
13 | (2) |
|
Chapter 2 Installing Ansible |
|
|
15 | (16) |
|
"Do I Know This Already?" Quiz |
|
|
15 | (3) |
|
|
18 | (1) |
|
Understanding an Ansible Environment |
|
|
18 | (2) |
|
Understanding Controller Host Requirements |
|
|
20 | (1) |
|
Understanding Installation Methods |
|
|
20 | (2) |
|
Installing Ansible on RHEL 8 |
|
|
21 | (1) |
|
Installing Ansible on CentOS 8 |
|
|
21 | (1) |
|
Using python-pip to Install Ansible |
|
|
21 | (1) |
|
Configuring Managed Hosts |
|
|
22 | (1) |
|
Configuring the Ansible User |
|
|
23 | (3) |
|
Setting "Up SSH for the Ansible User |
|
|
23 | (2) |
|
Configuring sudo for the Ansible User |
|
|
25 | (1) |
|
|
26 | (1) |
|
|
26 | (1) |
|
|
26 | (1) |
|
|
27 | (1) |
|
|
27 | (1) |
|
|
27 | (1) |
|
|
28 | (1) |
|
|
28 | (3) |
|
Chapter 3 Setting Up an Ansible Managed Environment |
|
|
31 | (16) |
|
"Do I Know This Already?" Quiz |
|
|
31 | (3) |
|
|
34 | (1) |
|
|
34 | (1) |
|
Configuring Static Inventory |
|
|
35 | (4) |
|
|
35 | (1) |
|
|
36 | (1) |
|
Using Inventory in Commands |
|
|
37 | (1) |
|
Specifying Host Variables |
|
|
38 | (1) |
|
Working with Dynamic Inventory |
|
|
39 | (3) |
|
Working with Community-Provided Dynamic Inventory Scripts |
|
|
39 | (1) |
|
Writing Your Own Inventory Scripts |
|
|
40 | (2) |
|
Using Multiple Inventory Files |
|
|
42 | (1) |
|
Managing Settings in ansible.cfg |
|
|
42 | (2) |
|
|
44 | (1) |
|
|
44 | (1) |
|
Review All Key Topics d4 Memory Tables |
|
|
44 | (1) |
|
|
44 | (1) |
|
|
45 | (1) |
|
|
45 | (1) |
|
|
45 | (2) |
|
Chapter 4 Using Ad Hoc Commands |
|
|
47 | (22) |
|
"Do I Know This Already?" Quiz |
|
|
47 | (3) |
|
|
50 | (1) |
|
Understanding Ad Hoc Commands |
|
|
50 | (3) |
|
|
53 | (5) |
|
Exploring Essential Modules |
|
|
54 | (1) |
|
|
54 | (1) |
|
|
55 | (1) |
|
|
55 | (1) |
|
|
55 | (1) |
|
|
56 | (1) |
|
|
56 | (1) |
|
|
56 | (2) |
|
Browsing Available Modules |
|
|
58 | (1) |
|
Consulting Module Documentation |
|
|
58 | (6) |
|
|
58 | (4) |
|
Using https://docs.ansible.com |
|
|
62 | (2) |
|
Running Ad Hoc Commands from Shell Scripts |
|
|
64 | (2) |
|
|
66 | (1) |
|
|
66 | (1) |
|
|
66 | (1) |
|
|
66 | (1) |
|
|
66 | (1) |
|
|
67 | (1) |
|
|
67 | (1) |
|
|
67 | (2) |
|
Chapter 5 Getting Started with Playbooks |
|
|
69 | (28) |
|
"Do I Know This Already?" Quiz |
|
|
69 | (3) |
|
|
72 | (1) |
|
Exploring Your First Playbook |
|
|
72 | (5) |
|
From Ad Hoc Commands to Playbook |
|
|
72 | (1) |
|
|
73 | (1) |
|
|
74 | (1) |
|
Undoing Playbook Modifications |
|
|
75 | (2) |
|
|
77 | (6) |
|
|
77 | (1) |
|
|
78 | (1) |
|
|
79 | (1) |
|
|
79 | (1) |
|
|
80 | (1) |
|
Performing a Playbook Dry Run |
|
|
81 | (2) |
|
Managing Multiplay Playbooks |
|
|
83 | (9) |
|
Multiplay Playbook Considerations |
|
|
83 | (1) |
|
Multiplay Playbook Example |
|
|
84 | (2) |
|
Increasing Output Verbosity |
|
|
86 | (6) |
|
|
92 | (1) |
|
|
92 | (1) |
|
|
93 | (1) |
|
|
93 | (1) |
|
|
93 | (1) |
|
|
93 | (1) |
|
|
94 | (1) |
|
|
94 | (3) |
|
Chapter 6 Working with Variables and Facts |
|
|
97 | (34) |
|
"Do I Know This Already?" Quiz |
|
|
97 | (3) |
|
|
100 | (1) |
|
Understanding the Use of Variables in Ansible Playbooks |
|
|
100 | (1) |
|
Working with Ansible Facts |
|
|
101 | (10) |
|
|
102 | (2) |
|
Understanding How Facts Are Displayed |
|
|
104 | (4) |
|
|
108 | (1) |
|
Working with Custom Facts |
|
|
109 | (2) |
|
|
111 | (8) |
|
|
112 | (1) |
|
|
112 | (1) |
|
Managing Host and Group Variables |
|
|
113 | (2) |
|
Using Multivalued Variables |
|
|
115 | (2) |
|
Working with Magic Variables |
|
|
117 | (2) |
|
Understanding Variable Precedence |
|
|
119 | (1) |
|
Using Vault to Manage Sensitive Values |
|
|
119 | (3) |
|
|
119 | (1) |
|
|
120 | (1) |
|
|
120 | (1) |
|
Managing Files with Sensitive Variables |
|
|
121 | (1) |
|
Capturing Command Output Using register |
|
|
122 | (3) |
|
|
125 | (1) |
|
|
125 | (1) |
|
|
125 | (1) |
|
|
125 | (1) |
|
|
126 | (1) |
|
|
126 | (1) |
|
|
126 | (1) |
|
|
127 | (1) |
|
|
127 | (4) |
|
Part II Common Ansible Management Tasks |
|
|
|
Chapter 7 Using Task Control |
|
|
131 | (42) |
|
"Do I Know This Already? "Quiz |
|
|
131 | (3) |
|
|
134 | (1) |
|
|
134 | (5) |
|
|
134 | (1) |
|
|
135 | (1) |
|
Using Loops on Multivalued Variables |
|
|
136 | (1) |
|
|
137 | (2) |
|
Using when to Run Tasks Conditionally |
|
|
139 | (10) |
|
|
139 | (2) |
|
Using Conditional Test Statements |
|
|
141 | (3) |
|
Testing Multiple Conditions |
|
|
144 | (1) |
|
|
145 | (2) |
|
Combining loop and register |
|
|
147 | (2) |
|
|
149 | (7) |
|
|
149 | (5) |
|
Understanding Handler Execution and Exceptions |
|
|
154 | (2) |
|
|
156 | (13) |
|
Understanding Task Execution |
|
|
156 | (1) |
|
|
156 | (2) |
|
Specifying Task Failure Conditions |
|
|
158 | (3) |
|
|
161 | (2) |
|
|
163 | (1) |
|
Using Blocks with rescue and always Statements |
|
|
164 | (5) |
|
|
169 | (1) |
|
|
169 | (1) |
|
|
169 | (1) |
|
|
170 | (1) |
|
|
170 | (1) |
|
|
170 | (1) |
|
|
171 | (1) |
|
|
171 | (2) |
|
Chapter 8 Deploying Files |
|
|
173 | (32) |
|
"Do I Know This Already?" Quiz |
|
|
173 | (3) |
|
|
176 | (1) |
|
Using Modules to Manipulate Files |
|
|
176 | (11) |
|
File Module Manipulation Overview |
|
|
176 | (1) |
|
|
176 | (4) |
|
|
180 | (2) |
|
Creating and Removing Files |
|
|
182 | (1) |
|
|
183 | (4) |
|
Managing SELinux Properties |
|
|
187 | (7) |
|
Managing SELinux File Context |
|
|
188 | (1) |
|
Applying Generic SELinux Management Tasks |
|
|
189 | (5) |
|
|
194 | (6) |
|
Working with Simple Templates |
|
|
194 | (3) |
|
Applying Control Structures in Jinja2 Using for |
|
|
197 | (1) |
|
Using Conditional Statements with if |
|
|
198 | (1) |
|
|
198 | (2) |
|
|
200 | (1) |
|
|
200 | (1) |
|
|
200 | (1) |
|
|
201 | (1) |
|
|
201 | (1) |
|
|
201 | (1) |
|
|
201 | (1) |
|
|
202 | (1) |
|
Lab 8-1: Generate an /etc/hosts File |
|
|
202 | (1) |
|
Lab 8-2: Manage a vsftpd Service |
|
|
202 | (3) |
|
Chapter 9 Using Ansible Roles |
|
|
205 | (24) |
|
"Do I Know This Already?" Quiz |
|
|
205 | (3) |
|
|
208 | (1) |
|
|
208 | (6) |
|
Understanding Ansible Roles |
|
|
208 | (1) |
|
Understanding Role Location |
|
|
209 | (1) |
|
Using Roles from Playbooks |
|
|
210 | (1) |
|
|
210 | (3) |
|
Managing Role Dependencies |
|
|
213 | (1) |
|
Understanding File Organization Best Practices |
|
|
213 | (1) |
|
Using Ansible Galaxy Roles |
|
|
214 | (5) |
|
|
215 | (1) |
|
Using the ansible-galaxy Command |
|
|
216 | (2) |
|
Managing Ansible Galaxy Roles |
|
|
218 | (1) |
|
|
219 | (6) |
|
Understanding RHEL System Roles |
|
|
220 | (1) |
|
Installing RHEL System Roles |
|
|
220 | (1) |
|
Using the RHEL SELinux System Role |
|
|
221 | (3) |
|
Using the RHEL TimeSync System Role |
|
|
224 | (1) |
|
|
225 | (1) |
|
|
225 | (1) |
|
|
226 | (1) |
|
|
226 | (1) |
|
|
226 | (1) |
|
|
226 | (1) |
|
|
227 | (1) |
|
|
227 | (1) |
|
|
227 | (2) |
|
Chapter 10 Using Ansible in Large Environments |
|
|
229 | (22) |
|
"Do I Know This Already?" Quiz |
|
|
229 | (3) |
|
|
232 | (1) |
|
|
232 | (5) |
|
Working with Host Name Patterns |
|
|
232 | (1) |
|
Configuring Dynamic Inventory |
|
|
233 | (2) |
|
Using the ansible-inventory Command |
|
|
235 | (1) |
|
Working with Multiple Inventory Files |
|
|
236 | (1) |
|
Optimizing Ansible Processing |
|
|
237 | (2) |
|
Managing Parallel Task Execution |
|
|
237 | (1) |
|
Managing Serial Task Execution |
|
|
238 | (1) |
|
Including and Importing Files |
|
|
239 | (8) |
|
|
240 | (2) |
|
Importing and Including Task Files |
|
|
242 | (1) |
|
Using Variables When Importing and Including Files |
|
|
243 | (4) |
|
|
247 | (1) |
|
|
247 | (1) |
|
|
248 | (1) |
|
|
248 | (1) |
|
|
248 | (1) |
|
|
249 | (1) |
|
|
249 | (2) |
|
Chapter 11 Troubleshooting Ansible |
|
|
251 | (30) |
|
"Do I Know this Already?" Quiz |
|
|
251 | (3) |
|
|
254 | (1) |
|
Managing Ansible Errors and Logs |
|
|
254 | (9) |
|
|
254 | (2) |
|
|
256 | (3) |
|
Optimizing Command Output Error Formatting |
|
|
259 | (1) |
|
|
259 | (1) |
|
|
260 | (3) |
|
Using Modules for Troubleshooting and Testing |
|
|
263 | (8) |
|
|
263 | (1) |
|
|
263 | (2) |
|
|
265 | (3) |
|
|
268 | (3) |
|
|
271 | (4) |
|
Troubleshooting Common Scenarios |
|
|
275 | (2) |
|
Analyzing Connectivity Issues |
|
|
275 | (1) |
|
Analyzing Authentication Issues |
|
|
276 | (1) |
|
|
277 | (1) |
|
|
277 | (1) |
|
|
278 | (1) |
|
|
278 | (1) |
|
|
278 | (1) |
|
|
278 | (1) |
|
|
279 | (1) |
|
|
279 | (2) |
|
Part III Managing Systems with Ansible |
|
|
|
Chapter 12 Managing Software with Ansible |
|
|
281 | (24) |
|
"Do I Know This Already?" Quiz |
|
|
281 | (3) |
|
|
284 | (1) |
|
Using Modules to Manage Packages |
|
|
284 | (5) |
|
Configuring Repository Access |
|
|
284 | (1) |
|
Managing Software with yum |
|
|
285 | (2) |
|
|
287 | (2) |
|
Using Modules to Manage Repositories and Subscriptions |
|
|
289 | (8) |
|
|
290 | (1) |
|
|
291 | (1) |
|
Managing RHEL Subscriptions |
|
|
292 | (5) |
|
Implementing a Playbook to Manage Software |
|
|
297 | (4) |
|
|
301 | (1) |
|
|
302 | (1) |
|
|
302 | (1) |
|
|
302 | (1) |
|
|
302 | (1) |
|
|
302 | (1) |
|
|
303 | (1) |
|
|
303 | (1) |
|
|
303 | (2) |
|
Chapter 13 Managing Users |
|
|
305 | (28) |
|
"Do I Know This Already?" Quiz |
|
|
305 | (3) |
|
|
308 | (1) |
|
Using Ansible Modules to Manage Users and Groups |
|
|
308 | (5) |
|
|
308 | (1) |
|
Managing Users and Groups |
|
|
308 | (1) |
|
|
309 | (4) |
|
|
313 | (6) |
|
Understanding SSH Connection Management Requirements |
|
|
313 | (1) |
|
|
314 | (1) |
|
|
314 | (5) |
|
Managing Encrypted Passwords |
|
|
319 | (4) |
|
Understanding Encrypted Passwords |
|
|
319 | (1) |
|
Generating Encrypted Passwords |
|
|
319 | (2) |
|
Using an Alternative Approach |
|
|
321 | (2) |
|
Managing Users Advanced Scenario Exercise |
|
|
323 | (6) |
|
|
329 | (1) |
|
|
330 | (1) |
|
|
330 | (1) |
|
|
330 | (1) |
|
|
330 | (1) |
|
|
330 | (1) |
|
|
331 | (1) |
|
|
331 | (2) |
|
Chapter 14 Managing Services and the Boot Process |
|
|
333 | (18) |
|
"Do I Know This Already?" Quiz |
|
|
333 | (3) |
|
|
336 | (1) |
|
|
336 | (5) |
|
Managing Systemd Services |
|
|
336 | (1) |
|
|
337 | (1) |
|
|
338 | (3) |
|
Managing the Boot Process |
|
|
341 | (3) |
|
|
341 | (1) |
|
|
342 | (2) |
|
Managing the Boot Process and Services Advanced Exercise |
|
|
344 | (2) |
|
|
346 | (1) |
|
|
346 | (1) |
|
|
346 | (1) |
|
|
347 | (1) |
|
|
347 | (1) |
|
|
347 | (1) |
|
|
348 | (1) |
|
|
348 | (3) |
|
Chapter 15 Managing Storage |
|
|
351 | (32) |
|
"Do I Know This Already?" Quiz |
|
|
351 | (3) |
|
|
354 | (1) |
|
Discovering Storage-Related Facts |
|
|
354 | (10) |
|
Using Storage-Related Facts |
|
|
354 | (3) |
|
Using Storage-Related Facts in Conditional Statements |
|
|
357 | (7) |
|
Managing Partitions and LVM |
|
|
364 | (7) |
|
|
364 | (2) |
|
Managing Volume Groups and LVM Logical Volumes |
|
|
366 | (1) |
|
Creating and Mounting File Systems |
|
|
367 | (1) |
|
|
368 | (3) |
|
Configuring Storage Advanced Exercise |
|
|
371 | (8) |
|
|
379 | (1) |
|
|
380 | (1) |
|
|
380 | (1) |
|
|
380 | (1) |
|
|
380 | (1) |
|
|
380 | (1) |
|
|
381 | (1) |
|
|
381 | (2) |
|
Chapter 16 Final Preparation |
|
|
383 | (4) |
|
|
383 | (4) |
|
|
383 | (1) |
|
|
384 | (1) |
|
|
384 | (1) |
|
|
385 | (1) |
|
The Nondisclosure Agreement |
|
|
386 | (1) |
|
|
|
|
387 | (4) |
|
|
391 | (4) |
|
|
Appendix A Answers to the "Do I Know This Already?" Quizzes and Review Questions |
|
395 | (20) |
Appendix B Getting Started with Ansible Tower |
|
415 | (16) |
Appendix C Red Hat RHCE 8 (EX294) Cert Guide Exam Updates |
|
431 | (2) |
Glossary |
|
433 | (6) |
Index |
|
439 | |
Online Elements: |
|
|
|
|
|
Appendix D Memory Tables |
|
Appendix E Memory Tables Answer Key |
|
Appendix F Study Planner |
|
Glossary |
|