From de455d0d769bd9d17b3a434a1fbe1e7457e9aa7f Mon Sep 17 00:00:00 2001 From: John Byrne Date: Wed, 31 Jul 2024 01:06:09 -0400 Subject: [PATCH] Fix list of non-strings in args rule --- examples/playbooks/rule-args-module-pass.yml | 11 +++++++++++ src/ansiblelint/rules/args.py | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/examples/playbooks/rule-args-module-pass.yml b/examples/playbooks/rule-args-module-pass.yml index 995e4fe0d5..240ee14e6a 100644 --- a/examples/playbooks/rule-args-module-pass.yml +++ b/examples/playbooks/rule-args-module-pass.yml @@ -95,3 +95,14 @@ src: "args.json" action: ansible.builtin.copy args: "{{ copy_vars }}" # since, we're unable to analyze jinja, we skip this kind of checks + + - name: Variable containing list of non-strings should pass (Bug 4229) + community.general.mas: + id: "{{ item }}" + state: present + loop: "{{ mas_app_ids }}" + vars: + mas_app_ids: + - 409183694 + - 409203825 + - 409201541 diff --git a/src/ansiblelint/rules/args.py b/src/ansiblelint/rules/args.py index fb9f9918c4..70449fcf1b 100644 --- a/src/ansiblelint/rules/args.py +++ b/src/ansiblelint/rules/args.py @@ -225,7 +225,7 @@ def _parse_failed_msg( error_message = failed_msg option_type_check_error = re.search( - r"argument '(?P.*)' is of type", + r"(argument|option) '(?P.*)' is of type", error_message, ) if option_type_check_error: