diff --git a/fail_when.yml b/fail_when.yml deleted file mode 100644 index a2f0924..0000000 --- a/fail_when.yml +++ /dev/null @@ -1,30 +0,0 @@ ---- -- hosts: centos - tasks: - - - name: print a message - debug: - msg: "OS on {{ inventory_hostname }} is {{ ansible_distribution }}" - - - name: send script - copy: - src: "{{ item }}" - dest: /tmp/ - mode: 0750 - loop: - - random.sh - - bad.sh - - - name: execute bad script - command: "/tmp/bad/sh" - ignore_errors: true - - - name: execute random script - command: /tmp//random.sh - register: result - failed_when: 2|string in result.stdout - - - name: display result - debug: - var: result - when: 1|string in result.stdout \ No newline at end of file