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

44 lines
833 B
YAML

---
- name: Create deadman directory
file:
name: /root/deadman
state: directory
- name: Install deadswitch script
copy:
src: deadswitch
dest: /usr/local/bin/deadswitch
mode: u+rx
- name: Install imdead.sh
copy:
src: imdead.sh
dest: /root/deadman/imdead.sh
mode: u+rx
- name: Copy dead patch
copy:
src: secrets/dead.patch
dest: /root/deadman/dead.patch
mode: u+rw
# TODO: deadtrigger path should be a variable, no?
- name: Check deadtrigger
stat:
path: /root/.deadtrigger
register: deadstat
- name: Install deadtrigger
file:
path: /root/.deadtrigger
state: touch
when: deadstat.stat.exists == false
# Run deadswitch daily at 1am
- name: Install deadlock cronjob
cron:
name: Run deadswitch
minute: 0
hour: 1
job: /usr/local/bin/deadswitch