fqcn-builtins: Use FQCN for builtin actions in Ansible playbook

Viewed 6510

I am working on Automatic deployment using ansible and helm chart. When i try to run my ansible playbook and before that i am trying to find the linting of my ansibles roles. I have cleared most of the warnings which raised during the ansible lint test.

But I don't understand "fqcn-builtins: Use FQCN for builtin actions" . Can anyone tell me how to resolve this issue and I could see in almost all of my playbook.

fqcn-builtins: Use FQCN for builtin actions.
main.yml:43 Task/Handler: Remove local image
fqcn-builtins: Use FQCN for builtin actions.
main.yml:48 Task/Handler: output message
fqcn-builtins: Use FQCN for builtin actions.
main.yml:64 Task/Handler: Remove local image
fqcn-builtins: Use FQCN for builtin actions.
main.yml:69 Task/Handler: output message
fqcn-builtins: Use FQCN for builtin actions.
main.yml:85 Task/Handler: Remove local image
fqcn-builtins: Use FQCN for builtin actions.
main.yml:90 Task/Handler: output message
fqcn-builtins: Use FQCN for builtin actions.

Sample playbook from my file

- name: Remove local image
  shell: docker image rm {{ image.docker_image_main }}:{{ imageTag }}
  register: imagedelete
  changed_when: "'untagged' in imagedelete.stdout"
  # noqa command-instead-of-shell
- name: output message
  debug:
    msg: "{{ imagedelete.stdout }}"
  become: "yes"

Image from the pipeline

2 Answers

FQCN stands for "fully qualified collection name". You need to specify the fully qualified collection name in ansilbe playbook.

In your examples, you are using the "shell" module whose FQCN is ansible.builtin.shell.

In you playbook , you need add ansible.builtin.shell instead of shell

Starting from ansible-lint 6, this rule is implicit by default.

You can opt-out of this behavior by creating an .ansible-lint file (if not already present) and adding the content below

skip_list:
  - 'fqcn-builtins'

Another alternative is to use a specific version of ansible-lint (5.x) until you're ready to upgrade,

Related