This commit is contained in:
2021-03-16 21:20:33 +01:00
parent 4f376d4005
commit 2cf86c1f2c

View File

@@ -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