Skip to Content
Practical Ansible 2
book

Practical Ansible 2

by Daniel Oh, James Freeman, Fabio Alessandro Locati
June 2020
Intermediate to advanced
410 pages
9h 52m
English
Packt Publishing
Content preview from Practical Ansible 2

Adding host and group variables to your inventory

We have already touched upon host variableswe saw them earlier in this chapter when we used them to override connection details such as the user account to connect with, the address to connect to, and the port to use. However, there is so much more you can do with Ansible and inventory variables, and it is important to note that they can be defined not only at the host level but also at the group level, which again provides you with some incredibly powerful ways in which to efficiently manage your infrastructure from one central inventory.

Let's build on our previous three-tier example and suppose that we need to set two variables for each of our two frontend servers. These are not special ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Mastering Ansible - Third Edition

Mastering Ansible - Third Edition

James Freeman, Jesse Keating
Security Automation with Ansible 2

Security Automation with Ansible 2

Akash Mahajan, MADHU AKULA

Publisher Resources

ISBN: 9781789807462Supplemental Content