2021-02-11 08:05:34 -06:00
|
|
|
---
|
|
|
|
# Jobs for miners.
|
|
|
|
|
2021-02-15 11:09:34 -06:00
|
|
|
- name: Miner | Account Management | Cron | Miner Names
|
|
|
|
set_fact:
|
|
|
|
miners:
|
2021-02-15 14:14:17 -06:00
|
|
|
- { "name": "xmr_stak_cpu", "enabled": '{{ (xmr_stak_cpu is defined) }}' }
|
|
|
|
- { "name": "ethminer", "enabled": '{{ (ethminer is defined) }}' }
|
2021-02-15 14:13:04 -06:00
|
|
|
#- { "name": "nanominer", "enabled": (nanominer is defined) }
|
2021-02-15 12:09:25 -06:00
|
|
|
|
2021-02-15 11:09:34 -06:00
|
|
|
|
|
|
|
- name: Miner | Account Management | Cron | Stop Jobs
|
|
|
|
cron:
|
|
|
|
user: mfn
|
2021-02-15 12:18:07 -06:00
|
|
|
name: "Stop {{ item.name }}"
|
2021-02-15 11:16:06 -06:00
|
|
|
minute: "7"
|
2021-02-15 11:09:34 -06:00
|
|
|
job: "killall {{ item.name }}.sh"
|
|
|
|
state: present
|
2021-02-15 12:10:40 -06:00
|
|
|
disabled: "{{ item.enabled }}"
|
2021-02-15 11:09:34 -06:00
|
|
|
loop: "{{ miners }}"
|
|
|
|
|
|
|
|
|
|
|
|
- name: Miner | Account Management | Cron | Start Jobs
|
|
|
|
cron:
|
|
|
|
user: mfn
|
2021-02-15 12:18:07 -06:00
|
|
|
name: "Start {{ item.name }}"
|
2021-02-15 11:16:06 -06:00
|
|
|
minute: "0-6,8-59"
|
2021-02-15 11:09:34 -06:00
|
|
|
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) }}"
|
2021-02-15 11:09:34 -06:00
|
|
|
loop: "{{ miners }}"
|