From 0bbbe0e9b1b81a97921ace5a4535aa39fa6c2c7e Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Wed, 15 Jan 2020 13:24:49 +1100 Subject: [PATCH] Update ansible-lint I started looking at this because what I thought was an ansible-lint bug is an ansible bug (you can't use a apostrophe in shell comments?!...) Anyway, the ignore numbers have changed and we don't need to enforce pipefail. Otherwise it found some variable typos. [1] https://github.com/ansible/ansible/issues/28674 Change-Id: I35315c82200686841a9b1d4c87c7f27a71bd8931 --- roles/configure-swap/tasks/ephemeral.yaml | 4 ++-- test-requirements.txt | 2 +- tox.ini | 7 ++++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/roles/configure-swap/tasks/ephemeral.yaml b/roles/configure-swap/tasks/ephemeral.yaml index d7e7b844..a294326a 100644 --- a/roles/configure-swap/tasks/ephemeral.yaml +++ b/roles/configure-swap/tasks/ephemeral.yaml @@ -9,8 +9,8 @@ - name: Set partition names set_fact: - swap_partition: "{{ ephemeral_device}}1" - opt_partition: "{{ ephemeral_device}}2" + swap_partition: "{{ ephemeral_device }}1" + opt_partition: "{{ ephemeral_device }}2" - name: Ensure ephemeral device is unmounted become: yes diff --git a/test-requirements.txt b/test-requirements.txt index 1e6cac18..9d68e331 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -6,6 +6,6 @@ hacking>=1.1.0,<1.2 # Apache-2.0 zuul ansible>=2.7.0,<2.8 -ansible-lint<4 +ansible-lint>=4,<=5 bashate>=0.2 zuul-sphinx>=0.2.0 diff --git a/tox.ini b/tox.ini index 31415805..e1bbd3d9 100644 --- a/tox.ini +++ b/tox.ini @@ -32,12 +32,13 @@ setenv = commands = flake8 {posargs} # Ansible lint - # [ANSIBLE0012] Commands should not change things if nothing needs doing + # [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 -xANSIBLE0012" + ansible-lint -x301,306" bash -c 'find roles -maxdepth 1 -mindepth 1 -type d -printf "%p/\n" | \ - xargs -t -n1 ansible-lint -xANSIBLE0012' + xargs -t -n1 ansible-lint -x301,306' # 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"