This commit is contained in:
135
2023-09-07 08:38:05 +03:00
parent 762be6dd88
commit 9eb580b841
3 changed files with 46 additions and 2 deletions

View File

@@ -1,5 +1,6 @@
---
# tasks file for network-manager
- name: "apt install NetworkManager {{ nm_version }} "
become: true
apt:
@@ -17,10 +18,27 @@
group: root
mode: 0644
when: globally_managed_devices is true
notify: network-manager configuration changed
- name: cleanup globally managed devices
become: true
file:
path: "{{ globally_managed_devices_path }}"
state: absent
when: not globally_managed_devices
when: not globally_managed_devices
- name: Configure NetworkManager
become: true
community.general.nmcli:
conn_name: "{{ net_item.con_name }}"
ifname: "{{ net_item.ifname }}"
type: "{{ net_item.type }}"
ip4: "{{ net_item.ip4 }}"
gw4: "{{ net_item.gw4 | default('') }}"
dns4: "{{ net_item.dns4 | default([]) }}"
method6: "{{ net_item.method6 | default('auto') }}"
state: present
with_items: "{{ network }}"
loop_control:
loop_var: net_item
notify: network-manager configuration changed