Added rescue

This commit is contained in:
Guillem Hernandez Sola
2025-06-19 11:00:10 +02:00
parent fee4726e73
commit 97bfbc3e7e

View File

@@ -0,0 +1,12 @@
- name: Manejo de errores en Ansible
hosts: all
become: yes
tasks:
- name: Bloque principal
block:
- name: Tarea que puede fallar
command: /bin/false
rescue:
- name: Manejo de error
debug:
msg: "La tarea falló, pero hemos manejado el error."