код по отключению udev/rules механизма управления сетевыми устройствами, характерного для noncloud образа Debian 11
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
---
|
||||
# tasks file for network-manager
|
||||
- name: "apt install NetworkManager {{ nm_version }} "
|
||||
become: true
|
||||
apt:
|
||||
name: "network-manager{{ nm_version }}"
|
||||
default_release: "{{ ansible_distribution_release }}-backports"
|
||||
@@ -9,7 +8,6 @@
|
||||
update_cache: true
|
||||
|
||||
- name: config globally managed devices
|
||||
become: true
|
||||
template:
|
||||
src: "conf.d/10-globally-managed-devices.j2"
|
||||
dest: "{{ globally_managed_devices_path }}"
|
||||
@@ -19,8 +17,28 @@
|
||||
when: globally_managed_devices is true
|
||||
|
||||
- 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: Include tasks for checking and removing udev rules
|
||||
include_tasks: check_udev_rules.yml
|
||||
|
||||
- name: Configure NetworkManager
|
||||
community.general.nmcli:
|
||||
conn_name: "{{ connection.con_name }}"
|
||||
ifname: "{{ connection.ifname }}"
|
||||
type: "{{ connection.type }}"
|
||||
ip4: "{{ connection.ip4 }}"
|
||||
gw4: "{{ connection.gw4 | default('') }}"
|
||||
dns4: "{{ connection.dns4 | default([]) }}"
|
||||
method6: "{{ connection.method6 | default('auto') }}"
|
||||
state: present
|
||||
with_items: "{{ network }}"
|
||||
loop_control:
|
||||
loop_var: connection
|
||||
notify: Restart NetworkManager
|
||||
|
||||
- name: Notify the reboot handler
|
||||
meta: flush_handlers
|
||||
Reference in New Issue
Block a user