Many minor changes

pull/14/head
Emilien Mantel 2015-11-03 14:44:14 +01:00
parent a0a6e35a3a
commit 6be44c7da8
8 changed files with 15 additions and 12 deletions

View File

@ -44,6 +44,7 @@ Socket:
- `nginx_worker_processes`
- `nginx_events`: key/value in events block
- `nginx_http`: key/value in http block
- `nginx_pid`: daemon pid file
### Vhost management
@ -138,6 +139,4 @@ GPLv2
Author Information
------------------
- You can find many other roles in my GitHub "lab": https://github.com/HanXHX/my-ansible-playbooks
- All issues, pull-request are welcome :)
- Twitter: https://twitter.com/hanxhx

View File

@ -8,8 +8,9 @@ nginx_apt_package: nginx-full
nginx_root: "/srv/www"
nginx_log_dir: '/var/log/nginx'
nginx_ssl_dir: '/etc/nginx/ssl'
nginx_pid: '/run/nginx.pid'
nginx_resolver:
hosts: ['208.67.222.222', '208.67.220.220'] # OpenDNS
hosts: ['8.8.8.8', '8.8.4.4'] # OpenDNS
valid: '300'
timeout: '5'
nginx_error_log_level: 'warn' # http://nginx.org/en/docs/ngx_core_module.html#error_log

View File

@ -4,7 +4,7 @@ galaxy_info:
description: Nginx for Debian
company:
license: GPLv2
min_ansible_version: 1.2
min_ansible_version: 1.6
platforms:
- name: Debian
versions:

View File

@ -12,7 +12,10 @@
changed_when: false
- name: TEMPLATE | Deploy nginx.conf
template: src=etc/nginx/nginx.conf.j2 dest=/etc/nginx/nginx.conf validate= "nginx -t"
template: >
src=etc/nginx/nginx.conf.j2
dest=/etc/nginx/nginx.conf
validate= "nginx -t"
notify: reload nginx
- name: FILE | Create /etc/nginx/helpers
@ -27,7 +30,10 @@
# creates: "{{ nginx_dh_path }}"
- name: TEMPLATE | Deploy all helpers
template: src={{ item }} dest=/etc/nginx/helpers/{{ item | basename | regex_replace('\.j2$','') }}
template: >
src={{ item }}
dest=/etc/nginx/helpers/{{ item | basename | regex_replace('\.j2$','') }}
validate= "nginx -t"
with_fileglob: '../templates/etc/nginx/helpers/*.j2'
notify: reload nginx

View File

@ -14,6 +14,7 @@
template: >
src=etc/nginx/sites-available/{{ item.template }}.j2
dest=/etc/nginx/sites-available/{{ item.name if item.name is string else item.name[0] }}
validate='nginx -t'
with_items: nginx_vhosts
notify: reload nginx
when: item.delete is not defined or not item.delete

View File

@ -4,7 +4,7 @@
user {{ nginx_user }};
worker_processes {{ nginx_worker_processes }};
pid /run/nginx.pid;
pid {{ nginx_pid }};
events {
{% for key, value in nginx_events.iteritems() %}

View File

@ -2,5 +2,3 @@ FROM williamyeh/ansible:debian8-onbuild
RUN apt-get update
CMD ["sh", "tests/test.sh"]
EXPOSE 6379

View File

@ -2,5 +2,3 @@ FROM williamyeh/ansible:debian7-onbuild
RUN apt-get update
CMD ["sh", "tests/test.sh"]
EXPOSE 6379