Download:
child 11:6cebfc3e9fe4
parent 9:677ec7e634c8
10:14d1e7c3a6a7
Anton Shestakov <av6@dwimlabs.net>, Fri, 01 Apr 2016 01:58:30 +0800
post_tasks: restart services, now the example playbook is ready for deployment

1 файлов изменено, 7 вставок(+), 2 удалений(-) [+]
playbook-example.yml file | annotate | diff | comparison | revisions
--- a/playbook-example.yml Fri Apr 01 01:57:43 2016 +0800
+++ b/playbook-example.yml Fri Apr 01 01:58:30 2016 +0800
@@ -17,8 +17,8 @@
# and also it uses two handlers:
# - reload supervisor
# - restart nginx
- # If you don't have your own nginx and supervisor roles, just reload or
- # restart both services manually after running this playbook.
+ # This role doesn't have the handlers, so this playbook restarts the
+ # services in post_tasks instead.
- name: Install Nginx
apt: package=nginx-full state=installed update_cache=yes cache_valid_time=3600
- name: Disable default Nginx site
@@ -32,4 +32,9 @@
# tags: [supervisor]
- role: hgweb
tags: [hgweb]
+ post_tasks:
+ - name: Restart Nginx
+ service: name=nginx state=restarted
+ - name: Restart Supervisor
+ service: name=supervisor state=restarted sleep=1
...