34 lines
741 B
YAML
34 lines
741 B
YAML
---
|
|
# file: roles/timelogger/tasks/main.yml
|
|
|
|
- name: Create output directory
|
|
file:
|
|
path: "{{ timeloggerOutputDirectory }}"
|
|
state: directory
|
|
|
|
- name: Create script directory
|
|
file:
|
|
path: "{{ timeloggerScriptDirectory }}"
|
|
state: directory
|
|
|
|
- name: Place script
|
|
template:
|
|
src: "templates/timelogger.j2"
|
|
dest: "{{ timeloggerScriptDirectory }}/timelogger"
|
|
owner: root
|
|
mode: 755
|
|
|
|
- name: Deploy timerlogger service
|
|
template:
|
|
src: timelogger.service.j2
|
|
dest: /etc/systemd/system/timelogger.service
|
|
notify: Daemon Reload
|
|
|
|
- name: Flush handlers
|
|
meta: flush_handlers
|
|
|
|
- name: Start and enable systemd timer for timerlogger
|
|
service:
|
|
name: timelogger.service
|
|
state: started
|
|
enabled: yes
|