Add loop var policy to ansible-lint

This adds a custom ansible-lint rule at .rules/ZuulJobsNamespaceLoopVar.py
that enforces the loop var policy described at:
https://zuul-ci.org/docs/zuul-jobs/policy.html#ansible-loops-in-roles

It also updates existing roles to follow the policy.

Change-Id: I92b2ff56a1c2702542fc07b316f1809087a4c92f
This commit is contained in:
Albin Vass
2020-04-29 12:52:21 +02:00
parent d775467078
commit d0e2016592
22 changed files with 105 additions and 56 deletions

View File

@@ -3,6 +3,8 @@
- include_role:
name: helm-template
vars:
helm_release_name: "{{ item.key }}"
helm_chart: "{{ item.value }}"
helm_release_name: "{{ zj_item.key }}"
helm_chart: "{{ zj_item.value }}"
loop: "{{ helm_charts | dict2items }}"
loop_control:
loop_var: 'zj_item'