Make tests for group membership more readable

This commit is contained in:
Andreas B. Mundt 2024-11-21 11:20:26 +01:00
parent 8a25609749
commit 77f4643628
9 changed files with 24 additions and 24 deletions

View file

@ -12,7 +12,7 @@
ipv4.route-metric=2048
[keyfile]
unmanaged-devices=interface-name:en*;interface-name:vm*
when: groups.teacherlaptop is defined and inventory_hostname in groups.teacherlaptop
when: "'teacherlaptop' in group_names"
- name: Use iwd for USB-Wlan-Sticks but ignore interfaces managed by systemd-networkd (wlan0,en*)
blockinfile:
@ -26,7 +26,7 @@
ipv4.route-metric=2048
[keyfile]
unmanaged-devices=interface-name:wlan0;interface-name:en*;interface-name:vm*
when: not (groups.teacherlaptop is defined and inventory_hostname in groups.teacherlaptop)
when: "'teacherlaptop' not in group_names"
- name: Enable Networkmanager
ansible.builtin.systemd:
@ -59,7 +59,7 @@
Name=enx{{ ansible_facts[ansible_interfaces | select('search', '^enp.*') | first].macaddress | replace(':','') }}
[Network]
Bridge=virbr1
when: groups.teacherlaptop is defined and inventory_hostname in groups.teacherlaptop
when: "'teacherlaptop' in group_names"
- name: Configure systemd-networkd ethernet.network
ansible.builtin.copy:
@ -113,7 +113,7 @@
DHCP=yes
[DHCPv4]
UseDomains=true
when: not (groups.teacherlaptop is defined and inventory_hostname in groups.teacherlaptop)
when: "'teacherlaptop' not in group_names"
- name: Enable systemd-networkd
ansible.builtin.systemd: