Pull out whole item/file via Ansible from vault

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

Comments

  • Joris_1P
    edited February 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 this part of the docs.

    Let me know if that works for you.

  • frankvisma
    frankvisma
    Community Member

    hello,

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

This discussion has been closed.