Looping an Array with Missing Keys in Ansible Tasks I'm attempting to create an Ansible Role to create users... I want it to be able to accept a list of dicts and if a key is missing from the dict, it will fall back to Ansible's default.
For example, given the following data:
---
users:
 - { name: foo, group: bar, create_home: no }
   { name: goo, group: bar }


I'd normally loop over the list with something like:
- name: Add users
  ansible.builtin.user:
    name: &quot;{{ item.name }}&quot;
    groups: &quot;{{ item.group }}&quot;
    create_home: &quot;{{ item.create_home }}&quot;
    state: present
  loop: &quot;{{ users }}&quot;

However, because create_home doesn't exist for the second user, it'd throw an error. How could I get it to fall back to Ansible's default for keys that don't exist?
Q: &quot;How could I get it to fall back to Ansible's default for keys that don't exist?&quot;
A: Omit such parameters, e.g.
    create_home: &quot;{{ item.create_home|default(omit) }}&quot;