2015-08-29 23:44:14 +02:00
|
|
|
---
|
2017-02-05 16:12:39 +01:00
|
|
|
- name: install nginx
|
|
|
|
apt:
|
2020-03-23 20:43:06 +01:00
|
|
|
name: "{{ nginx_packages }}"
|
2018-11-03 16:20:39 +01:00
|
|
|
cache_valid_time: 86400
|
2015-08-29 23:44:14 +02:00
|
|
|
|
2018-11-03 16:20:39 +01:00
|
|
|
- name: create directories
|
2017-02-05 16:12:39 +01:00
|
|
|
file:
|
2018-11-03 16:20:39 +01:00
|
|
|
path: "{{ item }}"
|
|
|
|
state: directory
|
|
|
|
with_items:
|
|
|
|
- /var/www/_acme-challenge
|
|
|
|
- /var/www/_error-pages
|
2015-08-29 23:44:14 +02:00
|
|
|
|
2018-11-03 16:20:39 +01:00
|
|
|
- name: copy error-pages
|
2017-02-05 16:12:39 +01:00
|
|
|
copy:
|
2018-11-03 16:20:39 +01:00
|
|
|
src: error-pages/
|
|
|
|
dest: /var/www/_error-pages/
|
2015-08-29 23:44:14 +02:00
|
|
|
|
2018-11-03 16:20:39 +01:00
|
|
|
- name: copy snippets
|
|
|
|
copy:
|
2020-03-23 20:43:06 +01:00
|
|
|
src: snippets
|
|
|
|
dest: /etc/nginx/
|
|
|
|
|
|
|
|
- name: copy openssl.cnf
|
|
|
|
copy:
|
|
|
|
src: openssl.cnf
|
|
|
|
dest: /etc/ssl/
|
|
|
|
backup: yes
|
|
|
|
notify: restart nginx
|
2017-10-03 17:30:06 +02:00
|
|
|
|
2017-02-10 20:38:12 +01:00
|
|
|
- name: template nginx.conf
|
|
|
|
template:
|
2020-03-23 20:43:06 +01:00
|
|
|
src: nginx.conf
|
|
|
|
dest: /etc/nginx/
|
2017-02-05 16:12:39 +01:00
|
|
|
backup: yes
|
2018-11-03 16:20:39 +01:00
|
|
|
notify: reload nginx
|
|
|
|
|
|
|
|
- name: remove default site
|
|
|
|
file:
|
|
|
|
path: /etc/nginx/sites-enabled/default
|
|
|
|
state: absent
|
|
|
|
notify: reload nginx
|