summaryrefslogtreecommitdiffstats
path: root/roles/static_inventory/templates/inventory.j2
blob: 24dc9d4a8f8ae6109ca468fb1ce823e5519b8b41 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# BEGIN Autogenerated hosts
{% for host in groups['all'] %}
{% if hostvars[host].get('ansible_connection', '') == 'local' %}
{{ host }} ansible_connection=local
{% else %}

{{ host }}{% if 'ansible_host' in hostvars[host]
%} ansible_host={{ hostvars[host]['ansible_host'] }}{% endif %}
{% if 'private_v4' in hostvars[host]
%} private_v4={{ hostvars[host]['private_v4'] }}{% endif %}
{% if 'public_v4' in hostvars[host]
%} public_v4={{ hostvars[host]['public_v4'] }}{% endif %}
{% if 'ansible_user' in hostvars[host]
%} ansible_user={{ hostvars[host]['ansible_user'] }}{% endif %}
{% if 'ansible_private_key_file' in hostvars[host]
%} ansible_private_key_file={{ hostvars[host]['ansible_private_key_file'] }}{% endif %}
{% if use_bastion|bool and 'ansible_ssh_extra_args' in hostvars[host]
%} ansible_ssh_extra_args={{ hostvars[host]['ansible_ssh_extra_args']|quote }}{% endif %} openshift_hostname={{ host }}

{% endif %}
{% endfor %}
# END autogenerated hosts

#[all:vars]
# For all group_vars, see ./group_vars/all.yml
[infra_hosts:vars]
openshift_node_labels={{ openshift_cluster_node_labels.infra | to_json | quote }}

[app:vars]
openshift_node_labels={{ openshift_cluster_node_labels.app | to_json | quote }}

# Create an OSEv3 group that contains the master, nodes, etcd, and lb groups.
# The lb group lets Ansible configure HAProxy as the load balancing solution.
# Comment lb out if your load balancer is pre-configured.
[cluster_hosts:children]
OSEv3
dns

[OSEv3:children]
nodes
etcd

# Set variables common for all OSEv3 hosts
#[OSEv3:vars]

# For OSEv3 normal group vars, see ./group_vars/OSEv3.yml

# Host Groups

[masters:children]
masters.{{ stack_name }}

[etcd:children]
etcd.{{ stack_name }}
{% if 'etcd' not in groups or groups['etcd']|length == 0 %}masters.{{ stack_name }}{% endif %}

[nodes:children]
masters
infra.{{ stack_name }}
nodes.{{ stack_name }}

[infra_hosts:children]
infra.{{ stack_name }}

[app:children]
nodes.{{ stack_name }}

[dns:children]
dns.{{ stack_name }}

# Empty placeholders for all groups of the cluster nodes
[masters.{{ stack_name }}]
[etcd.{{ stack_name }}]
[infra.{{ stack_name }}]
[nodes.{{ stack_name }}]
[app.{{ stack_name }}]
[dns.{{ stack_name }}]

# BEGIN Autogenerated groups
{% for group in groups %}
{% if group not in ['ungrouped', 'all'] %}
[{{ group }}]
{% for host in groups[group] %}
{{ host }}
{% endfor %}

{% endif %}
{% endfor %}
# END Autogenerated groups