From 786f891749c40973d3b41ce2585cf9202548cb66 Mon Sep 17 00:00:00 2001 From: Riccardo Pittau Date: Tue, 29 Nov 2022 11:18:35 +0100 Subject: [PATCH] Use ansible 6.x Use tags instead of numerical ids for better compatibility with latest ansible-lint versions. Change-Id: I87431617eacf380aada94c5c3ed534476ddfb1ce --- .ansible-lint | 29 +++++++++++++++++++++-------- scripts/env-setup.sh | 2 +- tox.ini | 4 ++-- 3 files changed, 24 insertions(+), 11 deletions(-) diff --git a/.ansible-lint b/.ansible-lint index 962ed2b61..e22f34a27 100644 --- a/.ansible-lint +++ b/.ansible-lint @@ -1,11 +1,24 @@ skip_list: # FIXME: gradually fix and remove these exclusions: - - '208' # File permissions not mentioned - - '301' # Commands should not change things if nothing needs doing - - '502' # All tasks should be named - - '701' # meta/main.yml should contain relevant info - - '702' # Tags must contain lowercase letters and digits only + - deprecated-module # Deprecated module + - fqcn[action-core] # Use FQCN for builtin actions + - jinja[spacing] # Jinja2 spacing could be improved + - meta-no-info # meta/main.yml should contain relevant info + - meta-no-tags # Tags must contain lowercase letters and digits only + - name[casing] #All names should start with an uppercase letter + - name[missing] # All tasks should be named + - name[play] # All plays should be named + - name[template] # Jinja templates should only be at the end of 'name' + - no-changed-when # Commands should not change things if nothing needs doing + - yaml[colons] # Too many spaces after colon + - yaml[comments] # Missing starting space in comment + - yaml[empty-lines] # Too many blank lines + - yaml[indentation] # Wrong indentation + - yaml[line-length] # Line too long + - yaml[truthy] # Truthy value should be one of [false, true] + # NOTE(dtantsur): the following rules should likely stay excluded: - - '106' # Role name {} does not match ``^[a-z][a-z0-9_]+$`` pattern' - - '403' # Package installs should not use latest - - '503' # Tasks that run when changed should likely be handlers + - experimental + - role-name # Role name {} does not match ``^[a-z][a-z0-9_]+$`` pattern' + - package-latest # Package installs should not use latest + - no-handler # Tasks that run when changed should likely be handlers diff --git a/scripts/env-setup.sh b/scripts/env-setup.sh index dd1da0563..06a32af46 100755 --- a/scripts/env-setup.sh +++ b/scripts/env-setup.sh @@ -6,7 +6,7 @@ set -euo pipefail # NOTE(pas-ha) the above exports some useful variables like # $PYTHON , $PIP and $VENV depending on venv install or not -DEFAULT_PIP_ANSIBLE='>=5,<6' +DEFAULT_PIP_ANSIBLE='>=6,<7' ANSIBLE_COLLECTIONS_REQ=${ANSIBLE_COLLECTIONS_REQ:-$(dirname $0)/../ansible-collections-requirements.yml} ANSIBLE_COLLECTION_SOURCE_PATH= diff --git a/tox.ini b/tox.ini index 45ae35190..7c2d488ab 100644 --- a/tox.ini +++ b/tox.ini @@ -80,7 +80,7 @@ filename = *.py usedevelop = False allowlist_externals = bash deps = - ansible>=5,<6 - ansible-lint>=5,<6 + ansible>=6,<7 + ansible-lint>=6,<7 commands = bash tools/ansible-lint.sh