Be consistent about spaces before and after vars

With the arrival of ansible-lint 4, Jinja2 variable expansions must
include spaces before and after the variable name inside the
brackets.

Adjust the new violations accordingly and remove the rule
206 exclusion.

Change-Id: Ib3ff7b0233a5d5cf99772f9c2adc81861cf34ffa
This commit is contained in:
Jeremy Stanley 2019-06-26 18:05:08 +00:00 committed by Sorin Sbarnea
parent 4a1ecf50a5
commit 82a99bcb1c
6 changed files with 8 additions and 9 deletions

View File

@ -18,5 +18,5 @@
- name: Fail if we cannot install all packages
fail:
msg: "bindep failed to install from {{ bindep_file}} - {{ bindep_final_check.stdout }}"
msg: "bindep failed to install from {{ bindep_file }} - {{ bindep_final_check.stdout }}"
when: bindep_final_check is failed

View File

@ -1,4 +1,4 @@
- name: Build a tarball and wheel
command: "{{release_python}} setup.py sdist bdist_wheel {{bdist_wheel_xargs}}"
command: "{{ release_python }} setup.py sdist bdist_wheel {{ bdist_wheel_xargs }}"
args:
chdir: "{{ zuul_work_dir }}"

View File

@ -29,7 +29,7 @@
command: >-
ovs-vsctl --may-exist add-port {{ bridge_name }}
{{ bridge_name }}_{{ nodepool_ip }}
-- set interface {{ bridge_name }}_{{ nodepool_ip}}
-- set interface {{ bridge_name }}_{{ nodepool_ip }}
type=vxlan options:remote_ip={{ nodepool_ip }} options:key={{ vni }}
options:local_ip={{ switch_ip }}
delegate_to: "{{ switch }}"

View File

@ -18,7 +18,7 @@
- name: Report no wheels to be uploaded
debug:
msg: "Found no wheels to upload: {{found_wheels.msg}}"
msg: "Found no wheels to upload: {{ found_wheels.msg }}"
when: found_wheels.files == []
- name: Register packages on the PyPI server (via wheels)
@ -38,7 +38,7 @@
- name: Report no tarballs to be uploaded
debug:
msg: "Found no tarballs to upload: {{found_tarballs.msg}}"
msg: "Found no tarballs to upload: {{ found_tarballs.msg }}"
when: found_tarballs.files == []
- name: Register packages on the PyPI server (via tarballs)

View File

@ -15,7 +15,7 @@ zuul
ansible>=2.5.1,<2.6 # https://review.openstack.org/567007
# Don't automatically switch to ansible-lint 5 when it becomes
# available, so that it can be evaluated for an orderly transition.
ansible-lint<5
ansible-lint>=4.1.1a0,<5
bashate>=0.2
stestr>=1.0.0 # Apache-2.0
# For upload-logs-swift:

View File

@ -43,11 +43,10 @@ commands =
# Ansible lint
# [ANSIBLE0012] Commands should not change things if nothing needs doing
# [204] Lines should be no longer than 160 chars
# [206] Variables should have spaces before and after: {{ var_name }}
bash -c "find playbooks -type f -regex '.*.ya?ml' -print0 | \
xargs -t -n1 -0 ansible-lint -xANSIBLE0012,204,206"
xargs -t -n1 -0 ansible-lint -xANSIBLE0012,204"
bash -c 'find roles -maxdepth 1 -mindepth 1 -type d -printf "%p/\n" | \
xargs -t -n1 ansible-lint -xANSIBLE0012,204,206'
xargs -t -n1 ansible-lint -xANSIBLE0012,204'
# Ansible Syntax Check
bash -c "find playbooks -type f -regex '.*.ya?ml' -exec \
ansible-playbook --syntax-check -i {toxinidir}/tests/inventory \{\} + > /dev/null"