feat: improve handling of 1Password instances during configuration changes
Some checks failed
Nix Format Check / check-format (push) Failing after 37s

This commit is contained in:
Menno van Leeuwen 2025-03-11 10:12:18 +01:00
parent a8e80b61de
commit 8c3a130e07
Signed by: vleeuwenmenno
SSH Key Fingerprint: SHA256:OJFmjANpakwD3F2Rsws4GLtbdz1TJ5tkQF0RZmF0TRE

View File

@ -10,11 +10,6 @@
changed_when: false
failed_when: false
- name: Kill any running 1Password instances
ansible.builtin.command: pkill 1password
when: onepassword_running.stdout != ""
changed_when: onepassword_running.stdout != ""
- name: Ensure 1Password custom allowed browsers directory exists
ansible.builtin.file:
path: /etc/1password
@ -34,7 +29,14 @@
group: root
mode: '0755'
become: true
register: custom_browsers_file
- name: If 1Password was running, restart it
- name: Kill any running 1Password instances if configuration changed
ansible.builtin.command: pkill 1password
when: custom_browsers_file.changed and onepassword_running.stdout != ""
changed_when: custom_browsers_file.changed and onepassword_running.stdout != ""
- name: If 1Password was killed, restart it...
ansible.builtin.command: screen -dmS 1password 1password
when: onepassword_running.stdout != ""
when: custom_browsers_file.changed and onepassword_running.stdout != ""
changed_when: custom_browsers_file.changed and onepassword_running.stdout != ""