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:
parent
829297c37a
commit
8e812f1eb4
2
tests/inventory
Normal file
2
tests/inventory
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
[all]
|
||||||
|
localhost
|
3
tox.ini
3
tox.ini
@ -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}
|
||||||
|
Loading…
Reference in New Issue
Block a user