ansible using op within shell failing with internal server conflict

Options
RobSpellman
RobSpellman
Community Member

I have an ansible playbook we used with LastPass that would generate random passwords, store them in LastPass, and then login via ssh keys and set the password for a user. We've been working on converting the playbook to use the 1password cli command op. I looked at the ansible-galaxy project for 1password, and it looks like it requires a token to authenticate, and we liked the capability of using the 1password client, which is already installed on the computers we run ansible from.

The shell command I'm using is:

op item template get login | op item create --cache=false --title \"MyHostName\" username=root --generate-password=20,letters,digits,symbols

The playbook seems to run fine when updating the password for one or two computers, but often fails with the following error when I'm trying to update more computers:

[ERROR] 2023/11/20 13:52:04 unable to process line 1: Network: (DB: (409) (Conflict), Internal server conflict.), DB: (409) (Conflict), Internal server conflict.

I did notice once that I was prompted each time I ran the op command in the playbook to authenticate, and it worked for all twenty hosts. I then performed another op signin and ran the playbook again, and it failed 90% of the time.

I installed 1password-cli via brew, and I'm running 2.23.0, which seems to be current.


1Password Version: 8.10.18
Extension Version: 2.23.0
OS Version: macOS 14.1.1
Browser: Not Provided