Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add additional listen-address to CRC dnsmasq service #1761

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 31 additions & 3 deletions ci/playbooks/multinode-customizations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,16 @@
replace: >-
{{ _crc_default_net_ip | ansible.utils.ipaddr('address') }}

# Note(Lewis): Only needed for CRC => 2.32.0-4.14.8
- name: Configure dnsmasq listen-address to listen on both br-ex and ci-private-network
when:
- not _dnsmasq.stat.exists
become: true
ansible.builtin.lineinfile:
path: "{{ _dnsmasq_config }}"
insertafter: '^listen-address='
line: "listen-address={{ _crc_default_net_ip | ansible.utils.ipaddr('address') }}"

- name: Restart dnsmasq service if used
become: true
when:
Expand Down Expand Up @@ -196,6 +206,11 @@
ansible.builtin.set_fact:
persistent_ssh_key: "{{ pub_key_slurp['content'] | b64decode }}"

- name: Load network parameters
register: _cifmw_multinode_customizations_crc_net_env_slurp
ansible.builtin.slurp:
src: "/etc/ci/env/networking-info.yml"

- name: Check if cloud-init is overriding NM settings
become: true
ansible.builtin.stat:
Expand Down Expand Up @@ -223,13 +238,26 @@
ansible.builtin.command:
cmd: "nmcli -g general.connection device show eth0"

- name: Add the deployment DNS in the controller resolv.conf
- name: Prepend CRC DNS server in the controllers default Network Manager connection configuation
vars:
dns_servers_string: "192.168.122.10 {{ ansible_facts['dns']['nameservers'][0:1] | join(' ') }}"
_decoded_net_env: >-
{{
_cifmw_multinode_customizations_crc_net_env_slurp['content'] |
b64decode | from_yaml
}}
_crc_default_net_ip: >-
{{
_decoded_net_env.crc_ci_bootstrap_networks_out.crc.default.ip |
ansible.utils.ipaddr('address')
}}
dns_servers_string: >-
{{
( _crc_default_net_ip, ansible_facts['dns']['nameservers'][0:1] | join(' ') ) | list
}}
become: true
ansible.builtin.shell:
cmd: |-
nmcli con mod '{{ controller_default_connection_out.stdout | trim }}' ipv4.dns '{{ dns_servers_string }}' ipv4.route-metric 100;
nmcli con mod '{{ controller_default_connection_out.stdout | trim }}' ipv4.dns '{{ dns_servers_string | join(' ') }}' ipv4.route-metric 100;
nmcli con up '{{ controller_default_connection_out.stdout | trim }}';

- name: "Ensure persistent SSH access"
Expand Down