From 60fa380e5dc24d98d99d8fe927a8ae142daf0e50 Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Tue, 9 Jan 2024 17:38:40 -0600 Subject: [PATCH] dyngroups: Always run all tasks Adding the `always` tag to the tasks in `dyngroups.yml` ensures that hosts will get added to the appropriate groups dynamically, even when running a subset of tasks by targeting specific tags. Ansible will always run tasks with this tag when a tag selection is passed to `ansible-playbook`. --- dyngroups.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dyngroups.yml b/dyngroups.yml index 383ada9..e19e36a 100644 --- a/dyngroups.yml +++ b/dyngroups.yml @@ -5,16 +5,20 @@ group_by: key: '{{ ansible_distribution }}' changed_when: false + tags: always - name: group hosts by distribution+version group_by: key: '{{ ansible_distribution }}{{ ansible_distribution_major_version }}' changed_when: false + tags: always - name: group hosts by os family group_by: key: '{{ ansible_os_family }}' changed_when: false + tags: always - name: group hosts by virtualization group_by: key: >- {{ ansible_virtualization_type }}-{{ ansible_virtualization_role }} changed_when: false + tags: always