44 lines
765 B
YAML
44 lines
765 B
YAML
---
|
|
- name: install nginx
|
|
apt:
|
|
name: "{{ nginx_packages }}"
|
|
cache_valid_time: 86400
|
|
|
|
- name: create directories
|
|
file:
|
|
path: "{{ item }}"
|
|
state: directory
|
|
with_items:
|
|
- /var/www/_acme-challenge
|
|
- /var/www/_error-pages
|
|
|
|
- name: copy error-pages
|
|
copy:
|
|
src: error-pages/
|
|
dest: /var/www/_error-pages/
|
|
|
|
- name: copy snippets
|
|
copy:
|
|
src: snippets
|
|
dest: /etc/nginx/
|
|
|
|
- name: copy openssl.cnf
|
|
copy:
|
|
src: openssl.cnf
|
|
dest: /etc/ssl/
|
|
backup: yes
|
|
notify: restart nginx
|
|
|
|
- name: template nginx.conf
|
|
template:
|
|
src: nginx.conf
|
|
dest: /etc/nginx/
|
|
backup: yes
|
|
notify: reload nginx
|
|
|
|
- name: remove default site
|
|
file:
|
|
path: /etc/nginx/sites-enabled/default
|
|
state: absent
|
|
notify: reload nginx
|