Remove template timestamps & move tasks to handlers

These changes will prevent services from being restarted without any changes
whenever no changes have been made
This commit is contained in:
Sonny Bakker 2024-03-16 10:36:59 +01:00
parent 7a57636bdb
commit 8e7d6db56b
29 changed files with 46 additions and 95 deletions

View file

@ -17,6 +17,7 @@
template:
src: 'templates/{{ platform }}/pipewire-pulse.j2'
dest: '{{ xdg_config_dir }}/pipewire/pipewire-pulse.conf'
notify: restart pipewire-pulse
- name: gather the package facts
package_facts:
@ -29,6 +30,7 @@
state: present
extra_args: --noconfirm --ask=4
when: "'pipewire-media-session' in ansible_facts.packages or not 'wireplumber' in ansible_facts.packages"
notify: restart pipewire-pulse
- name: start pipewire socket
systemd:
@ -36,14 +38,3 @@
state: started
enabled: true
scope: user
- name: restart pipewire-pulse
systemd:
name: '{{ item.name }}'
state: restarted
enabled: '{{ item.enabled }}'
scope: user
daemon-reload: true
loop:
- { name: 'pipewire-pulse.socket', enabled: true }
- { name: 'pipewire-pulse.service', enabled: false }