ansible-onepasswordconnect-collection icon indicating copy to clipboard operation
ansible-onepasswordconnect-collection copied to clipboard

field_info module: Change the `flatten_fields_by_label` default to `false`

Open verkaufer opened this issue 3 years ago • 0 comments

As noted in the release notes for v2.2.0, the flatten_fields_by_label option should default to false beginning with the next major version.

What this means

The fields key in the returned op_item dictionary will return a list instead of a nested dictionary. Fields with identical labels will not be de-duplicated. Users can opt to keep the behavior by setting the flatten_fields_by_label argument to yes

Example:

---
# Omitting `flatten_fields_by_label` => the `fields` key is a dict, non-unique field labels may overwrite each other
- name: Find and return Item details for "Dev-Database" 
  onepassword.connect.item_info:
    item: Dev-Database
    vault: 2zbeu4smcibizsuxmyvhdh57b6

# Set `flatten_fields_by_label` to false => fields are returned as a list, duplicate labels not removed
- name: Find and return Item details for "Dev-Database" - not flattened
  onepassword.connect.item_info:
    item: Dev-Database
    vault: 2zbeu4smcibizsuxmyvhdh57b6
    flatten_fields_by_label: false

verkaufer avatar Jan 19 '22 18:01 verkaufer