It’s Cybersecurity Awareness Month! Join our interactive training session, or learn about security and AI from 1Password experts.
Forum Discussion
Former Member
3 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...
Former Member
3 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"