Add feature: new custom instructions

pull/14/head
Emilien Mantel 2015-12-09 17:06:59 +01:00
parent 05cb864c7c
commit e0bb5e2752
5 changed files with 21 additions and 0 deletions

View File

@ -45,6 +45,7 @@ Socket:
- `nginx_pid`: daemon pid file
- `nginx_events_*`: all variables in events block
- `nginx_http_*`: all variables in http block
- `nginx_custom_http`: instructions list (will put data in `/etc/nginx/conf.d/custom.conf`)
### Vhost management

View File

@ -73,6 +73,11 @@ nginx_http_gzip_types: 'text/plain text/css application/json application/x-javas
nginx_http_gzip_vary: 'on'
nginx_http_gzip_disable: '"msie6"'
#
# nginx_http_custom
#
nginx_http_custom: []
#
# Vhosts
#

View File

@ -36,6 +36,12 @@
with_fileglob: '../templates/etc/nginx/helper/*.j2'
notify: reload nginx
- name: TEMPLATE | Deploy custom http configuration
template: >
src=etc/nginx/conf.d/custom.conf.j2
dest=/etc/nginx/conf.d/custom.conf
notify: reload nginx
- name: INCLUDE | Upstream configuration
include: upstream.yml
when: nginx_php

View File

@ -0,0 +1,7 @@
#
# {{ ansible_managed }}
#
{% for i in nginx_custom_http %}
{{ i }}
{% endfor %}

View File

@ -28,6 +28,8 @@
description: 'Please login!'
users: []
state: 'absent'
nginx_custom_http:
- 'add_header X-ansible 1;'
nginx_vhosts:
- name:
- 'test.local'