computer-playbook/roles/cleanup-disc-space/tasks/main.yml

26 lines
747 B
YAML

- name: "create {{cleanup_disc_space_folder}}"
file:
path: "{{cleanup_disc_space_folder}}"
state: directory
mode: 0755
- name: create cleanup-disc-space.sh
template:
src: cleanup-disc-space.sh.j2
dest: "{{cleanup_disc_space_folder}}cleanup-disc-space.sh"
- name: create cleanup-disc-space.service
template:
src: cleanup-disc-space.service.j2
dest: /etc/systemd/system/cleanup-disc-space.service
notify: reload cleanup-disc-space.service
- name: set service_name to the name of the current role
set_fact:
service_name: "{{ role_name }}"
- name: "include role for systemd-timer for {{service_name}}"
include_role:
name: systemd-timer
vars:
on_calendar: "{{on_calendar_cleanup_disc_space}}"