Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

ansible run a task always at the end

# Use block and always, which executes its tasks no matter what happens
# in the block tasks.
- name: Always do X
   block:
     - debug:
         msg: 'I execute normally'
     - name: i force a failure
       command: /bin/false
     - debug:
         msg: 'I never execute :-('
   always:
     - debug:
         msg: "This always executes, :-)"
Source by docs.ansible.com #
 
PREVIOUS NEXT
Tagged: #ansible #run #task
ADD COMMENT
Topic
Name
8+6 =