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: I2f4e3f617922c8578adb53e2c4a418488fcf230b Signed-off-by: Paul Belanger <pabelanger@redhat.com>
This commit is contained in:
parent
c0c9653ab5
commit
ea35d7ffc9
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