summaryrefslogtreecommitdiff
path: root/examples/echo_capture.yaml
diff options
context:
space:
mode:
Diffstat (limited to 'examples/echo_capture.yaml')
-rw-r--r--examples/echo_capture.yaml32
1 files changed, 32 insertions, 0 deletions
diff --git a/examples/echo_capture.yaml b/examples/echo_capture.yaml
new file mode 100644
index 0000000..fa44030
--- /dev/null
+++ b/examples/echo_capture.yaml
@@ -0,0 +1,32 @@
+parallelism: false
+hosts: localhost
+
+tasks:
+ - name: Ejecutar comando simple
+ module: run
+ args:
+ command: "ls -L /tmpAAA"
+ become: false
+ capture_log: ls_resultado
+ capture_err: ls_error
+
+ - name: Mostrar capture_log con modulo echo
+ module: echo
+ args:
+ message: "{{ ls_resultado }}"
+ become: false
+ condition: "[ {{ ls_error }} -eq 0 ]"
+
+ - name: Mostrar capture_err con modulo echo
+ module: echo
+ args:
+ message: "{{ ls_error }}"
+ become: false
+
+ - name: Prueba sustitucion en modulo echo
+ module: echo
+ args:
+ variableA: "Texto de variable A"
+ variableB: "Texto de variable B"
+ message: "Mostramos A: {{ variableA }} y B: {{ variableB }}"
+ become: false