|
@@ -60,35 +60,47 @@
|
|
|
pip: name="{{ item }}" state=present virtualenv="{{ home }}/virtualenv"
|
|
|
with_items: virtualenv_packages
|
|
|
|
|
|
- name: Deploy systemd socket configuration for website
|
|
|
template: src="systemd_wsgi_website.socket.j2" dest="/etc/systemd/system/{{ fqdn }}.socket"
|
|
|
owner=root group=root mode=644
|
|
|
notify:
|
|
|
- Reload systemd
|
|
|
- "Restart website {{ fqdn }}"
|
|
|
|
|
|
- name: Deploy systemd service configuration for website
|
|
|
template: src="systemd_wsgi_website.service.j2" dest="/etc/systemd/system/{{ fqdn }}.service"
|
|
|
owner=root group=root mode=644
|
|
|
notify:
|
|
|
- Reload systemd
|
|
|
- "Restart website {{ fqdn }}"
|
|
|
|
|
|
- name: Enable the website service
|
|
|
service: name="{{ fqdn }}" enabled=yes state=started
|
|
|
|
|
|
- name: Create directory where static files can be served from
|
|
|
file: path="{{ home }}/htdocs/" state=directory
|
|
|
owner="{{ admin }}" group="{{ user }}" mode="2750"
|
|
|
|
|
|
- name: Deploy nginx TLS private key for website
|
|
|
copy: dest="/etc/ssl/private/{{ https_tls_key | basename }}" src="{{ https_tls_key }}"
|
|
|
mode=640 owner=root group=root
|
|
|
notify:
|
|
|
- Restart nginx
|
|
|
|
|
|
- name: Deploy nginx TLS certificate for website
|
|
|
copy: dest="/etc/ssl/certs/{{ https_tls_certificate | basename }}" src="{{ https_tls_certificate }}"
|
|
|
mode=644 owner=root group=root
|
|
|
notify:
|
|
|
- Restart nginx
|
|
|
|
|
|
- name: Deploy nginx configuration file for website
|
|
|
template: src="nginx_site.j2" dest="/etc/nginx/sites-available/{{ fqdn }}"
|
|
|
owner=root group=root mode=640 validate="/usr/local/bin/nginx_verify_site.sh -n '{{ fqdn }}' %s"
|
|
|
notify:
|
|
|
- Restart nginx
|
|
|
|
|
|
- name: Enable nginx website
|
|
|
file: src="/etc/nginx/sites-available/{{ fqdn }}" dest="/etc/nginx/sites-enabled/{{ fqdn }}"
|
|
|
state=link
|
|
|
notify:
|
|
|
- Restart nginx
|