diff --git a/config/ansible/tasks/workstations/1password-zen-browser.yml b/config/ansible/tasks/workstations/1password-zen-browser.yml index fb128b4..cf33a56 100644 --- a/config/ansible/tasks/workstations/1password-zen-browser.yml +++ b/config/ansible/tasks/workstations/1password-zen-browser.yml @@ -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 != ""