ansible-roles/system/base/systemd_mail/tasks/main.yml

34 lines
1.0 KiB
YAML

---
- name: "systemd mail root script"
ansible.builtin.template:
src: "./system/systemd-mail-systemctl-status"
dest: "/usr/local/sbin/systemd-mail-systemctl-status"
mode: 0755
- name: "systemd mail user script"
ansible.builtin.template:
src: "./user/systemd-mail-systemctl-status"
dest: "/usr/local/bin/systemd-mail-systemctl-status"
mode: 0755
- name: "systemd mail root service"
ansible.builtin.copy:
src: "./system/status-mail@.service"
dest: "/etc/systemd/system/status-mail@.service"
mode: 0644
register: system_base_system_status_mail_service_file
- name: "systemd mail user service"
ansible.builtin.copy:
src: "./user/status-mail@.service"
dest: "/etc/systemd/user/status-mail@.service"
mode: 0644
register: system_base_user_status_mail_service_file
- name: "systemd daemon reload"
ansible.builtin.systemd:
daemon_reload: true
when:
system_base_system_status_mail_service_file.changed or
system_base_user_status_mail_service_file.changed