Skip to content

Instantly share code, notes, and snippets.

@darkone23
Last active December 25, 2015 09:09
Show Gist options
  • Select an option

  • Save darkone23/6952439 to your computer and use it in GitHub Desktop.

Select an option

Save darkone23/6952439 to your computer and use it in GitHub Desktop.
Storing module arguments in vars
- 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