Ansible-TimeLogger/roles/timelogger/tasks/main.yml
2025-04-02 11:10:34 -06:00

29 lines
635 B
YAML

---
# file: roles/timelogger/tasks/main.yml
- name: Create output 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