5 - name: execute swFallback operation
\r
6 shell: ./swm/swFallback --filter {{filter}}
\r
8 register: fallback_result
\r
10 - name: write output to file
\r
11 local_action: copy content="{{fallback_result.stdout}}" dest="{{inventory_dir}}/{{inventory_hostname}}_results.txt"
\r
12 when: fallback_result.stdout != ""
\r
14 - name: build error message
\r
17 "reason": "{{fallback_result.stderr}}"
\r
19 when: fallback_result is failed and fallback_result.stdout == "" and fallback_result.stderr != ""
\r
21 - name: write error message to file
\r
22 local_action: copy content="{{err_msg}}" dest="{{inventory_dir}}/{{inventory_hostname}}_results.txt"
\r
23 when: fallback_result is failed and fallback_result.stdout == "" and fallback_result.stderr != ""
\r
25 - name: use result of swFallback as the result of Playbook
\r
27 msg: "{{fallback_result.stderr}}"
\r
28 when: fallback_result is failed
\r