diff options
| author | Ahmed Abdelhalim <[email protected]> | 2025-08-21 02:51:30 +0200 |
|---|---|---|
| committer | Ahmed Abdelhalim <[email protected]> | 2025-08-21 02:51:30 +0200 |
| commit | 22d1ae642daf7cc6b3f7897f50bac3941e336f5c (patch) | |
| tree | 1033dc150c4358af5bfbb8780696dbf8eaf951b1 /roles/network/tasks | |
| parent | 0cacc3f9278d2624b11396c7ff9f9c651e6edde5 (diff) | |
Fix network role to install via chroot
The removal of the resolv.conf DNS configuration is required by the
wireguard not to have conflicting DNS configuration resolvers between
the static system fallback and the NetworkManager resolver (using
systemd-resolved) and the VPN DNS
Diffstat (limited to 'roles/network/tasks')
| -rw-r--r-- | roles/network/tasks/main.yml | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/roles/network/tasks/main.yml b/roles/network/tasks/main.yml index 60f81c99..fd2553ff 100644 --- a/roles/network/tasks/main.yml +++ b/roles/network/tasks/main.yml @@ -38,7 +38,6 @@ state: "stopped" with_items: "{{ network_disabled_services }}" when: not ansible_is_chroot - failed_when: false - name: "(chroot): Ensure network disabled services are disabled" ansible.builtin.command: @@ -46,7 +45,6 @@ changed_when: true with_items: "{{ network_disabled_services }}" when: ansible_is_chroot - failed_when: false # noqa: command-instead-of-module module doesn't work inside chroot - name: "Configure NetworkManager" @@ -56,6 +54,12 @@ - "Restart NetworkManager" - "Restart systemd-resolved" block: + - name: "Remove resolv.conf symlink" + ansible.builtin.file: + path: "/etc/resolv.conf" + state: "absent" + when: not ansible_is_chroot + - name: "Configure systemd-resolved" ansible.builtin.template: src: "resolved.conf.j2" |
