Ansible logoAnsible/
ANS-E9002

Found key duplicationANS-E9002

Major severityMajor
Bug Risk categoryBug Risk

Avoid multiple entries with the same key in mappings.

Bad practice

In the example below, the name key has been duplicated:

- name: restart webserver
  service:
    name: httpd
    state: restarted
    name: httpd          # duplication of `name` key

Remove duplicate keys, if any.

- name: restart webserver
  service:
    name: httpd
    state: restarted