Include ansible-playbook syntax-check for tox pep8

Syntax check our playbooks / roles when we run pep8. This way we can
quickly tests if our playbooks are valid.

Change-Id: Id9b44216820a2b0702e1cfa46cd7603c89ed40d3
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
This commit is contained in:
Paul Belanger 2017-07-17 16:53:55 -04:00
parent 829297c37a
commit 8e812f1eb4
No known key found for this signature in database
GPG Key ID: 611A80832067AF38
2 changed files with 5 additions and 0 deletions

2
tests/inventory Normal file
View File

@ -0,0 +1,2 @@
[all]
localhost

View File

@ -31,6 +31,9 @@ commands =
# ANSIBlE0012: Commands should not change things if nothing needs doing # 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 -x ANSIBLE0012" ansible-lint -x ANSIBLE0012"
# Ansible Syntax Check
bash -c "find playbooks -type f -regex '.*.y[a]?ml' -print | xargs -t -n1 \
ansible-playbook --syntax-check -i tests/inventory > /dev/null"
[testenv:venv] [testenv:venv]
commands = {posargs} commands = {posargs}