Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move the binary and service names to the default variables #47

Merged
merged 3 commits into from
May 17, 2015
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Move the binary and service names to the default variables, so they c…
…an be overwritten for custom nginx builds
  • Loading branch information
NBZ4live committed May 17, 2015
commit e5872feff15f997e3ecd35268fa4b75ee0fd638d
2 changes: 2 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ nginx_official_repo: False
keep_only_specified: False

nginx_installation_type: "packages"
nginx_binary_name: "nginx"
nginx_service_name: "nginx"
nginx_conf_dir: "/etc/nginx"

nginx_user: "{% if ansible_os_family == 'RedHat' %}nginx{% elif ansible_os_family == 'Debian' %}www-data{% endif %}"
Expand Down
4 changes: 2 additions & 2 deletions handlers/main.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
- name: restart nginx
service: name=nginx state=restarted
service: name={{ nginx_service_name }} state=restarted
when: nginx_installation_type in nginx_installation_types_using_service and nginx_daemon_mode == "on"

- name: reload nginx
service: name=nginx state=reloaded
service: name={{ nginx_service_name }} state=reloaded
when: nginx_installation_type in nginx_installation_types_using_service and nginx_daemon_mode == "on"
2 changes: 1 addition & 1 deletion tasks/configuration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
tags: [configuration,nginx]

- name: Check nginx syntax of configuration files
shell: nginx -t
shell: "{{ nginx_binary_name }} -t"
register: result
changed_when: "result.rc != 0"
always_run: yes
Expand Down