I’ve got an custom module I’m tweaking. It works, but “ansible-lint -vv
” is throwing these messages that I’m trying to understand. I’d really appreciate any help with this.
The ansible-lint
I’m running is
$ ansible-lint --version
ansible-lint 24.9.2 using ansible-core:2.16.9 ansible-compat:24.9.1 ruamel-yaml:0.18.6 ruamel-yaml-clib:0.2.8
Here are the two message in question.
DEBUG Type checking ignored for 'symlink' option in task 'mwsdinstall.py' at line 23.
DEBUG Type checking ignored for 'symlink' option in task 'mwsdinstall.py' at line 71.
Both invocations of that module look like this:
- name: "Invoke mwsdinstall: state: {{ mw_common_sdinstall_state }}; package: {{ mw_common_sdinstall_name }}; version {{ mw_common_sdinstall_version }}" # noqa name[template]
mwsdinstall.py:
state: "{{ mw_common_sdinstall_state }}" # noqa yaml[colons] jinja[spacing]
name: "{{ mw_common_sdinstall_name }}" # noqa yaml[colons]
version: "{{ mw_common_sdinstall_version }}" # noqa yaml[colons]
symlink: "{{ mw_common_sdinstall_symlink }}" # noqa yaml[colons]
symlink_names: "{{[mw_common_sdinstall_symlink_names] | flatten }}" # noqa yaml[colons]
user: "{{ mw_common_sdinstall_user }}" # noqa yaml[colons]
group: "{{ mw_common_sdinstall_group }}" # noqa yaml[colons]
appbase: "{{ mw_common_sdinstall_appbase }}" # noqa yaml[colons]
repobase: "{{ mw_common_sdinstall_repobase }}" # noqa yaml[colons]
pkgage: "{{ mw_common_sdinstall_pkgage }}" # noqa yaml[colons]
fallbacks: "{{ mw_common_sdinstall_fallbacks }}" # noqa yaml[colons]
register: mw_common_sdinstall
{{ mw_common_sdinstall_symlink }}"
is defined in the defaults/main.yml
for this role:
---
# ./defaults/main.yml
mw_common_sdinstall_state: present # noqa yaml[colons]
mw_common_sdinstall_symlink: true # noqa yaml[colons]
mw_common_sdinstall_symlink_names: ['latest'] # noqa yaml[colons]
mw_common_sdinstall_user: "{{ mw_global_ci_usr }}" # noqa yaml[colons]
mw_common_sdinstall_group: "{{ mw_global_ci_grp }}" # noqa yaml[colons]
mw_common_sdinstall_appbase: "{{ mw_global_appbase }}" # noqa yaml[colons]
mw_common_sdinstall_repobase: "{{ mw_global_repobase }}" # noqa yaml[colons]
mw_common_sdinstall_pkgage: .pkg_age # noqa yaml[colons]
mw_common_sdinstall_fallbacks: 3 # noqa yaml[colons]
In the mwsdinstall.py
module itself, the argspec looks like this:
def main():
fields = {
"name": {"type": "str", "required": True},
"version": {"type": "str", "required": True},
"symlink": {"type": "bool", "default": True},
"symlink_names": {"type": "list", "default": ["cur", "-latest"], "elements": "str"},
"user": {"type": "str", "default": "jenkinsci"},
"group": {"type": "str", "default": "middleware"},
"pkgage": {"type": "str", "default": ".pkg_age"},
"fallbacks": {"type": "int", "required": False},
"appbase": {"type": "str", "default": "/opt/local"},
"repobase": {"type": "str", "default": "/middleware/software-deploy"},
"state": {"type": "str", "default": "present", "choices": ["present", "absent", "check"]},
}
module = AnsibleModule(argument_spec=fields, supports_check_mode=True)
I notice that symlink
is the only bool
in my parameters. Is this normal behavior for ansible-lint
, or is something more subtle going on? I’m really stumped.
Thanks.