Ensure we load roles for linting

Did didn't have ansible-lint setup properly, as a results our roles
weren't actually linted properly.

Switch run-docs to command task, since we are not using any shell
variables.

Ignore ANSIBLE0012 for now.

Change-Id: Id184f7eb5dd67117e7dde9c8eb38a3a8af9dd892
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
This commit is contained in:
Paul Belanger 2017-07-14 16:51:59 -04:00
parent 6a8e17bf61
commit c0c9653ab5
No known key found for this signature in database
GPG Key ID: 611A80832067AF38
3 changed files with 9 additions and 2 deletions

View File

@ -1,4 +1,4 @@
- name: Execute run-docs.sh. - name: Execute run-docs.sh.
shell: "/usr/local/jenkins/slave_scripts/run-docs.sh {{ tox_envlist }}" command: "/usr/local/jenkins/slave_scripts/run-docs.sh {{ tox_envlist }}"
args: args:
chdir: "{{ zuul_work_dir }}" chdir: "{{ zuul_work_dir }}"

2
tests/ansible.cfg Normal file
View File

@ -0,0 +1,2 @@
[defaults]
roles_path = ../roles

View File

@ -21,11 +21,16 @@ commands = bindep test
commands = python setup.py build_sphinx commands = python setup.py build_sphinx
[testenv:pep8] [testenv:pep8]
setenv =
ANSIBLE_CONFIG = {toxinidir}/tests/ansible.cfg
whitelist_externals = bash whitelist_externals = bash
commands = commands =
flake8 {posargs} flake8 {posargs}
# Ansible Lint Check
# NOTE(pabelanger): Ignore the following checks:
# ANSIBlE0012: Commands should not change things if nothing needs doing
bash -c "cd playbooks; find . -type f -regex '.*.y[a]?ml' -print0 | xargs -t -n1 -0 \ bash -c "cd playbooks; find . -type f -regex '.*.y[a]?ml' -print0 | xargs -t -n1 -0 \
ansible-lint" ansible-lint -x ANSIBLE0012"
[testenv:venv] [testenv:venv]
commands = {posargs} commands = {posargs}