Hi all,
I’m using Ansible 2.5.11, using the EC2 dynamic inventory script. I’m trying to do some tasks over an instance with a role using block and rescue, so if one of the tasks fails, the rescue task runs (removing the instance). But I don’t know why the rescue tasks never runs.
I’m running a playbook which executes the roles, like this:
`
Install common packages and tasks, and deploy software
- hosts: tag_Environment_Development:&tag_Role_Pilot:&tag_Name_Backend
gather_facts: True
vars_files: - variables-dev.yml
roles: - deploy-api
`
And the role deploy-api/tasks/main.yml looks like this:
`