Skip to content

PRELIM | Check Hyper-V Installation in tasks/prelim.yml is necessary for different tasks -- Missing tags: always #15

Closed
@davidstanaway

Description

@davidstanaway

Describe the Issue
A clear and concise description of what the bug is.

When using tags to run subsets of the CIS rules for different targets, this prelim task is a necessary dependency for a number of different tasks and they fail with win11cis_hyper_v_installed being undefined.

Expected Behavior
A clear and concise description of what you expected to happen.

Like other tasks tasks/prelim.yml, this should have the always tag, and be evaluated when tags are used on this role.

Actual Behavior
A clear and concise description of what's happening.

When using tags, this role fails with win11cis_hyper_v_installed being undefined.

Control(s) Affected
What controls are being affected by the issue

Environment (please complete the following information):

branch being used: [e.g. devel] devel
Ansible Version: [e.g. 2.10]
Host Python Version: [e.g. Python 3.7.6]
Ansible Server Python Version: [e.g. Python 3.7.6]
Additional Details:
Additional Notes
Anything additional goes here

Possible Solution
Enter a suggested fix here

diff --git a/tasks/prelim.yml b/tasks/prelim.yml
index 0033f44..770d54c 100644
--- a/tasks/prelim.yml
+++ b/tasks/prelim.yml
@@ -47,6 +47,8 @@
   changed_when: false
   failed_when: false
   register: win11cis_hyper_v_installed
+  tags:
+      - always
 
 - name: PRELIM | Get Windows installation type
   ansible.windows.win_reg_stat:

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions