Getting started with 1Password for your growing team, or refining your setup? Our Secured Success quickstart guide is for you.
Forum Discussion
Former Member
4 years agoGet multiple items from the vault using Ansible loop
So, I am wondering if there is a way to get multiple items from the vault at once?
Here is the issue - I have a playbook with 20 or 30 secrets that are going to be stored inside 1Password. What I...
Former Member
4 years agoSo, I managed to get this:
TASK [Print the item] *********************************************************************************************************************************************************************************************
ok: [snip] =>
smtn:
changed: false
msg: All items completed
results:
- ansible_facts:
discovered_interpreter_python: /usr/bin/python3
ansible_loop_var: item
changed: false
failed: false
field: the value
invocation:
module_args:
field: Some Label
hostname: snip
item: Glupi item
token: VALUE_SPECIFIED_IN_NO_LOG_PARAMETER
vault: Ansible
item:
definition:
field_type: concealed
label: Some Label
section: Personal Info
value: the value
var: some_label
op_item: {}
- ansible_loop_var: item
changed: false
failed: false
field: DrtqaPW7jhUYCKXX
invocation:
module_args:
field: Dashboard Password
hostname: snip
item: Glupi item
token: VALUE_SPECIFIED_IN_NO_LOG_PARAMETER
vault: Ansible
item:
definition:
generate_value: on_create
generator_recipe:
include_symbols: false
length: 16
label: Dashboard Password
var: dashboard_password
op_item: {}
out of this:
- name: Get the item
item_info:
item: "{{ vault_title }}"
field: "{{ item.definition.label }}"
vault: Ansible
no_log: true
register: smtn
loop: "{{ secrets.fields }}"
But that's it. I see that there are two ansible_loop_var
items in the results
but I am just unable to iterate through them.
Any help would be appreciated.