ansible-practice/command-output-test.yml
2023-11-08 14:58:46 +00:00

19 lines
324 B
YAML

---
- name: test command output
hosts: all
tasks:
- name: Test for VG existance
command: vgs
register: vgout
ignore_errors: True
- name: Show variable value
debug:
var: vgout
- name: print
debug:
msg: vg does not exist
when: "'No such' in vgout.msg"