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

Prevent NM from automatic (DHCP) configuration on ethernet devices #840

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion playbooks/configure_network.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
name: osp.edpm.edpm_ovs
tags:
- edpm_ovs
# Sets up network using OVS
# Sets up EDPM network using os-net-config
- name: Import edpm_network_config
ansible.builtin.import_role:
name: osp.edpm.edpm_network_config
Expand Down
1 change: 1 addition & 0 deletions roles/edpm_network_config/molecule/default/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,6 @@
next_hop: 192.168.180.1
edpm_network_config_manage_service: false
edpm_network_config_hide_sensitive_logs: false
edpm_bootstrap_network_service: 'NetworkManager'
roles:
- role: "osp.edpm.edpm_network_config"
1 change: 1 addition & 0 deletions roles/edpm_network_config/molecule/default/prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
test_deps_setup_edpm: true
test_deps_extra_packages:
- iproute
- NetworkManager
- name: Prepare
hosts: all
gather_facts: false
Expand Down
1 change: 1 addition & 0 deletions roles/edpm_network_config/molecule/nmstate/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,6 @@
prefix-length: 24
dhcp: false
enabled: true
edpm_bootstrap_network_service: 'NetworkManager'
roles:
- role: osp.edpm.edpm_network_config
27 changes: 23 additions & 4 deletions roles/edpm_network_config/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,26 @@
- name: Load system-roles.network tasks [nmstate]
ansible.builtin.include_role:
name: "{{ lookup('ansible.builtin.env', 'EDPM_SYSTEMROLES', default='fedora.linux_system_roles') + '.network' }}"
- name: Load edpm_network_config tasks [os-net-config]
ansible.builtin.include_tasks:
file: network_config.yml
when: edpm_network_config_tool == 'os-net-config'

- name: Disable auto-configuration of all interfaces by NetworkManager
when: ( edpm_bootstrap_network_service == 'NetworkManager' ) and
( edpm_network_config_tool == 'os-net-config' )
become: true
block:
- name: Set 'no-auto-default' in /etc/NetworkManager/NetworkManager.conf
community.general.ini_file:
path: /etc/NetworkManager/NetworkManager.conf
state: present
mode: "0644"
no_extra_spaces: true
section: main
option: no-auto-default
value: "*"
backup: true
- name: Restart NetworkManager
ansible.builtin.systemd:
name: NetworkManager
state: restarted
- name: Load edpm_network_config tasks for os-net-config tool
ansible.builtin.include_tasks:
file: network_config.yml
Loading