Skip to content

Commit

Permalink
Fix a bug that caused nginx not to restart when changed
Browse files Browse the repository at this point in the history
  • Loading branch information
nickjj committed Jun 12, 2014
1 parent 63e3ac0 commit cfe0e8a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ nginx_ssl_local_path: /home/you/dev/testproject/secrets
nginx_ssl_cert_name: sslcert.crt
nginx_ssl_key_name: sslkey.key

apt_cache_valid_time: 86400
apt_cache_valid_time: 86400
12 changes: 6 additions & 6 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
- name: ensure nginx latest stable is installed
apt: pkg=nginx state=latest update_cache=true cache_valid_time={{ apt_cache_valid_time }}
notify:
- restart nginx
- restart nginx

- name: ensure the default site is removed
file: path=/etc/nginx/sites-{{ item }}/default state=absent
with_items:
- enabled
- available
notify:
- restart nginx
- restart nginx

- name: ensure nginx ssl directory is created
file: path=/etc/nginx/ssl state=directory
Expand All @@ -29,22 +29,22 @@
- "{{ nginx_ssl_key_name }}"
when: nginx_ssl
notify:
- reload nginx
- reload nginx

- name: ensure nginx is configured
template: src=nginx_conf.j2 dest=/etc/nginx/nginx.conf group=root owner=root
notify:
- reload nginx
- reload nginx

- name: ensure sites-available is configured
template: src=nginx_sites-available.conf.j2 dest=/etc/nginx/sites-available/{{ nginx_upstream_name }} group=root owner=root
notify:
- reload nginx
- reload nginx

- name: ensure sites-available is symlinked to sites-enabled
file: src=/etc/nginx/sites-available/{{ nginx_upstream_name }} dest=/etc/nginx/sites-enabled/{{ nginx_upstream_name }} state=link
notify:
- restart nginx
- restart nginx

- name: ensure nginx starts on a fresh reboot
service: name=nginx state=started enabled=yes

0 comments on commit cfe0e8a

Please sign in to comment.