Ansible

Ansible

Made by DeepSource

Found key duplication ANS-E9002

Bug risk
Major

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

Recommended

Remove duplicate keys, if any.

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