File tree Expand file tree Collapse file tree 7 files changed +30
-14
lines changed
bastion-dnsmasq/templates Expand file tree Collapse file tree 7 files changed +30
-14
lines changed Original file line number Diff line number Diff line change 1313 - vars/ibmcloud.yml
1414 vars :
1515 assisted_installer_host : " {{ hostvars[inventory_hostname]['private_address'] }}"
16- bastion_controlplane_ip : " {{ hostvars[inventory_hostname]['private_address'] }}"
1716 http_store_host : " {{ hostvars[inventory_hostname]['private_address'] }}"
1817 roles :
1918 - validate-vars
Original file line number Diff line number Diff line change 11# Jetlag provided DNS on Bastion
22{% if lab in cloud_labs %}
33except-interface={{ bastion_public_interface }}
4- {% endif %}
54
65# Bastion / assisted-installer / http-server / registry / router / dns
7- {% for network in controlplane_network %}
6+ address=/{{ groups['bastion'] [0] }}/{{ hostvars[inventory_hostname] ['private_address'] }}
7+
8+ address=/api.{{ cluster_name }}.{{ base_dns_name }}/{{ controlplane_network_api }}
9+ address=/apps.{{ cluster_name }}.{{ base_dns_name }}/{{ controlplane_network_ingress }}
10+
11+ {% else %}
12+ # Bastion / assisted-installer / http-server / registry / router / dns
13+ {% for network in controlplane_network %}
814address=/{{ groups['bastion'] [0] }}/{{ network | ansible.utils.nthhost(1) }}
915address=/api.{{ cluster_name }}.{{ base_dns_name }}/{{ network | ansible.utils.nthhost(3) }}
1016address=/apps.{{ cluster_name }}.{{ base_dns_name }}/{{ network | ansible.utils.nthhost(4) }}
11- {% endfor %}
17+ {% endfor %}
18+ {% endif %}
1219
1320# Jetlag provided DNS for VMs
1421{% for vm in groups ['hv_vm' ] %}
Original file line number Diff line number Diff line change 11# Deployed by Jetlag automation
22search {{ base_dns_name }}
3- {% if public_vlan | default ( false ) %}
4- nameserver {{ ansible_default_ipv4.address }}
3+ {% if lab in cloud_labs %}
4+ nameserver {{ hostvars[inventory_hostnam e] ['private_address '] }}
55{% else %}
6+ {% if public_vlan | default (false ) %}
7+ nameserver {{ ansible_default_ipv4.address }}
8+ {% else %}
69nameserver {{ controlplane_network[0] | ansible.utils.nthhost(1) }}
10+ {% endif %}
711{% endif %}
812{% if lab in rh_labs or lab == "byol" %}
9- {% for dns in labs [lab ]['dns' ] %}
13+ {% for dns in labs [lab ]['dns' ] %}
1014nameserver {{ dns }}
11- {% endfor %}
15+ {% endfor %}
1216{% else %}
13- {% if dns_servers | length == 1 %}
17+ {% if dns_servers | length == 1 %}
1418nameserver {{ dns_servers[0] }}
15- {% elif dns_servers | length >= 2 %}
19+ {% elif dns_servers | length >= 2 %}
1620nameserver {{ dns_servers[0] }}
1721nameserver {{ dns_servers[1] }}
18- {% endif %}
22+ {% endif %}
1923{% endif %}
Original file line number Diff line number Diff line change 4949 "openshift_version": "{{ openshift_version }}",
5050 "high_availability_mode": "None",
5151 "base_dns_domain": "{{ base_dns_name }}",
52+ {% if lab in rh_labs %}
5253 "machine_networks": [
5354 {% for network in controlplane_network %}
5455 {"cidr": "{{ network }}"}{{ "," if not loop.last else "" }}
5556 {% endfor %}
5657 ],
58+ {% endif %}
5759 "cluster_networks": [
5860 {% for i in range(cluster_network_cidr | length) %}
5961 {"cidr": "{{ cluster_network_cidr[i] }}", "host_prefix": {{ cluster_network_host_prefix[i] }} }{{ "," if not loop.last else "" }}
117119 "name": "{{ cluster_name }}",
118120 "openshift_version": "{{ openshift_version }}",
119121 "base_dns_domain": "{{ base_dns_name }}",
122+ {% if lab in rh_labs %}
120123 "machine_networks": [
121124 {% for network in controlplane_network %}
122125 {"cidr": "{{ network }}"}{{ "," if not loop.last else "" }}
123126 {% endfor %}
124127 ],
128+ {% endif %}
125129 "cluster_networks": [
126130 {% for i in range(cluster_network_cidr | length) %}
127131 {"cidr": "{{ cluster_network_cidr[i] }}", "host_prefix": {{ cluster_network_host_prefix[i] }} }{{ "," if not loop.last else "" }}
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ controlplane_network_prefix: [16]
1818# Gateway for controlplane network - defaults to .1 of first network
1919# Can be overridden for special cases (e.g., public VLAN)
2020controlplane_network_gateway : " {{ controlplane_network[0] | ansible.utils.nthhost(1) }}"
21- # Sets "bastion_controlplane_ip" as primary dns
21+ # Sets bastion as primary dns
2222controlplane_bastion_as_dns : true
2323
2424# OCP networks - always lists
Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ lab_interface={{ controlplane_lab_interface }}
7171# network_prefix={{ controlplane_network_prefix }}
7272# gateway={{ controlplane_network_gateway }}
7373{% if controlplane_bastion_as_dns %}
74- # dns1={{ bastion_controlplane_ip }}
74+ # dns1={{ controlplane_network[ 0] | ansible.utils.nthhost(1) }}
7575{% else %}
7676# dns1={{ labs[lab] ['dns'] [0] }}
7777# dns2={{ labs[lab] ['dns'] [1] | default('') }}
@@ -142,7 +142,7 @@ bmc_password={{ bmc_password }}
142142# network_prefix={{ controlplane_network_prefix }}
143143# gateway={{ controlplane_network_gateway }}
144144{% if controlplane_bastion_as_dns %}
145- # dns1={{ bastion_controlplane_ip }}
145+ # dns1={{ controlplane_network[ 0] | ansible.utils.nthhost(1) }}
146146{% else %}
147147# dns1={{ labs[lab] ['dns'] [0] }}
148148# dns2={{ labs[lab] ['dns'] [1] | default('') }}
Original file line number Diff line number Diff line change 124124 when : hostvars | json_query('(*)[?network_mac]')
125125
126126- name : Validate network configuration
127+ when :
128+ - lab in rh_labs
127129 block :
128130 - name : Validate controlplane_network is a list
129131 fail :
You can’t perform that action at this time.
0 commit comments