env-ansible/tasks/miner/cron/ansible.yml
2021-02-15 11:22:58 -06:00

32 lines
824 B
YAML

---
# Jobs for miners.
- name: Miner | Account Management | Cron | Miner Names
set_fact:
miners:
- { "name": "xmr_stak_cpu", "disabled": yes }
- { "name": "ethminer", "disabled": yes }
#- { "name": "nanominer", "disabled": yes }
- name: Miner | Account Management | Cron | Stop Jobs
cron:
user: mfn
name: "Mine with {{ item.name }}"
minute: "7"
job: "killall {{ item.name }}.sh"
state: present
disabled: { not item.disabled }
loop: "{{ miners }}"
- name: Miner | Account Management | Cron | Start Jobs
cron:
user: mfn
name: "Mine with {{ 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
disabled: {{ item.disabled }}
loop: "{{ miners }}"