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

DNM Check binding dnsmasq listen-address to 0.0.0.0 #2454

Closed
Closed
Show file tree
Hide file tree
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
20 changes: 18 additions & 2 deletions ci/playbooks/multinode-customizations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,16 +108,32 @@
validate: "{{ _validate }}"

# Note(Lewis): Only needed for CRC => 2.32.0-4.14.8
- name: Wipe listen-address parameters from config to avoid duplication
when:
- not _dnsmasq.stat.exists
become: true
ansible.builtin.lineinfile:
path: "{{ _dnsmasq_config }}"
regexp: '^listen-address'
state: absent

- 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') }}"
insertbefore: '^expand-hosts'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason it needs to be before expand-hosts? if not, please just add it to EOF like line 95

Suggested change
insertbefore: '^expand-hosts'
insertafter: "EOF"

line: |
listen-address=0.0.0.0
listen-address=::
validate: "{{ _validate }}"

- name: Print current config
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove this after your testing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

of course ;)

become: true
ansible.builtin.command: |
cat {{ _dnsmasq_config }}

rescue:
- name: Debug _dnsmasq_config
ansible.builtin.debug:
Expand Down
3 changes: 1 addition & 2 deletions roles/ci_network/tasks/apply-dnsmasq.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@
vars:
data:
listen_addresses:
- "127.0.0.1"
- "{{ ansible_default_ipv4.address }}"
- "0.0.0.0"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please drop this file from this PR

ansible.builtin.set_fact:
_dnsmaq_config: >-
{{
Expand Down
2 changes: 1 addition & 1 deletion roles/ci_network/templates/local_domain.conf.j2
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This file is generated by ci-framework tool
listen-address={{ config.listen_addresses | join(',') }}
listen-address=0.0.0.0
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please drop this file from this PR


{% if 'interfaces' in config %}
{% for interface in config.interfaces %}
Expand Down
3 changes: 2 additions & 1 deletion roles/libvirt_manager/tasks/create_networks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,8 @@
cifmw_dnsmasq_network_name: "{{ item.name }}"
cifmw_dnsmasq_network_state: present
cifmw_dnsmasq_network_definition: "{{ item }}"
cifmw_dnsmasq_network_listen_addresses: "{{ _dns_address[item.name] }}"
cifmw_dnsmasq_network_listen_addresses:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please drop this file from this PR

- "0.0.0.0"
ansible.builtin.include_role:
name: dnsmasq
tasks_from: manage_network.yml
Expand Down