Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onepassword.connect.generic_item state=absent task fails if item is present #70

Open
gav- opened this issue Oct 11, 2022 · 1 comment
Open
Labels
bug Something isn't working

Comments

@gav-
Copy link

gav- commented Oct 11, 2022

Your environment

Collection Version: 2.2.1

Connect Server Version: 1.5.7

OS: Ubuntu 20.04

Ansible Version:
ansible==5.9.0
ansible-core==2.12.7

What happened?

Running onepassword.connect.generic_item module as a task, with state=absent returns FAILED when the item is present in the 1Password vault. The item is correctly deleted however. The error is the same if either "title" or "uuid" parameters are used. No error is returned if the item is not present in the vault.

What did you expect to happen?

Ansible should complete the task as 'ok'

Steps to reproduce

  1. Make sure that "myitem" is in the 1Password vault
  2. Simple ansible task to delete "myitem" from 1Password vault:
- name: Ensure myitem is NOT in 1password Ansible vault
  onepassword.connect.generic_item:
    hostname: '{{ onepassword_connect_host }}'
    token: '{{ onepassword_connect_token }}'
    vault_id: '{{ onepassword_vault_id }}'
    title: myitem
    state: absent
  connection: local
  register: op_item
  1. Ansible returns:
TASK [onepassword : Ensure myitem is NOT in 1password Ansible vault] ***************************************************************************************
fatal: [localhost]: FAILED! => {"changed": false, "msg": "OK (unknown bytes)", "op_item": {}}
@gav- gav- added the bug Something isn't working label Oct 11, 2022
@alexbartok
Copy link
Contributor

I've submitted PR #82 yesterday to fix this. @gav- : until it gets merged, you could hack the patch into your local instance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants