From ea35d7ffc9fab16536695549c8714c6f5c34f55b Mon Sep 17 00:00:00 2001 From: Paul Belanger Date: Fri, 14 Jul 2017 17:02:05 -0400 Subject: [PATCH] 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 --- tests/inventory | 2 ++ tox.ini | 3 +++ 2 files changed, 5 insertions(+) create mode 100644 tests/inventory diff --git a/tests/inventory b/tests/inventory new file mode 100644 index 00000000..68b2dac3 --- /dev/null +++ b/tests/inventory @@ -0,0 +1,2 @@ +[all] +localhost diff --git a/tox.ini b/tox.ini index f4086d9c..5c8a2282 100644 --- a/tox.ini +++ b/tox.ini @@ -31,6 +31,9 @@ commands = # 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 \ 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] commands = {posargs}