Set mfn up for using bash expressions in cron.

This commit is contained in:
Hyperling 2021-02-15 18:41:16 -06:00
parent 8cc014d063
commit 29fbf12b62
3 changed files with 10 additions and 1 deletions

8
facts/miner/gather.yml Normal file
View File

@ -0,0 +1,8 @@
---
# Find things we will use later.
## Executables ##
- name: Miner | Facts | System | Executables
shell: "which bash"
register: bash_exec

View File

@ -19,4 +19,5 @@
- video
- render
append: yes
shell: "{{ bash_exec.stdout }}"
register: user_mfn

View File

@ -26,7 +26,7 @@
user: mfn
name: "Start {{ item.name }}"
minute: "*/5"
job: "ps -ef | grep '{{ item.command }}' | grep -v 'grep' && {{ item.command }}"
job: "[[ ps -ef | grep -v 'grep'| grep -c '{{ item.command }}' == '0' ]] && {{ item.command }}"
state: present
disabled: "{{ not(item.enabled) }}"
loop: "{{ miners }}"