Last active
December 25, 2015 09:09
-
-
Save darkone23/6952439 to your computer and use it in GitHub Desktop.
Storing module arguments in vars
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| - name: control some app | |
| hosts: localhost | |
| vars: | |
| git_repo: git://example.org/path/to/repo.git | |
| app_home: ~/projects/app | |
| super_args: > | |
| config=~/.virtualenvs/supervisor/conf/supervisord.conf | |
| supervisorctl_path=~/.virtualenvs/supervisor/bin/supervisorctl | |
| tasks: | |
| - name: update the app | |
| git: repo={{ git_repo }} dest={{ app_home }} | |
| notify: | |
| - stop monitor | |
| - restart app | |
| - start monitor | |
| handlers: | |
| - name: stop monitor | |
| supervisorctl: name=monitor state=stopped {{ super_args }} | |
| - name: restart app | |
| supervisorctl: name=app state=restarted {{ super_args }} | |
| - name: start the monitor | |
| supervisorctl: name=monitor state=started {{ super_args }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment