infra-role-s3cmd-upload/tasks/timer.yml

28 lines
813 B
YAML

---
- name: 'Create systemd service file: {{ s3cmd_upload_service_name }}'
template:
src: backup.service.j2
dest: '{{ s3cmd_upload_service_path }}/{{ s3cmd_upload_service_name }}.service'
mode: 0644
- name: 'Create systemd timer file: {{ s3cmd_upload_service_name }}'
template:
src: backup.timer.j2
dest: '{{ s3cmd_upload_service_path }}/{{ s3cmd_upload_service_name }}.timer'
mode: 0644
- name: Reload systemctl
command: systemctl daemon-reload
- name: '(Re)start upload service: {{ s3cmd_upload_service_name }}'
service:
name: '{{ s3cmd_upload_service_name }}.service'
state: started
enabled: true
- name: 'Enable the service timer: {{ s3cmd_upload_service_name }}'
systemd:
name: '{{ s3cmd_upload_service_name }}.timer'
state: started
enabled: yes