Skip to content

Commit 895836e

Browse files
committed
[multiple] Consolidate cifmw_default_dns_servers var to group_vars
Move the definition of dns_servers used in reproducer and libvirt_manager role to common group_var definition so that it can be easily changed and managed from group_vars. Signed-off-by: Amartya Sinha <[email protected]>
1 parent 3e7af9d commit 895836e

File tree

5 files changed

+12
-8
lines changed

5 files changed

+12
-8
lines changed

group_vars/all.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,8 @@ cifmw_architecture_repo: "{{ ansible_user_dir }}/{{ cifmw_architecture_repo_rela
1313

1414
cifmw_openstack_namespace: "{{ cifmw_install_yamls_defaults['NAMESPACE'] | default('openstack') }}"
1515
operator_namespace: "{{ cifmw_install_yamls_defaults['OPERATOR_NAMESPACE'] | default('openstack-operators') }}"
16+
17+
# Default DNS servers to use across the framework
18+
cifmw_default_dns_servers:
19+
- "1.1.1.1"
20+
- "8.8.8.8"

roles/libvirt_manager/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,9 @@ The parameters listed here are therefore merely proxies to the ones set in the r
211211
and have the same name, less the role prefix. Default values are the same as the
212212
reproducer role.
213213

214-
* `cifmw_libvirt_manager_dns_servers`: `{{ cifmw_reproducer_dns_servers | default(['1.1.1.1', '8.8.8.8']) }}`
214+
Now, cifmw_default_dns_servers group_vars is introduced, and it sets dns_servers for both reproducer and libvirt_manager roles.
215+
216+
* `cifmw_libvirt_manager_dns_servers`: `{{ cifmw_default_dns_servers | default(['1.1.1.1', '8.8.8.8']) }}`
215217

216218
## Calling attach_network.yml from another role
217219

roles/libvirt_manager/defaults/main.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,8 @@ cifmw_libvirt_manager_apply_virtproxy_patch: true
5959
cifmw_libvirt_manager_net_prefix_add: true
6060
cifmw_libvirt_manager_pub_net: public
6161

62-
# Those parameters are usually set via the reproducer role.
63-
# We will therefore use them, and default to the same value set in the role.
64-
cifmw_libvirt_manager_dns_servers: "{{ cifmw_reproducer_dns_servers | default(['1.1.1.1', '8.8.8.8']) }}"
62+
# Now, cifmw_default_dns_servers group_vars is introduced, and it sets dns_servers for both reproducer and libvirt_manager roles.
63+
cifmw_libvirt_manager_dns_servers: "{{ cifmw_default_dns_servers | default(['1.1.1.1', '8.8.8.8']) }}"
6564
cifmw_libvirt_manager_crc_private_nic: "{{ cifmw_reproducer_crc_private_nic | default('enp2s0') }}"
6665

6766
# Allow to inject custom node family

roles/reproducer/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ None
1818
* `cifmw_reproducer_run_job`: (Bool) Run actual CI job. Defaults to `true`.
1919
* `cifmw_reproducer_run_content_provider`: (Bool) Run content-provider job. Defaults to `true`.
2020
* `cifmw_reproducer_params`: (Dict) Specific parameters you want to pass to the reproducer. Defaults to `{}`.
21-
* `cifmw_reproducer_dns_servers`: List of dns servers which should be used by the CRC VM as upstream dns servers. Defaults to 1.1.1.1, 8.8.8.8.
21+
* `cifmw_reproducer_dns_servers`: List of dns servers which should be used by the CRC VM as upstream dns servers. Reads from group_var `{{ cifmw_default_dns_servers }}`. Defaults to 1.1.1.1, 8.8.8.8.
2222
* `cifmw_reproducer_hp_rhos_release`: (Bool) Allows to consume rhos-release on the hypervisor. Defaults to `false`.
2323
* `cifmw_reproducer_dnf_tweaks`: (List) Options you want to inject in dnf.conf, both on controller-0 and hypervisor. Defaults to `[]`.
2424
* `cifmw_reproducer_skip_fetch_repositories`: (Bool) Skip fetching repositories from zuul var and simply copy the code from the ansible controller. Defaults to `false`.

roles/reproducer/defaults/main.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@ cifmw_reproducer_kubecfg: "{{ cifmw_libvirt_manager_configuration.vms.crc.image_
2626
cifmw_reproducer_params: {}
2727
cifmw_reproducer_run_job: true
2828
cifmw_reproducer_run_content_provider: true
29-
cifmw_reproducer_dns_servers:
30-
- 1.1.1.1
31-
- 8.8.8.8
29+
cifmw_reproducer_dns_servers: "{{ cifmw_default_dns_servers | default(['1.1.1.1', '8.8.8.8']) }}"
3230
cifmw_reproducer_repositories: []
3331
cifmw_reproducer_hp_rhos_release: false
3432
cifmw_reproducer_dnf_tweaks: []

0 commit comments

Comments
 (0)