From 5a2c7bff96768b77bf4998eb363b1273fbc3b722 Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Tue, 26 Jul 2022 20:47:16 +1000 Subject: [PATCH] linters: update to ansible-lint 6 This updates to ansible-lint 6. Some prior changes have updated for the bulk of the rules, a couple of noqa points are added here. Some updates to the skipped rules are added. This should have no operational change, the only updates are cosmetic. Change-Id: I165677bbb904f92292df00f7b9b27f8f3573aeb0 --- .ansible-lint | 7 +++++++ linters-requirements.txt | 2 +- roles/stage-output/tasks/main.yaml | 4 ++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.ansible-lint b/.ansible-lint index 7e6ec25ac..70a52f711 100644 --- a/.ansible-lint +++ b/.ansible-lint @@ -5,6 +5,9 @@ skip_list: - no-changed-when # Commands should not change things if nothing needs doing - no-tabs # Most files should not contain tabs - role-name # Role name does not match ``^[a-z][a-z0-9_]+$`` pattern + - fqcn-builtins # It would probably be good to enforce this, but it's a lot + - risky-file-permissions # It would probably also good to enforce this if someone wants to look at them + - schema # This is a stricter form of schema per https://github.com/ansible/schemas. might also be good if someone has motivation? use_default_rules: true verbosity: 1 mock_modules: @@ -14,3 +17,7 @@ loop_var_prefix: zj_ # Enable rules that are disabled by default: enable_list: - no-same-owner + +# Local variables: +# mode: yaml +# End: diff --git a/linters-requirements.txt b/linters-requirements.txt index 48969c340..1f4c157a1 100644 --- a/linters-requirements.txt +++ b/linters-requirements.txt @@ -3,4 +3,4 @@ ansible>=2.9,<2.11 # required by ansible-lint flake8 yamllint>=1.23.0 -ansible-lint>=5.0.0,<6.0.0 +ansible-lint>6.0.0,<7.0.0 diff --git a/roles/stage-output/tasks/main.yaml b/roles/stage-output/tasks/main.yaml index d3681c1f5..b5cbd30b0 100644 --- a/roles/stage-output/tasks/main.yaml +++ b/roles/stage-output/tasks/main.yaml @@ -29,6 +29,8 @@ {{- extensions -}} - name: Build the extensions regular expression + # https://github.com/ansible/ansible-lint/issues/2241 + # noqa var-spacing set_fact: extensions_regex: "^(.*)\\.({{ extension_list | join('|') }})$" @@ -122,6 +124,8 @@ # gzip will however return 1 if any compressed file is encountered, so we # must ignore that (there's no specific error code). - name: Archive everything from logs + # https://github.com/ansible/ansible-lint/issues/2241 + # noqa var-spacing shell: gzip --recursive --best {{ zj_log_file.path }} || true args: chdir: "{{ stage_dir }}/logs"