Optimize initial installation by not reloading systemd after each .service install

We expect `--tags=start` to handle systemd reloading, so we don't need
to do it manually each time we install/uninstall a .service file.
This commit is contained in:
Slavi Pantaleev
2022-11-27 10:02:45 +02:00
parent 707e909b9b
commit 2688e8bfc3
52 changed files with 25 additions and 327 deletions

View File

@ -118,15 +118,10 @@
src: "{{ role_path }}/templates/systemd/matrix-mx-puppet-discord.service.j2"
dest: "/etc/systemd/system/matrix-mx-puppet-discord.service"
mode: 0644
register: matrix_mx_puppet_discord_systemd_service_result
- name: Ensure systemd reloaded after matrix-mx-puppet-discord.service installation
ansible.builtin.service:
daemon_reload: true
when: "matrix_mx_puppet_discord_systemd_service_result.changed"
- name: Ensure matrix-mx-puppet-discord.service restarted, if necessary
ansible.builtin.service:
name: "matrix-mx-puppet-discord.service"
state: restarted
daemon_reload: true
when: "matrix_mx_puppet_discord_requires_restart | bool"