Creating 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: Run command
ansible.builtin.command: "op item create --category login --title 'Test'"
delegate_to: localhost
Even running an empty command "op item create" gives the same error about invalid JSON even though I would expect it to fail with something related to a missing category.
I also tried to create a json template and use it, but in that case task finishes fine, but no actual login is created:
- name: Run command
ansible.builtin.command: "echo {{ lookup('file', 'login.tpl') }} | op item create"
delegate_to: localhost
Executing command locally works just fine
CLI version: 2.16.1
What am I doing wrong?
1Password Version: 8.10.4
Extension Version: Not Provided
OS Version: MacOS 13.3.1
Browser:_ Not Provided