Chapter 3. Separating Code and Data – Variables, Facts, and Templates
In the previous chapter, we looked at how to write a role to provide modularity and abstraction. While doing so, we created the configuration file and copied the file over to the destination host using Ansible's copy module.
In this chapter, we will cover the following concepts:
- How do you separate data from code?
- What are Jinja2 templates? How are these created?
- What are variables? How and where are they used?
- What are system facts? How are they discovered?
- What are the different types of variables?
- What is a variable merge order? What are its precedence rules?