Skip to content

Commit 6bd7458

Browse files
authoredNov 3, 2020
Merge pull request ComplianceAsCode#6330 from yuumasato/add_role_rule_variable_first
Evaluate Role default added variable conditionals first
2 parents 3cb7bd2 + 30c04d4 commit 6bd7458

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎utils/ansible_playbook_to_role.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ def added_variables(self):
188188
task["when"] = [task["when"]]
189189

190190
variables_to_add = {tag for tag in task["tags"] if self._tag_is_valid_variable(tag)}
191-
task["when"] += ["{varname} | bool".format(varname=v) for v in variables_to_add]
191+
task["when"] = ["{varname} | bool".format(varname=v) for v in variables_to_add] + task["when"]
192192
variables.update(variables_to_add)
193193

194194
if not task["when"]:

0 commit comments

Comments
 (0)
Please sign in to comment.