Ansible playbook when usage
Clash Royale CLAN TAG #URR8PPP Ansible playbook when usage - name: restart dcache if mem low hosts: test tasks: - name: getMem shell: /bin/bash /etc/zabbix/shell/MonitorMem.sh register: memNum - name: restart dcache if mem low shell: killall -9 dcache when: memNum < 3 MonitorMem.sh returns a num(an integer) that represents free memory,I want to use when to decide whether execute restart action. but every time I run the playbook.it will skip restart action. please give me a hand, thanks in advance. 1 Answer 1 The shell documentation modules provides the structure of the return values, stdout contains the output of the executed command (and so is stdout_lines ). stdout stdout_lines I added also a filter to convert the value to an integer. - name: restart dcache if mem low hosts: test tasks: - name: getMem shell: /bin/bash /etc/zabbix/shell/MonitorMem.sh regist...