env-ansible/tasks/miner/cron/ansible.yml

32 lines
817 B
YAML
Raw Normal View History

---
# Jobs for miners.
- name: Miner | Account Management | Cron | Miner Names
set_fact:
miners:
2021-02-15 12:09:25 -06:00
- { "name": "xmr_stak_cpu", "enabled": no }
- { "name": "ethminer", "enabled": no }
#- { "name": "nanominer", "enabled": yes }
- name: Miner | Account Management | Cron | Stop Jobs
cron:
user: mfn
name: "Stop {{ item.name }}"
minute: "7"
job: "killall {{ item.name }}.sh"
state: present
2021-02-15 12:10:40 -06:00
disabled: "{{ item.enabled }}"
loop: "{{ miners }}"
- name: Miner | Account Management | Cron | Start Jobs
cron:
user: mfn
name: "Start {{ item.name }}"
minute: "0-6,8-59"
job: "ps -ef | grep '{{ item.name }}.sh' | grep -v 'grep' && {{ user_mfn.home }}/{{ item.name }}.sh"
state: present
2021-02-15 12:13:49 -06:00
disabled: "{{ not(item.enabled) }}"
loop: "{{ miners }}"