3
3
# Bastion
4
4
{{ bastion_controlplane_ip }} {{ groups['bastion'] [0] }}
5
5
6
- # Hub Cluster API
6
+ {% if cluster_type in ["mno" , "vmno" ] %}
7
+ # MNO Cluster API
7
8
{{ controlplane_network_api }} api.{{ cluster_name }}.{{ base_dns_name }}
9
+ {% else %}
10
+ {% for sno in groups ['sno' ] %}
11
+ # SNO Cluster API
12
+ {{ hostvars[sno] .ip }} api.{{ sno }}.{{ base_dns_name }}
13
+ {% endfor %}
14
+ {% endif %}
8
15
9
16
# VM
10
17
{% for vm in groups ['hv_vm' ] %}
@@ -18,38 +25,49 @@ hosts {
18
25
{{ hostvars[groups['hv_vm'] [0]] ['machine_network'] | ansible.utils.nthhost(-2) }} api.jumbocluster00.{{ base_dns_name }}
19
26
20
27
# Standard cluster DNS ({{ standard_cluster_dns_count }} Entries)
21
- {% for cluster in range (1, standard_cluster_dns_count + 1, 1) %}
28
+ {% for cluster in range (1, standard_cluster_dns_count + 1, 1) %}
22
29
{{ hostvars[groups['hv_vm'] [0]] ['machine_network'] | ansible.utils.nthhost(cluster * -2) }} standard-{{ '%05d' | format(cluster) }}
23
30
{{ hostvars[groups['hv_vm'] [0]] ['machine_network'] | ansible.utils.nthhost(cluster * -2) }} api.standard-{{ '%05d' | format(cluster) }}.{{ base_dns_name }}
24
- {% endfor %}
31
+ {% endfor %}
25
32
26
33
# Compact cluster DNS ({{ compact_cluster_dns_count }} Entries)
27
- {% for cluster in range (1, compact_cluster_dns_count + 1, 1) %}
34
+ {% for cluster in range (1, compact_cluster_dns_count + 1, 1) %}
28
35
{{ hostvars[groups['hv_vm'] [0]] ['machine_network'] | ansible.utils.nthhost((cluster + standard_cluster_dns_count) * -2) }} compact-{{ '%05d' | format(cluster) }}
29
36
{{ hostvars[groups['hv_vm'] [0]] ['machine_network'] | ansible.utils.nthhost((cluster + standard_cluster_dns_count) * -2) }} api.compact-{{ '%05d' | format(cluster) }}.{{ base_dns_name }}
30
- {% endfor %}
37
+ {% endfor %}
31
38
{% endif %}
32
39
fallthrough
33
40
}
34
41
35
42
# *.apps All Clusters
36
43
{% if bastion_controlplane_ip | ansible .utils .ipv 6 %}
44
+ {% if cluster_type in ["mno" , "vmno" ] %}
37
45
# *.apps for hub cluster
38
46
template IN AAAA {{ cluster_name }}.{{ base_dns_name }} {
39
47
match .*.apps.{{ cluster_name }}.{{ base_dns_name }}
40
48
answer "{% raw %} {{ .Name }} 60 in {{ .Type }}{% endraw %} {{ controlplane_network_ingress }}"
41
49
fallthrough
42
50
}
51
+ {% else %}
52
+ {% for sno in groups ['sno' ] %}
53
+ # *.apps for {{ sno }} SNO
54
+ template IN AAAA {{ sno }}.{{ base_dns_name }} {
55
+ match .*.apps.{{ sno }}.{{ base_dns_name }}
56
+ answer "{% raw %} {{ .Name }} 60 in {{ .Type }}{% endraw %} {{ hostvars[sno] .ip }}"
57
+ fallthrough
58
+ }
59
+ {% endfor %}
60
+ {% endif %}
43
61
44
62
# *.apps for VMs
45
- {% for vm in groups ['hv_vm' ] %}
63
+ {% for vm in groups ['hv_vm' ] %}
46
64
template IN AAAA {{ vm }}.{{ base_dns_name }} {
47
65
match .*.apps.{{ vm }}.{{ base_dns_name }}
48
66
answer "{% raw %} {{ .Name }} 60 in {{ .Type }}{% endraw %} {{ hostvars[vm] .ip }}"
49
67
fallthrough
50
68
}
51
- {% endfor %}
52
- {% if groups ['hv_vm' ] | length > 0 %}
69
+ {% endfor %}
70
+ {% if groups ['hv_vm' ] | length > 0 %}
53
71
54
72
# *.apps for jumbocluster00
55
73
template IN AAAA jumbocluster00.{{ base_dns_name }} {
@@ -59,41 +77,51 @@ template IN AAAA jumbocluster00.{{ base_dns_name }} {
59
77
}
60
78
61
79
# *.apps for standard clusters
62
- {% for cluster in range (1, standard_cluster_dns_count + 1, 1) %}
80
+ {% for cluster in range (1, standard_cluster_dns_count + 1, 1) %}
63
81
template IN AAAA standard-{{ '%05d' | format(cluster) }}.{{ base_dns_name }} {
64
82
match .*.apps.standard-{{ '%05d' | format(cluster) }}.{{ base_dns_name }}
65
83
answer "{% raw %} {{ .Name }} 60 in {{ .Type }}{% endraw %} {{ hostvars[groups['hv_vm'] [0]] ['machine_network'] | ansible.utils.nthhost( (cluster * -2) - 1 ) }}"
66
84
fallthrough
67
85
}
68
- {% endfor %}
86
+ {% endfor %}
69
87
70
88
# *.apps for compact clusters
71
- {% for cluster in range (1, compact_cluster_dns_count + 1, 1) %}
89
+ {% for cluster in range (1, compact_cluster_dns_count + 1, 1) %}
72
90
template IN AAAA compact-{{ '%05d' | format(cluster) }}.{{ base_dns_name }} {
73
91
match .*.apps.compact-{{ '%05d' | format(cluster) }}.{{ base_dns_name }}
74
92
answer "{% raw %} {{ .Name }} 60 in {{ .Type }}{% endraw %} {{ hostvars[groups['hv_vm'] [0]] ['machine_network'] | ansible.utils.nthhost( ((cluster + standard_cluster_dns_count) * -2) - 1 ) }}"
75
93
fallthrough
76
94
}
77
- {% endfor %}
78
- {% endif %}
95
+ {% endfor %}
96
+ {% endif %}
79
97
{% else %}
80
-
81
- # *.apps for hub cluster
98
+ {% if cluster_type in [ "mno" , "vmno" ] %}
99
+ # *.apps for mno cluster
82
100
template IN A {{ cluster_name }}.{{ base_dns_name }} {
83
101
match .*.apps.{{ cluster_name }}.{{ base_dns_name }}
84
102
answer "{% raw %} {{ .Name }} 60 in {{ .Type }}{% endraw %} {{ controlplane_network_ingress }}"
85
103
fallthrough
86
104
}
105
+ {% else %}
106
+ {% for sno in groups ['sno' ] %}
107
+ # *.apps for {{ sno }} SNO
108
+ template IN A {{ sno }}.{{ base_dns_name }} {
109
+ match .*.apps.{{ sno }}.{{ base_dns_name }}
110
+ answer "{% raw %} {{ .Name }} 60 in {{ .Type }}{% endraw %} {{ hostvars[sno] .ip }}"
111
+ fallthrough
112
+ }
113
+ {% endfor %}
114
+ {% endif %}
87
115
88
116
# *.apps for VMs
89
- {% for vm in groups ['hv_vm' ] %}
117
+ {% for vm in groups ['hv_vm' ] %}
90
118
template IN A {{ vm }}.{{ base_dns_name }} {
91
119
match .*.apps.{{ vm }}.{{ base_dns_name }}
92
120
answer "{% raw %} {{ .Name }} 60 in {{ .Type }}{% endraw %} {{ hostvars[vm] .ip }}"
93
121
fallthrough
94
122
}
95
- {% endfor %}
96
- {% if groups ['hv_vm' ] | length > 0 %}
123
+ {% endfor %}
124
+ {% if groups ['hv_vm' ] | length > 0 %}
97
125
98
126
# *.apps for jumbocluster00
99
127
template IN A jumbocluster00.{{ base_dns_name }} {
@@ -103,21 +131,21 @@ template IN A jumbocluster00.{{ base_dns_name }} {
103
131
}
104
132
105
133
# *.apps for standard clusters
106
- {% for cluster in range (1, standard_cluster_dns_count + 1, 1) %}
134
+ {% for cluster in range (1, standard_cluster_dns_count + 1, 1) %}
107
135
template IN A standard-{{ '%05d' | format(cluster) }}.{{ base_dns_name }} {
108
136
match .*.apps.standard-{{ '%05d' | format(cluster) }}.{{ base_dns_name }}
109
137
answer "{% raw %} {{ .Name }} 60 in {{ .Type }}{% endraw %} {{ hostvars[groups['hv_vm'] [0]] ['machine_network'] | ansible.utils.nthhost( (cluster * -2) - 1 ) }}"
110
138
fallthrough
111
139
}
112
- {% endfor %}
140
+ {% endfor %}
113
141
114
142
# *.apps for compact clusters
115
- {% for cluster in range (1, compact_cluster_dns_count + 1, 1) %}
143
+ {% for cluster in range (1, compact_cluster_dns_count + 1, 1) %}
116
144
template IN A compact-{{ '%05d' | format(cluster) }}.{{ base_dns_name }} {
117
145
match .*.apps.compact-{{ '%05d' | format(cluster) }}.{{ base_dns_name }}
118
146
answer "{% raw %} {{ .Name }} 60 in {{ .Type }}{% endraw %} {{ hostvars[groups['hv_vm'] [0]] ['machine_network'] | ansible.utils.nthhost( ((cluster + standard_cluster_dns_count) * -2) - 1 ) }}"
119
147
fallthrough
120
148
}
121
- {% endfor %}
122
- {% endif %}
149
+ {% endfor %}
150
+ {% endif %}
123
151
{% endif %}
0 commit comments