Protect what matters – even after you're gone. Make a plan for your digital legacy today.
Forum Discussion
Anonymous
2 years agoCreating login items from Ansible
Im trying to figure out how to use 1Password CLI to create items from Ansible.
Everything I tried is giving me an error: "Failed to create item: invalid JSON"
Here is my test task:
- name...
Anonymous
2 years ago@babaika one of my colleagues at work found a solution to this that worked for us. This is what I did in my playbook that worked:
ansible
ansible.builtin.shell:
cmd: |
echo '{ "title": "YOUR TITLE", "fields": [ { "id": "notesPlain", "value": "Hey these are some notes" } ] }' | op item create --vault Private --category "Password" "password={{ super_secret_password }}" --tags=foo --format=JSON
You can get all the fields for the echo json by downloading the template:
shell
op item template get --out-file=password.json "Password"