diff --git a/.zuul.yaml b/.zuul.yaml index 7770dda..3556ebc 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -196,9 +196,11 @@ - metalsmith-integration-glance-centos8-legacy - metalsmith-integration-glance-netboot-cirros - metalsmith-integration-http-netboot-cirros + - openstack-tox-linters gate: jobs: - metalsmith-integration-glance-centos8-uefi - metalsmith-integration-glance-centos8-legacy - metalsmith-integration-glance-netboot-cirros - metalsmith-integration-http-netboot-cirros + - openstack-tox-linters diff --git a/playbooks/integration/centos8-integration.yaml b/playbooks/integration/centos8-integration.yaml index 0f0a8a6..ac063d8 100644 --- a/playbooks/integration/centos8-integration.yaml +++ b/playbooks/integration/centos8-integration.yaml @@ -1,6 +1,6 @@ --- - name: Perform initial setup - include: initial-setup.yaml + import_playbook: initial-setup.yaml - hosts: all environment: diff --git a/playbooks/integration/run.yaml b/playbooks/integration/run.yaml index 61f44aa..e68cea0 100644 --- a/playbooks/integration/run.yaml +++ b/playbooks/integration/run.yaml @@ -1,6 +1,6 @@ --- - name: Perform initial setup - include: initial-setup.yaml + import_playbook: initial-setup.yaml - hosts: all environment: diff --git a/tools/ansible-lint.sh b/tools/ansible-lint.sh new file mode 100644 index 0000000..88eb664 --- /dev/null +++ b/tools/ansible-lint.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +set -euxo pipefail + +find playbooks -maxdepth 1 -type f -regex '.*.ya?ml' -print0 | \ + xargs -t -n1 -0 ansible-lint -x metadata -vv --nocolor +find roles -maxdepth 1 -mindepth 1 -type d -printf "%p/\n" | \ + xargs -t -n1 ansible-lint -x metadata -vv --nocolor diff --git a/tox.ini b/tox.ini index 905aeb5..bbcf802 100644 --- a/tox.ini +++ b/tox.ini @@ -92,3 +92,12 @@ application-import-names = metalsmith # [H210] Require 'autospec', 'spec', or 'spec_set' in mock.patch/mock.patch.object calls # [H904] Delay string interpolations at logging calls. enable-extensions=H106,H203,H204,H205,H210,H904 + +[testenv:linters] +usedevelop = False +allowlist_externals = bash +deps = + ansible>=5,<6 + ansible-lint>=5,<6 +commands = + bash tools/ansible-lint.sh \ No newline at end of file