Variables
Most playbooks and roles will make use of variables, which can be overridden in several ways. The simplest way is to create files in the host_vars and groups_vars folders; these allow you to override variables either based on the host or group membership, respectively.
Create a /etc/ansible/group_vars directory. Create a file in group_vars called mons and place the following inside it:
a_variable: "foo"
Create a file in group_vars called osds and place the following inside it:
a_variable: "bar"
Variables follow a precedence order; you can also create an all file which will apply to all groups. However, a variable of the same name that is in a more specific matching group will override it. Ceph Ansible modules make use of this to ...
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.
Read now
Unlock full access