Skip to content

Commit

Permalink
Many minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Emilien Mantel committed Nov 3, 2015
1 parent a0a6e35 commit 6be44c7
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 12 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
3 changes: 2 additions & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
10 changes: 8 additions & 2 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
1 change: 1 addition & 0 deletions tasks/vhost.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion templates/etc/nginx/nginx.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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() %}
Expand Down
2 changes: 0 additions & 2 deletions tests/debian-jessie.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,3 @@ FROM williamyeh/ansible:debian8-onbuild

RUN apt-get update
CMD ["sh", "tests/test.sh"]

EXPOSE 6379
2 changes: 0 additions & 2 deletions tests/debian-wheezy.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,3 @@ FROM williamyeh/ansible:debian7-onbuild

RUN apt-get update
CMD ["sh", "tests/test.sh"]

EXPOSE 6379

0 comments on commit 6be44c7

Please sign in to comment.