Standarise block/when ordering
Newer ansbile-lint finds "when" or "become" statements that are at the end of blocks. Ordering these before the block seems like a very logical thing to do, as we read from top-to-bottom so it's good to see if the block will execute or not. This is a no-op, and just moves the places the newer linter found. Change-Id: If4d1dc4343ea2575c64510e1829c3fe02d6c273f
This commit is contained in:
parent
b2ae863f50
commit
8c6512107c
@ -1,6 +1,7 @@
|
||||
---
|
||||
# Use a block to add become to a set of tasks
|
||||
- name: Add build ssh key
|
||||
become: true
|
||||
block:
|
||||
# Add the authorization first, to take advantage of manage_dir
|
||||
- name: Authorize build key
|
||||
@ -32,4 +33,3 @@
|
||||
mode: 0644
|
||||
owner: "{{ copy_sshkey_target_user }}"
|
||||
force: no
|
||||
become: true
|
||||
|
@ -9,6 +9,7 @@
|
||||
register: _cabal_version
|
||||
|
||||
- name: Install cabal
|
||||
when: _cabal_version.rc != 0
|
||||
block:
|
||||
- name: Ensure copr dnf plugin
|
||||
package:
|
||||
@ -25,7 +26,6 @@
|
||||
name: cabal-install
|
||||
state: present
|
||||
become: true
|
||||
when: _cabal_version.rc != 0
|
||||
|
||||
- name: Check package
|
||||
stat:
|
||||
|
@ -9,6 +9,7 @@
|
||||
register: _stack_version
|
||||
|
||||
- name: Install stack
|
||||
when: _stack_version.rc != 0
|
||||
block:
|
||||
# This package is somehow missing from the requirements of the
|
||||
# published packaged copr repo. See
|
||||
@ -31,4 +32,3 @@
|
||||
|
||||
- name: Setup stack LTS
|
||||
command: "stack {% if lts_version %}--resolver {{ lts_version }}{% endif %} setup"
|
||||
when: _stack_version.rc != 0
|
||||
|
@ -73,6 +73,7 @@
|
||||
extra_args: ""
|
||||
|
||||
- name: Configure dns options if set
|
||||
when: minikube_dns_resolvers|length>0
|
||||
block:
|
||||
- name: Write resolv.conf
|
||||
template:
|
||||
@ -82,7 +83,6 @@
|
||||
- name: Set extra kube setttings
|
||||
set_fact:
|
||||
extra_args: "--extra-config=kubelet.resolv-conf={{ ansible_user_dir }}/.minikube/k8s_resolv.conf"
|
||||
when: minikube_dns_resolvers|length>0
|
||||
|
||||
# See https://github.com/kubernetes/minikube/issues/14410
|
||||
- name: Setup cri-dockerd
|
||||
|
@ -8,6 +8,8 @@
|
||||
become: yes
|
||||
|
||||
- name: Install pip
|
||||
become: yes
|
||||
when: ensure_pip_from_packages_with_python2
|
||||
block:
|
||||
- name: Check for EPEL repository
|
||||
stat:
|
||||
@ -32,5 +34,3 @@
|
||||
- python-wheel
|
||||
state: present
|
||||
enablerepo: epel
|
||||
become: yes
|
||||
when: ensure_pip_from_packages_with_python2
|
||||
|
@ -13,6 +13,7 @@
|
||||
register: _shake_version
|
||||
|
||||
- name: Install shake
|
||||
when: "_shake_version.rc != 0"
|
||||
block:
|
||||
- name: Include OS-specific variables
|
||||
include_vars: "{{ zj_distro_os }}"
|
||||
@ -29,4 +30,3 @@
|
||||
name: "{{ shake_packages }}"
|
||||
state: present
|
||||
become: yes
|
||||
when: "_shake_version.rc != 0"
|
||||
|
@ -12,6 +12,7 @@
|
||||
when: register_twine.rc == 0
|
||||
|
||||
- name: Ensure twine is installed
|
||||
when: register_twine.rc != 0
|
||||
block:
|
||||
- name: Ensure twine is installed
|
||||
command: "{{ twine_python }} -m pip install twine!=1.12.0 requests-toolbelt!=0.9.0 --user"
|
||||
@ -19,4 +20,3 @@
|
||||
- name: Set pypi_twine_executable
|
||||
set_fact:
|
||||
pypi_twine_executable: ~/.local/bin/twine
|
||||
when: register_twine.rc != 0
|
||||
|
@ -10,6 +10,7 @@
|
||||
- skip_ansible_lint
|
||||
|
||||
- name: Return artifacts
|
||||
when: not zuul_use_fetch_output
|
||||
block:
|
||||
- name: Ensure artifacts directory exists
|
||||
file:
|
||||
@ -26,4 +27,3 @@
|
||||
verify_host: true
|
||||
owner: no
|
||||
group: no
|
||||
when: not zuul_use_fetch_output
|
||||
|
@ -10,6 +10,7 @@
|
||||
warn: false
|
||||
|
||||
- name: Fetch HTML
|
||||
when: not zuul_use_fetch_output
|
||||
block:
|
||||
- name: Fetch archive HTML
|
||||
synchronize:
|
||||
@ -35,9 +36,9 @@
|
||||
remote_src: true
|
||||
extra_opts:
|
||||
- "--no-same-owner"
|
||||
when: not zuul_use_fetch_output
|
||||
|
||||
- name: Copy HTML
|
||||
when: zuul_use_fetch_output
|
||||
block:
|
||||
- name: Copy archive HTML
|
||||
copy:
|
||||
@ -59,7 +60,6 @@
|
||||
remote_src: true
|
||||
extra_opts:
|
||||
- "--no-same-owner"
|
||||
when: zuul_use_fetch_output
|
||||
|
||||
- name: Return artifact to Zuul
|
||||
zuul_return:
|
||||
|
@ -4,6 +4,7 @@
|
||||
register: translation_files
|
||||
|
||||
- name: Collection translation files
|
||||
when: translation_files.stat.exists
|
||||
block:
|
||||
- name: Collect translation source files
|
||||
synchronize:
|
||||
@ -22,4 +23,3 @@
|
||||
mode: 0755
|
||||
remote_src: true
|
||||
when: zuul_use_fetch_output
|
||||
when: translation_files.stat.exists
|
||||
|
@ -80,6 +80,8 @@
|
||||
when: extensions_to_txt is defined and extensions_to_txt is not none
|
||||
|
||||
- name: Collect log files
|
||||
when:
|
||||
- stage_compress_logs
|
||||
block:
|
||||
- name: Discover log files for compression
|
||||
find:
|
||||
@ -104,5 +106,3 @@
|
||||
loop_var: zj_log_file
|
||||
tags:
|
||||
- skip_ansible_lint
|
||||
when:
|
||||
- stage_compress_logs
|
||||
|
@ -32,6 +32,7 @@
|
||||
register: upload_results
|
||||
|
||||
- name: Return log URL
|
||||
when: upload_results is defined
|
||||
block:
|
||||
- name: Return log URL to Zuul
|
||||
delegate_to: localhost
|
||||
@ -42,4 +43,3 @@
|
||||
- name: Print upload failures
|
||||
debug:
|
||||
var: upload_results.upload_failures
|
||||
when: upload_results is defined
|
||||
|
@ -32,6 +32,7 @@
|
||||
register: upload_results
|
||||
|
||||
- name: Return logs
|
||||
when: upload_results is defined
|
||||
block:
|
||||
- name: Return log URL to Zuul
|
||||
delegate_to: localhost
|
||||
@ -42,4 +43,3 @@
|
||||
- name: Print upload failures
|
||||
debug:
|
||||
var: upload_results.upload_failures
|
||||
when: upload_results is defined
|
||||
|
@ -26,6 +26,9 @@
|
||||
mode: 0644
|
||||
|
||||
- name: Run zuul_debug_info and collect output
|
||||
when:
|
||||
- ansible_os_family != "Windows"
|
||||
- ansible_python_version is version('2.7', '>=')
|
||||
block:
|
||||
- name: Collect information about zuul worker
|
||||
zuul_debug_info:
|
||||
@ -42,7 +45,3 @@
|
||||
dest: "{{ zuul_info_dir }}/zuul-info.{{ validate_host_hostname_sanitized }}.txt"
|
||||
src: templates/zuul-info.j2
|
||||
mode: 0644
|
||||
|
||||
when:
|
||||
- ansible_os_family != "Windows"
|
||||
- ansible_python_version is version('2.7', '>=')
|
||||
|
Loading…
Reference in New Issue
Block a user