zuul-jobs/roles/ensure-pip/tasks/source.yaml
Albin Vass d0e2016592 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
2020-04-29 17:20:59 +02:00

23 lines
555 B
YAML

- name: Temporary install directory
tempfile:
state: directory
suffix: ensure-pip
register: _install_dir
- name: Download pip
get_url:
url: '{{ ensure_pip_from_upstream_url }}'
dest: '{{ _install_dir.path }}/get-pip.py'
- name: 'Run get-pip.py for {{ zj_item }}'
command: '{{ zj_item }} {{ _install_dir.path }}/get-pip.py'
become: yes
loop: '{{ ensure_pip_from_upstream_interpreters }}'
loop_control:
loop_var: zj_item
- name: Remove temporary install dir
file:
state: absent
path: '{{ _install_dir.path }}'