ansible-lint: add names to blocks/includes, etc.

This adds names to blocks and includes for consistency.  We've done
this before (e.g. Ia7e490aaba99da9694a6f3fdb1bca9838221b30a) but I
guess 6.12.0 is finding more...

Change-Id: Ib451f6d3c5a18047873e63aa0a1aa2b425846fec
This commit is contained in:
Ian Wienand 2023-02-02 13:22:56 +11:00
parent 7a66a26b77
commit 58a8d1a119
No known key found for this signature in database
14 changed files with 66 additions and 33 deletions

View File

@ -41,7 +41,8 @@
zuul: "{{ new_zuul }}"
docker_images: "{{ multiarch | ternary(_arch_docker_images, _normal_docker_images) }}"
- include_role:
- name: "Upload container image"
include_role:
name: "upload-{{ (container_command == 'docker') | ternary('docker', 'container') }}-image"
vars:
zuul: "{{ new_zuul }}"

View File

@ -1,7 +1,8 @@
- hosts: all
pre_tasks:
# Run ensure-output-dirs now as it is not performed speculatively
- import_role:
- name: Run ensure-output-dirs
import_role:
name: ensure-output-dirs
- name: Create fake translation
@ -10,10 +11,12 @@
echo Hello > src/{{ zuul.project.canonical_name }}/translation-source/test
tasks:
- import_role:
- name: Run fetch-translation-output
import_role:
name: fetch-translation-output
- import_role:
- name: Run fetch-output
import_role:
name: fetch-output
when: zuul_use_fetch_output

View File

@ -13,21 +13,26 @@
async: 120
poll: 0
register: touched_file
- async_status:
- name: Set async status
async_status:
jid: "{{ keygen.ansible_job_id }}"
register: keygen_check
until: keygen_check.finished == 1
retries: 2
- include_role:
- name: Run intercept-job
include_role:
name: intercept-job
- async_status:
- name: Set async status
async_status:
jid: "{{ touched_file.ansible_job_id }}"
register: touched_file_check
until: touched_file_check.finished == 1
retries: 3
- stat:
- name: Stat job stop
stat:
path: "{{ zuul.project.src_dir }}/intercept_job.stop"
register: stop_waiting
- assert:
- name: Look for failures
assert:
that:
- stop_waiting.stat.exists

View File

@ -7,11 +7,13 @@
args:
warn: false
tasks:
- import_role:
- name: Run fetch-javascript-tarball
import_role:
name: fetch-javascript-tarball
vars:
project_ver: master
- import_role:
- name: Run fetch-output
import_role:
name: fetch-output
when: zuul_use_fetch_output
post_tasks:

View File

@ -5,7 +5,8 @@
roles:
- multi-node-bridge
post_tasks:
- become: yes
- name: Check openvswitch
become: yes
block:
- name: openvswitch should be installed
package:

View File

@ -27,7 +27,8 @@
- hostvars[item]['nodepool']['public_ipv4']
# ipv6_addresses is set by the multi-node-firewall role
- when: ipv6_addresses | length > 0
- name: check ipv6_addresses
when: ipv6_addresses | length > 0
block:
- name: switch and peer nodes should be in the ipv6 firewall
become: yes

View File

@ -79,7 +79,8 @@
with_items: "{{ groups['all'] }}"
# ipv6_addresses is set by the multi-node-firewall role
- when: ipv6_addresses | length > 0
- name: check ipv6_addresses
when: ipv6_addresses | length > 0
block:
- name: switch and peer nodes should be in the ipv6 firewall
become: yes

View File

@ -1,7 +1,8 @@
- hosts: all
pre_tasks:
# Run ensure-output-dirs now as it is not performed speculatively
- import_role:
- name: Run ensure-output-dirs
import_role:
name: ensure-output-dirs
- name: Create fake sphinx output
@ -12,10 +13,12 @@
warn: false
tasks:
- import_role:
- name: Run fetch-sphinx-output
import_role:
name: fetch-sphinx-output
- import_role:
- name: Run fetch-output
import_role:
name: fetch-output
when: zuul_use_fetch_output

View File

@ -1,7 +1,8 @@
- hosts: all
pre_tasks:
# Run ensure-output-dirs now as it is not performed speculatively
- import_role:
- name: Run ensure-output-dirs
import_role:
name: ensure-output-dirs
# This simulates the operation of something like "tox -e docs" in
@ -33,13 +34,15 @@
# {{ ansible_user_dir }}/zuul-output/logs/ and extracted into
# zuul-output/logs/<docs|pdf> on the host. They need to be brought back
# to the executor using fetch-output
- import_role:
- name: Run fetch-sphinx-tarball
import_role:
name: fetch-sphinx-tarball
# This copies files from the remote host;
# - zuul-output/logs is copied into the zuul.executor.log_root
# - zuul-output/<artifacts|docs> is copied into zuul.executor.work_root
- import_role:
- name: Run fetch-output
import_role:
name: fetch-output
when: zuul_use_fetch_output

View File

@ -1,7 +1,8 @@
- hosts: all
pre_tasks:
# Run ensure-output-dirs now as it is not performed speculatively
- import_role:
- name: Run ensure-output-dirs
import_role:
name: ensure-output-dirs
- name: Create fake test directory
@ -48,10 +49,12 @@
- tox
tasks:
- import_role:
- name: Run fetch-subunit-output
import_role:
name: fetch-subunit-output
- import_role:
- name: Run fetch-output
import_role:
name: fetch-output
when: zuul_use_fetch_output

View File

@ -1,7 +1,8 @@
- hosts: all
pre_tasks:
# Run ensure-output-dirs now as it is not performed speculatively
- import_role:
- name: Run ensure-output-dirs
import_role:
name: ensure-output-dirs
- name: Simplify tox config
@ -36,12 +37,14 @@
- tox
tasks:
- import_role:
- name: Run fetch-tox-output
import_role:
name: fetch-tox-output
vars:
tox_envlist: "ALL"
- block:
- name: Fetch the output
block:
- name: Undo the log_path fact set by fetch-javascript-output
set_fact:
log_path: "{{ zuul.executor.log_root }}/{{ inventory_hostname }}"
@ -52,7 +55,8 @@
log_path: "{{ zuul.executor.log_root }}"
when: groups['all'] | length == 1
- import_role:
- name: Run fetch-output
import_role:
name: fetch-output
when: zuul_use_fetch_output

View File

@ -28,7 +28,8 @@
tempfile:
register: default_tempfile
- block:
- name: Run tox
block:
- name: Run tox with empty envlist
include_role:
name: tox
@ -51,7 +52,8 @@
state: absent
path: "{{ default_tempfile.path }}"
- block:
- name: Check testenvs output
block:
- name: Create tempfile to verify testenvs ran
tempfile:
register: ALL_tempfile

View File

@ -1,7 +1,8 @@
- hosts: all
tasks:
- include_role:
- name: Run ensure-rust
include_role:
name: ensure-rust
- name: Test cargo run

View File

@ -1,7 +1,8 @@
- hosts: all
tasks:
- include_role:
- name: Run update-json-file
include_role:
name: update-json-file
vars:
update_json_file_name: some/test.json
@ -11,7 +12,8 @@
moo: boo
update_json_file_debug: true
- include_role:
- name: Run update-json-file again
include_role:
name: update-json-file
vars:
update_json_file_name: some/test.json
@ -32,7 +34,8 @@
set_fact:
_config: "{{ _file.content | b64decode | from_json }}"
- assert:
- name: Check output
assert:
that:
- _config['foo'] == 'bar'
- _config['moo'] == 'boo'