Run a local script before/after a play
You can use the script module to run a local script before/after a play.
For example,
- name: 'run local pre-deployment script'
hosts: localhost
tasks:
- local_action: script files/pre-deploy.sh
- name: 'deploy website'
hosts: webservers
tasks:
...
- name: 'run local post-deployment script'
hosts: localhost
tasks:
- local_action: script files/post-deploy.sh
Written by Kal Hodgson
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ansible
Authors
Misha Behersky
78.97K
tartansandal
73.31K
Related Tags
#ansible
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#