There are a few issues with this:
First I think the command can only be on a separate line from ansible.builtin.command if it is followed with a | or > (or |- or >-, see this Stackoverflow comment for more details), eg:
- name: Set IPv6 IID token
ansible.builtin.command: >
nmcli con mod enX0 ipv6.token ::"CHANGEME"
Or:
- name: Set IPv6 IID token
ansible.builtin.command: |
nmcli con mod enX0 ipv6.token ::"CHANGEME"
However you are best using cmd, like this:
- name: Set IPv6 IID token
ansible.builtin.command:
cmd: nmcli con mod enX0 ipv6.token ::"CHANGEME"
The “conflicting action statements” is because of change_when, this should be changed_when (see the documentation) and it should either be a boolean, or evaluate to a boolean:
- name: Set IPv6 IID token
ansible.builtin.command:
cmd: nmcli con mod enX0 ipv6.token ::"CHANGEME"
changed_when: true
become: true
If you don’t want the task to run each time and if there is a way to get the existing value then you could update the task to only run when the token needs changing? Or if it should only run once:
- name: Set IPv6 IID token
ansible.builtin.command:
cmd: nmcli con mod enX0 ipv6.token ::"CHANGEME"
run_once: true
become: true
It sounds like you need to simply ensure that ansible-lint ignores the state being set to latest since that is what you want?
- name: Update all packages # noqa: package-latest
ansible.builtin.dnf:
name: '*'
state: latest
become: true