kayobe/ansible/host-command-run.yml
Michał Nasiadka 847bb8666d Add output printing to host-command-run
Change-Id: I50f75f8f8ed200b1c70f834973463c2f7343ed1a
2021-03-30 15:26:56 +02:00

17 lines
419 B
YAML

---
- name: Run a command
gather_facts: False
hosts: seed-hypervisor:seed:overcloud
tasks:
- name: Run a command
shell: "{{ host_command_to_run }}"
register: command_output
- name: Print stdout
debug:
msg: "{{ command_output.stdout }}"
when: show_output | bool
- name: Print stderr
debug:
msg: "{{ command_output.stderr }}"
when: show_output | bool