Issue #6 and PR #8: Make nginx user more flexible.

pull/8/merge 1.1.4
Jeff Geerling 9 years ago
parent 45b749af83
commit fdc9a7da78
  1. 4
      README.md
  2. 1
      defaults/main.yml
  3. 10
      tasks/main.yml
  4. 2
      tests/test.yml
  5. 2
      vars/Debian.yml
  6. 2
      vars/RedHat.yml
  7. 1
      vars/main.yml

@ -12,7 +12,7 @@ None.
## Role Variables
Available variables are listed below, along with default values (see `vars/main.yml` and `defaults/main.yml`):
Available variables are listed below, along with default values (see `defaults/main.yml`):
nginx_remove_default_vhost: false
nginx_default_vhost_path: /etc/nginx/sites-enabled/default
@ -21,7 +21,7 @@ Whether to remove the 'default' virtualhost configuration supplied by Nginx. Use
nginx_user: "nginx"
The user under which Nginx will run.
The user under which Nginx will run. Defaults to `nginx` for RedHat, and `www-data` for Debian.
nginx_worker_processes: "1"
nginx_worker_connections: "8192"

@ -1,5 +1,4 @@
---
nginx_user: "nginx"
nginx_worker_processes: "1"
nginx_worker_connections: "8192"
nginx_client_max_body_size: "64m"

@ -1,4 +1,14 @@
---
# Variable setup.
- name: Include OS-specific variables.
include_vars: "{{ ansible_os_family }}.yml"
- name: Define nginx_user.
set_fact:
nginx_user: "{{ __nginx_user }}"
when: nginx_user is not defined
# Nginx setup.
- name: Enable nginx repo (RedHat).
copy: >
src=nginx.repo

@ -1,7 +1,5 @@
---
- hosts: localhost
remote_user: root
vars:
nginx_user: root
roles:
- ansible-role-nginx

@ -0,0 +1,2 @@
---
__nginx_user: "www-data"

@ -0,0 +1,2 @@
---
__nginx_user: "nginx"