Skip to content

Loss of item properties on update is complex to work around in ansible #69

@gav-

Description

@gav-

Summary

Updating an existing item with onepassword.connect.generic_item module, results in the loss of properties if those properties are not supplied. This is non-trivial to work around in ansible.

Use cases

It should be possible to update or add a single property to an existing 1password item without the destruction of existing properties. This behaviour should be possible with "fields" or "urls".

Proposed solution

Consider ansible.builtin.user module and how it handles a list of groups, by default the provided list will replace any groups the user is a member of, removing the user from groups not in the list (so far, the same behaviour as generic_item). An optional "append" parameter may be provided to only add the user to groups in the list, and not remove the user from any.

Additional parameters could be used to provide this same functionality to "fields" and "urls" (and any other list-type properties).

Is there a workaround to accomplish this today?

Use onepassword.connect.item_info to read the data first, concatenate with data to be submitted, then submit combined data with onepassword.connect.generic_item task. This is non-trivial in ansible (1password items can be quite complex) and would be better handled in the module.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working as expected. Has never worked before. When it has, use "regression" instead.enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions