3
Allows to define group of nodes and set parameters (facts). This group of nodes, then, are used in playbooks and roles
4
to configure specific services. Standard ini file format is used.
6
[group1] - defines a group of nodes
7
node.org - just a signle node
8
node.org var1=val1 var2=val2 - add nodes and sets some facts about it
9
node[1:3].org - add to group multiple nodes with similar names
11
[multi-group:children] - define a group of ndoes which assembled from other groups
15
[group1:vars] - define variables for all nodes in the group
23
- name: Execute set of tasks on specified group of nodes
24
hosts: group1 - all nodes belongign to group1
25
hosts: group1:group2 - all nodes belonging to either group1 or group2 (or both)
26
hosts: group1:group2:!group3 - all nodes belonging to group1 or group2, but not belonging to group3
29
Looping over inventory
30
----------------------
31
- mod: <params> - The node params can be addressed like hostvars[item]['openshift_hostname']
32
with_inventory_hostnames: [ 'nodes' ]
37
Normally, the groups are used to specify types of nodes 'web-servers', 'databases' to perform specific configuration tasks. However, often
38
there is multiple types of setups. Lets say staging setup for devlopment and production setup. So, the nodes could be grouped in multiple
39
ways web vs database or staging vs production. We would define all relevant group of nodes sharing common parameters (all 4 types: web, db,
40
staging, production) and set these parameters in the files in 'group_vars' folder. Then, the included inventory will specify what have to
41
be configured in the specific setup.
b'\\ No newline at end of file'