diff --git a/.ansible-lint b/.ansible-lint new file mode 100644 index 00000000..ffb8f17f --- /dev/null +++ b/.ansible-lint @@ -0,0 +1,10 @@ +exclude_paths: + - playbooks/legacy +parseable: true +# [301] Commands should not change things if nothing needs doing +# [306] shells with pipe should use pipe +skip_list: + - '301' + - '306' +use_default_rules: true +verbosity: 1 diff --git a/bindep.txt b/bindep.txt deleted file mode 100644 index 116e2bac..00000000 --- a/bindep.txt +++ /dev/null @@ -1,16 +0,0 @@ -# This is a cross-platform list tracking distribution packages needed by tests; -# see http://docs.openstack.org/infra/bindep/ for additional information. - -libffi-devel [test platform:rpm] -libffi-dev [test platform:dpkg] -libssl-dev [platform:dpkg] -openssl-devel [platform:rpm] -python3-dev [compile test platform:dpkg platform:apk] -python3-devel [compile test platform:rpm] -libre2-dev [compile test platform:dpkg] -libre2-4 [platform:ubuntu-bionic] -libre2-3 [platform:debian-stretch] -libre2-1v5 [platform:ubuntu-xenial] -re2-devel [compile test platform:rpm] -re2-dev [platform:apk] -re2 [platform:rpm platform:apk] diff --git a/test-requirements.txt b/test-requirements.txt index 7620e1a6..eccd3da6 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -4,7 +4,6 @@ hacking>=2.0.0,<2.1 # Apache-2.0 -zuul ansible>=2.7.0,<2.8 ansible-lint>=4,<=5 bashate>=0.2 diff --git a/tests/fake-ansible/library/zuul_return.py b/tests/fake-ansible/library/zuul_return.py new file mode 100644 index 00000000..48f8c915 --- /dev/null +++ b/tests/fake-ansible/library/zuul_return.py @@ -0,0 +1,12 @@ +# This is a fake zuul_return to make ansible-lint happy +from ansible.module_utils.basic import AnsibleModule + + +def main(): + return AnsibleModule( + argument_spec=dict( + data=dict(default=None), + path=dict(default=None, type=str), + file=dict(default=None, type=str), + ) + ) diff --git a/tox.ini b/tox.ini index f3008f00..fcbefea6 100644 --- a/tox.ini +++ b/tox.ini @@ -30,18 +30,14 @@ passenv = # see openstack-zuul-jobs-linters job for more information. ANSIBLE_ROLES_PATH setenv = - ANSIBLE_LIBRARY= {envsitepackagesdir}/zuul/ansible/base/library - ANSIBLE_ACTION_PLUGINS = {envsitepackagesdir}/zuul/ansible/base/actiongeneral + ANSIBLE_LIBRARY= {toxinidir}/tests/fake-ansible commands = flake8 {posargs} - # Ansible lint - # [301] Commands should not change things if nothing needs doing - # [306] shells with pipe should use pipe bash -c "find playbooks -type d -name "legacy" -prune -o \ -type f -regex '.*.y[a]ml' -print0 | xargs -t -n1 -0 \ - ansible-lint -x301,306" + ansible-lint" bash -c 'find roles -maxdepth 1 -mindepth 1 -type d -printf "%p/\n" | \ - xargs -t -n1 ansible-lint -x301,306' + xargs -t -n1 ansible-lint' # Ansible Syntax Check bash -c "cd playbooks; find . -type f -regex '.*.y[a]?ml' -exec \ ansible-playbook --syntax-check -i {toxinidir}/tests/inventory \{\} + > /dev/null"