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

@ -100,9 +100,9 @@
- kerberize
- lmn_security
- role: lmn_localhome
when: groups.localhome is defined and inventory_hostname in groups.localhome
when: "'localhome' in group_names"
- role: lmn_teacherlaptop
when: groups.teacherlaptop is defined and inventory_hostname in groups.teacherlaptop
when: "'teacherlaptop' in group_names"
tasks:
## Temporary fixes and quirks:
@ -157,7 +157,7 @@
cmd: unzip -d /tmp/cb/ CodeBlocks.zip && dpkg -i cb/*.deb
chdir: /tmp/
when: new_codeblocks.changed | default(false)
when: groups.PCroom is defined and inventory_hostname in groups.PCroom
when: "'PCroom' in group_names"
## Clean up stuff from obsolete/faulty tasks:
- name: Remove sddm login screen patch with deprecated marker (homeondisk)
@ -301,7 +301,7 @@
blockinfile:
path: /etc/NetworkManager/NetworkManager.conf
state: absent
when: groups.laptop is defined and inventory_hostname not in groups.laptop
when: "'laptop' not in group_names"
## bookworm fixes/hacks:
- name: Work around sddm hang on shutdown
@ -343,7 +343,7 @@
- role: lmn_wlan_iwd
when: ansible_interfaces | select('search', 'wl.+') | first is defined
- role: lmn_localuser
when: not (groups.teacherlaptop is defined and inventory_hostname in groups.teacherlaptop)
when: "'teacherlaptop' not in group_names"
tasks:
- name: Remove deprecated files and directories (laptop-class)
file: