diff --git a/autostart/services/autostart.target b/autostart/autostart.target.j2 similarity index 84% rename from autostart/services/autostart.target rename to autostart/autostart.target.j2 index cd054a3..7d4fbae 100644 --- a/autostart/services/autostart.target +++ b/autostart/autostart.target.j2 @@ -7,7 +7,9 @@ Wants=discord.service Wants=dpms.service Wants=dunst.service Wants=element.service -Wants=firefox.service +{% for profile in user.firefox_profiles|default([]) %} +Wants=firefox@{{ profile.name }}.service +{% endfor %} Wants=gpg-agent.service Wants=gnome-keyring.service Wants=keepassx.service diff --git a/user.yml b/user.yml index e2de76e..ad76dff 100644 --- a/user.yml +++ b/user.yml @@ -478,5 +478,27 @@ group: "{{ user_group_name }}" with_fileglob: /var/lib/dotfiles/autostart/services/* + - name: get state of autostart.target + stat: + path: "/home/{{ user.name }}/.config/systemd/user/autostart.target" + register: autostart_target_stat + + - name: remove invalid autostart.target + file: + path: "/home/{{ user.name }}/.config/systemd/user/autostart.target" + state: absent + when: + - autostart_target_stat.stat.exists + - not autostart_target_stat.stat.isreg + + - name: deploy autostart.target + template: + src: ./autostart/autostart.target.j2 + dest: "/home/{{ user.name }}/.config/systemd/user/autostart.target" + owner: "{{ user.name }}" + group: "{{ user_group_name }}" + force: true + follow: false + tags: - autostart