Run ansible-lint on repo

This change follows  I16186c929e7d0e6e34b35271559e555255a52b00 to run
openstack-zuul-jobs-linters on the repository.

Also, silence remaining lint role.

Depends-On: I46c53229f878fc707bab627654d820b891d9f625
Change-Id: I76abf21ea51c5f7553639475e408e06768fb1016
This commit is contained in:
Andreas Jaeger 2017-10-27 07:17:19 +02:00
parent 6a278c011c
commit 7c4734f398
3 changed files with 13 additions and 5 deletions

View File

@ -5,6 +5,9 @@
cp *.tgz dist/{{ zuul.project.short_name }}-latest.tar.gz cp *.tgz dist/{{ zuul.project.short_name }}-latest.tar.gz
args: args:
chdir: "{{ zuul_work_dir }}" chdir: "{{ zuul_work_dir }}"
tags:
# Ignore ANSIBLE0007: No need to use file module instead of mkdir
- skip_ansible_lint
- name: Ensure artifacts directory exists - name: Ensure artifacts directory exists
file: file:

View File

@ -9,5 +9,3 @@ ansible<2.4
ansible-lint ansible-lint
bashate>=0.2 bashate>=0.2
zuul-sphinx>=0.1.1 zuul-sphinx>=0.1.1
# Zuul is required to supply the zuul ansible modules for ansible-lint
-e git://git.openstack.org/openstack-infra/zuul@feature/zuulv3#egg=zuul

13
tox.ini
View File

@ -22,12 +22,19 @@ commands = bindep test
commands = python setup.py build_sphinx commands = python setup.py build_sphinx
[testenv:linters] [testenv:linters]
setenv = passenv =
ANSIBLE_CONFIG = {toxinidir}/tests/ansible.cfg # NOTE(pabelanger): if you'd like to run tox -elinters locally, you'll need
ANSIBLE_LIBRARY= {envdir}/src/zuul/zuul/ansible/library # to export ANSIBLE_ROLES_PATH pointing to the currect repos.
# see infra-zuul-jobs-linters job for more information.
ANSIBLE_ROLES_PATH
whitelist_externals = bash whitelist_externals = bash
commands = commands =
flake8 {posargs} flake8 {posargs}
# Ansible lint
# [ANSIBLE0012] Commands should not change things if nothing needs doing
bash -c "find playbooks -type d -name "legacy" -prune -o \
-type f -regex '.*.y[a]ml' -print0 | xargs -t -n1 -0 \
ansible-lint -xANSIBLE0012"
# Ansible Syntax Check # Ansible Syntax Check
bash -c "find playbooks -type f -regex '.*.y[a]?ml' -print0 | xargs -n1 -0 \ bash -c "find playbooks -type f -regex '.*.y[a]?ml' -print0 | xargs -n1 -0 \
ansible-playbook --syntax-check -i tests/inventory 1>/dev/null" ansible-playbook --syntax-check -i tests/inventory 1>/dev/null"