Skip to main content
January 12, 2022
Question

Pull out whole item/file via Ansible from vault

  • January 12, 2022
  • 2 replies
  • 212 views

Is there possiblity to pull whole item as a file out from vault via Ansible integration?

https://github.com/1Password/ansible-onepasswordconnect-collection

Is there any examples how to do it?

Thanks!


1Password Version: Not Provided
Extension Version: Not Provided
OS Version: Not Provided

2 replies

February 11, 2022

Hi @frankvisma,

My apologies for the late response. I am not an Ansible expert, but I'd expect something like this to work:

hosts: localhost
environment:
OP_CONNECT_HOST: http://localhost:8001
OP_CONNECT_TOKEN: "valid.jwt.here"
collections:
- onepassword.connect
tasks:
- name: Find the item with the label "Staging Database" in the vault "Staging Env"
item_info:
item: Staging Database
vault: Staging Env
no_log: true
register: op_item
- local_action: copy content={{ op_item }} dest=/path/to/destination/file

You can see the contents of {{ op_item }} in the collapses section in https://github.com/1Password/ansible-onepasswordconnect-collection#example-usage-1.

Let me know if that works for you.

February 11, 2022

hello,

That is not unfortunately what Im after. They made issue out of it: https://github.com/1Password/ansible-onepasswordconnect-collection/issues/53