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

make it possible to set up the nginx user's secondary groups #60

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 3 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ nginx_conf_dir: "/etc/nginx"
nginx_user: "{% if ansible_os_family == 'RedHat' %}nginx{% elif ansible_os_family == 'Debian' %}www-data{% endif %}"
nginx_group: "{{nginx_user}}"

# Any additional groups the nginx user should be added to
nginx_groups: ""

nginx_pid_file: '/var/run/{{nginx_service_name}}.pid'

nginx_worker_processes: "{{ ansible_processor_vcpus }}"
Expand Down
7 changes: 7 additions & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
when: nginx_official_repo == True
- include: installation.packages.yml
when: nginx_installation_type == "packages"

- name: Setup nginx user's groups
user:
name: "{{nginx_user}}"
group: "{{nginx_group}}"
groups: "{{nginx_groups}}"

- include: remove-defaults.yml
when: not keep_only_specified
- include: remove-extras.yml
Expand Down