Skip to content

Commit

Permalink
Superuser needed for /etc writing
Browse files Browse the repository at this point in the history
  • Loading branch information
JoseKilo committed Dec 19, 2016
1 parent 0cfa156 commit 3d4a1cb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions tasks/configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,21 @@
template: src=upstart-{{item.server|default(wsgi_server)}}.conf.j2 dest=/etc/init/{{item.name}}-wsgi.conf owner=root group=root mode=0644
with_items: "{{wsgi_applications}}"
when: wsgi_service == 'upstart'
become: yes
notify: wsgi restart

- name: Setup Init
template: src=init-{{item.server|default(wsgi_server)}}.j2 dest=/etc/init.d/{{item.name}}-wsgi owner=root group=root mode=0755
with_items: "{{wsgi_applications}}"
when: wsgi_service == 'init'
become: yes
notify: wsgi restart

- name: Setup SystemD
template: src=systemd-{{item.server|default(wsgi_server)}}.j2 dest=/etc/systemd/system/{{item.name}}-wsgi.service owner=root group=root mode=0644
with_items: "{{wsgi_applications}}"
when: wsgi_service == 'systemd'
become: yes
notify: wsgi restart

- name: Ensure that the services are started
Expand Down
4 changes: 3 additions & 1 deletion tasks/wsgi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,21 @@
template: src=nginx.conf.j2 dest={{item.etc_dir|default("/opt/%s/etc" % item.name)}}/{{item.name}}-nginx.conf owner={{wsgi_user}} group={{wsgi_group}}
when: item.proxy|default(wsgi_proxy) == 'nginx'
with_items: "{{wsgi_applications}}"
notify: nginx reload
notify: nginx reload
tags: [wsgi, wsgi-nginx]

- name: Enable nginx sites
file: state=link dest={{nginx_sites_dir}}/{{item.name}}.conf src={{item.etc_dir|default("/opt/%s/etc" % item.name)}}/{{item.name}}-nginx.conf
when: item.proxy|default(wsgi_proxy) == 'nginx'
with_items: "{{wsgi_applications}}"
become: yes
tags: [wsgi, wsgi-nginx]

- name: Configure log rotation
template: src=logrotate.conf.j2 dest=/etc/logrotate.d/{{item.name}}-wsgi.conf
with_items: "{{wsgi_applications}}"
when: wsgi_log_rotate
become: yes
tags: [wsgi, wsgi-logrotate]

# vim:sw=2:ft=ansible

0 comments on commit 3d4a1cb

Please sign in to comment.