CamilleHbp / dotfiles

Dotfiles and installation scripts managed using ChezMoi.io
0 stars 0 forks source link

`1password-cli` fails to add the account #2

Closed CamilleHbp closed 1 year ago

CamilleHbp commented 1 year ago

The script run_after_onchange_10-configure-1password.sh fails to run the command op account add --address {{ .op_domain }}.1password.com --email {{ .op_email | quote }} --secret-key {{ .op_secret | quote }}.

No idea why, it should run but doesn't. It seems to skip directly to the retrieval of the ssh keys and prompt to add the account completely. This requires investigation.

CamilleHbp commented 1 year ago

It seems we need to authorize the 1password-cli before running chezmoi. This is awkward since it means we need to install 1password on the new machine before running the install script. Waiting for confirmation from the team.

CamilleHbp commented 1 year ago

This bug requires investigation from the chezmoi team. In the meantime, the 1password and 1password-cli should be installed before running the script, and user should be signed in before.

CamilleHbp commented 1 year ago

Fixed by removing explicit calls to op signin and letting the chezmoi templates call the 1password-cli directly. Probably some kind of race condition between the cli calls, or different environment because of the calls inside a script.