openpunk-ansible/roles/deadswitch/tasks/main.yml

44 lines
833 B
YAML
Raw Normal View History

2022-05-31 04:36:55 +00:00
---
- name: Create deadman directory
file:
name: /root/deadman
state: directory
- name: Install deadswitch script
copy:
src: deadswitch
2022-05-31 04:36:55 +00:00
dest: /usr/local/bin/deadswitch
2022-10-04 16:29:40 +00:00
mode: u+rx
2022-05-31 04:36:55 +00:00
- name: Install imdead.sh
copy:
src: imdead.sh
2022-05-31 04:36:55 +00:00
dest: /root/deadman/imdead.sh
2022-10-04 16:29:40 +00:00
mode: u+rx
2022-05-31 04:36:55 +00:00
- name: Copy dead patch
2022-08-02 18:38:55 +00:00
copy:
src: secrets/dead.patch
dest: /root/deadman/dead.patch
2022-10-04 16:29:40 +00:00
mode: u+rw
2022-05-31 04:36:55 +00:00
# TODO: deadtrigger path should be a variable, no?
- name: Check deadtrigger
stat:
path: /root/.deadtrigger
register: deadstat
- name: Install deadtrigger
2022-05-31 04:36:55 +00:00
file:
path: /root/.deadtrigger
2022-05-31 04:36:55 +00:00
state: touch
when: deadstat.stat.exists == false
2022-05-31 04:36:55 +00:00
2022-08-02 18:32:19 +00:00
# Run deadswitch daily at 1am
2022-05-31 04:36:55 +00:00
- name: Install deadlock cronjob
cron:
name: Run deadswitch
minute: 0
hour: 1
job: /usr/local/bin/deadswitch