xlbxkq
Last Updated: February 25, 2016
·
1.855K
· tartansandal
68ae3430cc86a3e465e7b8860e178981

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
Say Thanks
Respond