ansible-role-webserver/tasks/main.yml

37 lines
577 B
YAML

- name: Install
package:
name: nginx
- name: create folders
file:
path: "{{ item }}"
state: directory
with_items:
- /etc/nginx/sites.d
- /etc/nginx/local.d
- /etc/nginx/snippets
- name: templates
notify: reload nginx
template:
src: "nginx.conf"
dest: "/etc/nginx/nginx.conf"
- name: started
systemd:
name: nginx
state: started
- name: php
import_tasks: php.yml
when: webserver_php_enabled
- name: tls
import_tasks: tls.yml
when: webserver_tls_enabled
- name: enabled nginx
systemd:
name: nginx
enabled: yes