Skip to content

Commit f1a2c3a

Browse files
author
Derek
committed
fix: Enforce winlike/maclike exclusivity with ansible_run_tags check
The 'never' tag doesn't work when role has inherited tags (developer, base). Added explicit check for tag in ansible_run_tags to ensure: - winlike tasks only run when --tags winlike is specified - maclike tasks only run when --tags maclike is specified
1 parent cbbe6b6 commit f1a2c3a

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

  • ansible/roles/dfe_developer/tasks

ansible/roles/dfe_developer/tasks/main.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,15 +92,19 @@
9292
apply:
9393
tags: ['winlike']
9494
tags: ['winlike', 'never']
95-
when: dfe_has_gnome | default(false)
95+
when:
96+
- dfe_has_gnome | default(false)
97+
- "'winlike' in ansible_run_tags"
9698

9799
- name: Apply macOS-like GNOME configuration
98100
ansible.builtin.include_tasks:
99101
file: gnome_maclike.yml
100102
apply:
101103
tags: ['maclike']
102104
tags: ['maclike', 'never']
103-
when: dfe_has_gnome | default(false)
105+
when:
106+
- dfe_has_gnome | default(false)
107+
- "'maclike' in ansible_run_tags"
104108

105109
- name: Configure system-wide GNOME defaults (winlike)
106110
block:
@@ -138,6 +142,7 @@
138142
when:
139143
- dfe_has_gnome | default(false)
140144
- ansible_distribution in ['Ubuntu', 'Fedora']
145+
- "'winlike' in ansible_run_tags"
141146

142147
- name: Configure system-wide GNOME defaults (maclike)
143148
block:
@@ -175,6 +180,7 @@
175180
when:
176181
- dfe_has_gnome | default(false)
177182
- ansible_distribution in ['Ubuntu', 'Fedora']
183+
- "'maclike' in ansible_run_tags"
178184

179185
- name: Install Ghostty terminal
180186
ansible.builtin.include_tasks:

0 commit comments

Comments
 (0)