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. For special cases we can have use inline excludes. Change-Id: Ib3ff7b0233a5d5cf99772f9c2adc81861cf34ffa
This commit is contained in:
parent
a0b390936f
commit
2b21dac369
|
@ -18,5 +18,5 @@
|
||||||
|
|
||||||
- name: Fail if we cannot install all packages
|
- name: Fail if we cannot install all packages
|
||||||
fail:
|
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
|
when: bindep_final_check is failed
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
- name: Build a tarball and wheel
|
- 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:
|
args:
|
||||||
chdir: "{{ zuul_work_dir }}"
|
chdir: "{{ zuul_work_dir }}"
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
command: >-
|
command: >-
|
||||||
ovs-vsctl --may-exist add-port {{ bridge_name }}
|
ovs-vsctl --may-exist add-port {{ bridge_name }}
|
||||||
{{ bridge_name }}_{{ nodepool_ip }}
|
{{ 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 }}
|
type=vxlan options:remote_ip={{ nodepool_ip }} options:key={{ vni }}
|
||||||
options:local_ip={{ switch_ip }}
|
options:local_ip={{ switch_ip }}
|
||||||
delegate_to: "{{ switch }}"
|
delegate_to: "{{ switch }}"
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
- name: Set up the host ip addresses
|
- name: Set up the host ip addresses
|
||||||
set_fact:
|
set_fact:
|
||||||
ipv4_addresses: >
|
ipv4_addresses: > # noqa 206
|
||||||
{% set hosts = [] -%}
|
{% set hosts = [] -%}
|
||||||
{% for host, vars in hostvars.items() -%}
|
{% for host, vars in hostvars.items() -%}
|
||||||
{% if vars['nodepool']['private_ipv4'] -%}
|
{% if vars['nodepool']['private_ipv4'] -%}
|
||||||
|
@ -16,7 +16,7 @@
|
||||||
{% endif -%}
|
{% endif -%}
|
||||||
{% endfor -%}
|
{% endfor -%}
|
||||||
{{- hosts | sort | unique -}}
|
{{- hosts | sort | unique -}}
|
||||||
ipv6_addresses: >
|
ipv6_addresses: > # noqa 206
|
||||||
{% set hosts = [] -%}
|
{% set hosts = [] -%}
|
||||||
{% for host, vars in hostvars.items() -%}
|
{% for host, vars in hostvars.items() -%}
|
||||||
{% if vars['nodepool']['public_ipv6'] -%}
|
{% if vars['nodepool']['public_ipv6'] -%}
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
|
|
||||||
- name: Report no wheels to be uploaded
|
- name: Report no wheels to be uploaded
|
||||||
debug:
|
debug:
|
||||||
msg: "Found no wheels to upload: {{found_wheels.msg}}"
|
msg: "Found no wheels to upload: {{ found_wheels.msg }}"
|
||||||
when: found_wheels.files == []
|
when: found_wheels.files == []
|
||||||
|
|
||||||
- name: Register packages on the PyPI server (via wheels)
|
- name: Register packages on the PyPI server (via wheels)
|
||||||
|
@ -38,7 +38,7 @@
|
||||||
|
|
||||||
- name: Report no tarballs to be uploaded
|
- name: Report no tarballs to be uploaded
|
||||||
debug:
|
debug:
|
||||||
msg: "Found no tarballs to upload: {{found_tarballs.msg}}"
|
msg: "Found no tarballs to upload: {{ found_tarballs.msg }}"
|
||||||
when: found_tarballs.files == []
|
when: found_tarballs.files == []
|
||||||
|
|
||||||
- name: Register packages on the PyPI server (via tarballs)
|
- name: Register packages on the PyPI server (via tarballs)
|
||||||
|
|
|
@ -15,7 +15,7 @@ zuul
|
||||||
ansible>=2.5.1,<2.6 # https://review.openstack.org/567007
|
ansible>=2.5.1,<2.6 # https://review.openstack.org/567007
|
||||||
# Don't automatically switch to ansible-lint 5 when it becomes
|
# Don't automatically switch to ansible-lint 5 when it becomes
|
||||||
# available, so that it can be evaluated for an orderly transition.
|
# available, so that it can be evaluated for an orderly transition.
|
||||||
ansible-lint<5
|
ansible-lint>=4.1.1a0,<5
|
||||||
bashate>=0.2
|
bashate>=0.2
|
||||||
stestr>=1.0.0 # Apache-2.0
|
stestr>=1.0.0 # Apache-2.0
|
||||||
# For upload-logs-swift:
|
# For upload-logs-swift:
|
||||||
|
|
5
tox.ini
5
tox.ini
|
@ -43,11 +43,10 @@ commands =
|
||||||
# Ansible lint
|
# Ansible lint
|
||||||
# [ANSIBLE0012] Commands should not change things if nothing needs doing
|
# [ANSIBLE0012] Commands should not change things if nothing needs doing
|
||||||
# [204] Lines should be no longer than 160 chars
|
# [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 | \
|
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" | \
|
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
|
# Ansible Syntax Check
|
||||||
bash -c "find playbooks -type f -regex '.*.ya?ml' -exec \
|
bash -c "find playbooks -type f -regex '.*.ya?ml' -exec \
|
||||||
ansible-playbook --syntax-check -i {toxinidir}/tests/inventory \{\} + > /dev/null"
|
ansible-playbook --syntax-check -i {toxinidir}/tests/inventory \{\} + > /dev/null"
|
||||||
|
|
Loading…
Reference in New Issue