--- - name: home directory file: path: "{{ users[item].home | default('/home/'+item) }}" owner: "{{ item }}" group: "{{ item }}" mode: "{{ users[item].homedir_mode | default(700) }}" state: directory with_items: "{{ users.keys() }}"