How do I use the when statement based on the standard output of register: result? If standard output exists I want somecommand to run if no standard output exists I want so
Try checking to see it if equals a blank string or not?
- hosts: myhosts tasks: - name: echo hello command: echo hello register: result - command: somecommand {{ result.stdout }} when: result.stdout != "" - command: someothercommand when: result.stdout == ""