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_raw; V2 (general 6.0.0); domain was not defined in configuration. #5506

Closed
1 task done
prashantsomashekar opened this issue Nov 8, 2022 · 9 comments · Fixed by #5511
Closed
1 task done
Labels
bug This issue/PR relates to a bug has_pr

Comments

@prashantsomashekar
Copy link

Summary

Hi.

I have just upgraded to General 6.0.0 which includes support for 1Password V2.

The same Ansible configuration from v1 throws:
"An unhandled exception occurred while running the lookup plugin 'community.general.onepassword_raw'. Error was a <class 'KeyError'>, original message: 'Requested entry (plugin_type: lookup plugin: ansible_collections.community.general.plugins.lookup.onepassword_raw setting: domain ) was not defined in configuration.'. 'Requested entry (plugin_type: lookup plugin: ansible_collections.community.general.plugins.lookup.onepassword_raw setting: domain ) was not defined in configuration.'"

Issue Type

Bug Report

Component Name

community/general/plugins/lookup/onepassword_raw.py

Ansible Version

$ ansible --version

ansible [core 2.13.5]
...
python version = 3.8.10 (default, Jun 22 2022, 20:18:18) [GCC 9.4.0]
jinja version = 3.1.2
libyaml = True

Community.general Version

$ ansible-galaxy collection list community.general

community.general 6.0.0

Configuration

$ ansible-config dump --only-changed
  • hosts: localhost
    vars:
    record: "my_record"
    vault: "my_vault"
    tasks:
    • set_fact:
      onepassword_items: "{{ lookup('community.general.onepassword_raw', record, vault=vault) | default({}, true) }}"
    • debug:
      msg: "{{ onepassword_items }}"

OS / Environment

Distributor ID: Ubuntu
Description: Ubuntu 20.04.5 LTS
Release: 20.04
Codename: focal

Steps to Reproduce

eval $(op signin)
ansible-playbook my_playbook.yml

Expected Results

I expect the contents of the record in the vault to display.

Actual Results

"An unhandled exception occurred while running the lookup plugin 'community.general.onepassword_raw'. Error was a <class 'KeyError'>, original message: 'Requested entry (plugin_type: lookup plugin: ansible_collections.community.general.plugins.lookup.onepassword_raw setting: domain ) was not defined in configuration.'. 'Requested entry (plugin_type: lookup plugin: ansible_collections.community.general.plugins.lookup.onepassword_raw setting: domain ) was not defined in configuration.'"

Code of Conduct

  • I agree to follow the Ansible Code of Conduct
@ansibullbot
Copy link
Collaborator

Files identified in the description:
None

If these files are incorrect, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibullbot ansibullbot added the bug This issue/PR relates to a bug label Nov 8, 2022
@prashantsomashekar
Copy link
Author

Tagging @samdoran

@prashantsomashekar
Copy link
Author

I just quick-tested using community.general.onepassword.py and this works for a specific query.

@felixfontein
Copy link
Collaborator

!component =plugins/lookup/onepassword_raw.py

@ansibullbot
Copy link
Collaborator

Files identified in the description:

If these files are incorrect, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibullbot
Copy link
Collaborator

@samdoran
Copy link
Contributor

samdoran commented Nov 8, 2022

I'll have a fix up shortly.

@prashantsomashekar
Copy link
Author

prashantsomashekar commented Nov 8, 2022

@samdoran Thank you so much. Initial tests look good. However, it seems the output has changed a bit from V1, so I'll need to re-craft the parsing methodology, from the raw plugin.

@samdoran
Copy link
Contributor

samdoran commented Nov 8, 2022

Yes, the v2 schema is quite a bit different but I think it's a bit more coherent and easier to parse.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue/PR relates to a bug has_pr
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants