diff --git a/facts/miner/gather.yml b/facts/miner/gather.yml new file mode 100644 index 0000000..26dccf8 --- /dev/null +++ b/facts/miner/gather.yml @@ -0,0 +1,8 @@ +--- +# Find things we will use later. + +## Executables ## + +- name: Miner | Facts | System | Executables + shell: "which bash" + register: bash_exec \ No newline at end of file diff --git a/tasks/miner/acct_mgmt/users.yml b/tasks/miner/acct_mgmt/users.yml index d2fb7a1..39add90 100644 --- a/tasks/miner/acct_mgmt/users.yml +++ b/tasks/miner/acct_mgmt/users.yml @@ -19,4 +19,5 @@ - video - render append: yes + shell: "{{ bash_exec.stdout }}" register: user_mfn \ No newline at end of file diff --git a/tasks/miner/cron/ansible.yml b/tasks/miner/cron/ansible.yml index 82407e7..a79f31e 100644 --- a/tasks/miner/cron/ansible.yml +++ b/tasks/miner/cron/ansible.yml @@ -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 }}"