Ansible-lint shouting about apt state:latest

❯ ansible-lint --version
ansible-lint 24 using ansible-core:2.16.12 ansible-compat:24.9.0 ruamel-yaml:0.18.5 ruamel-yaml-clib:0.2.7

Is there a way to acknowledge the warning of using state:latest without using only_upgrade flag ?

using this as a full system upgrade command which wasn’t explored in the linter webpage, but is the recommended way to do full system upgrade in ansible doc

You can skip this check, eg in .ansible-lint:

---
skip_list:
  - package-latest

Or just for the one task:

- name: Latest foo present  # noqa package-latest
  apt:
    pkg:
      - foo
    state: latest
2 Likes

Yes.
In the configuration file for ansible-lint:

$ cat .config/ansible-lint.yml
---
skip_list
  - package-latest

Or at task level with noqa:

    - name: Install.
    # noqa: package-latest
      ansible.builtin.apt:
        name: apache2
        state: latest
3 Likes

Thank you for the answers!

2 Likes