33 lines
1.0 KiB
YAML
33 lines
1.0 KiB
YAML
---
|
|
# Jobs for miners.
|
|
|
|
# Move this to system facts?
|
|
- name: Miner | Account Management | Cron | Miner Names
|
|
set_fact:
|
|
miners:
|
|
- { "name": "xmr_stak_cpu", "enabled": '{{ (xmr_stak_cpu is defined) }}', "command": "{{ user_mfn.home }}/xmr_stak_cpu.sh" }
|
|
- { "name": "ethminer", "enabled": '{{ (ethminer is defined) }}', "command": "{{ user_mfn.home }}/ethminer.sh" }
|
|
- { "name": "nanominer", "enabled": '{{ (nanominer is defined) }}', "command": "{{ nanominer_script }}" }
|
|
|
|
|
|
- name: Miner | Account Management | Cron | Stop Jobs
|
|
cron:
|
|
user: mfn
|
|
name: "Stop {{ item.name }}"
|
|
minute: "*/5"
|
|
job: "killall {{ item.command }}"
|
|
state: present
|
|
disabled: "{{ item.enabled }}"
|
|
loop: "{{ miners }}"
|
|
|
|
|
|
- name: Miner | Account Management | Cron | Start Jobs
|
|
cron:
|
|
user: mfn
|
|
name: "Start {{ item.name }}"
|
|
minute: "*/5"
|
|
job: "ps -ef | grep '{{ item.command }}' | grep -v 'grep' && {{ item.command }}"
|
|
state: present
|
|
disabled: "{{ not(item.enabled) }}"
|
|
loop: "{{ miners }}"
|