ansible-nginx/tasks/main.yml

36 lines
1.0 KiB
YAML

---
- name: APT | Install nginx
apt: pkg={{ nginx_apt_package }} state=latest update_cache=yes cache_valid_time=3600
- name: TEMPLATE | Deploy nginx.conf
template: src=etc/nginx/nginx.conf.j2 dest=/etc/nginx/nginx.conf validate= "nginx -t"
notify: restart nginx
- name: FILE | Create /etc/nginx/helpers
file: dest=/etc/nginx/helpers owner=root mode=0755 state=directory
- name: FILE | Create /etc/nginx/ssl
file: dest=/etc/nginx/ssl owner=root mode=0755 state=directory
#- name: COMMAND | Creates DH file
# command: openssl dhparam -out {{ nginx_dh_path }} {{ nginx_dh_length }}
# args:
# creates: "{{ nginx_dh_path }}"
- name: TEMPLATE | Deploy all helpers
template: src={{ item }} dest=/etc/nginx/helpers/{{ item | basename | regex_replace('\.j2$','') }}
with_fileglob: '../templates/etc/nginx/helpers/*.j2'
notify: reload nginx
- name: INCLUDE | Upstream configuration
include: upstream.yml
when: nginx_php
- name: INCLUDE | Vhosts configuration
include: vhost.yml
# TODO:
# - Python
# - Ruby (SHIT!)