2020-07-21 02:22:32 +02:00
|
|
|
- name: Install
|
|
|
|
package:
|
2020-08-25 14:47:13 +02:00
|
|
|
name: nginx
|
2020-07-21 02:22:32 +02:00
|
|
|
|
|
|
|
- name: create folders
|
|
|
|
file:
|
|
|
|
path: "{{ item }}"
|
|
|
|
state: directory
|
|
|
|
with_items:
|
|
|
|
- /etc/nginx/sites.d
|
2020-07-21 02:37:37 +02:00
|
|
|
- /etc/nginx/local.d
|
2020-07-21 02:22:32 +02:00
|
|
|
- /etc/nginx/snippets
|
|
|
|
|
|
|
|
- name: templates
|
|
|
|
notify: reload nginx
|
|
|
|
template:
|
2020-08-25 14:47:13 +02:00
|
|
|
src: "nginx.conf"
|
|
|
|
dest: "/etc/nginx/nginx.conf"
|
2020-07-21 02:22:32 +02:00
|
|
|
|
|
|
|
- name: started
|
|
|
|
systemd:
|
|
|
|
name: nginx
|
|
|
|
state: started
|
|
|
|
|
2020-07-22 01:50:30 +02:00
|
|
|
- name: php
|
|
|
|
import_tasks: php.yml
|
|
|
|
when: webserver_php_enabled
|
|
|
|
|
2020-08-25 14:47:13 +02:00
|
|
|
- name: tls
|
|
|
|
import_tasks: tls.yml
|
|
|
|
when: webserver_tls_enabled
|
|
|
|
|
2020-07-21 02:22:32 +02:00
|
|
|
- name: enabled nginx
|
|
|
|
systemd:
|
|
|
|
name: nginx
|
|
|
|
enabled: yes
|