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_1PJoris_1P

    Team Member
    edited February 11

    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.

  • frankvismafrankvisma
    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

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file