Commit c44bfd00 by Clinton Blackburn Committed by Clinton Blackburn

Running bundle install with the correct user

OPS-1243
parent 962465b1
...@@ -3,8 +3,6 @@ dependencies: ...@@ -3,8 +3,6 @@ dependencies:
- common - common
- supervisor - supervisor
- role: rbenv - role: rbenv
# TODO: setting the rbenv ownership to rbenv_user: "{{ forum_user }}"
# the common_web_user is a workaround
rbenv_user: "{{ common_web_user }}"
rbenv_dir: "{{ forum_app_dir }}" rbenv_dir: "{{ forum_app_dir }}"
rbenv_ruby_version: "{{ forum_ruby_version }}" rbenv_ruby_version: "{{ forum_ruby_version }}"
...@@ -49,12 +49,9 @@ ...@@ -49,12 +49,9 @@
- install - install
- install:code - install:code
# TODO: This is done as the common_web_user
# since the process owner needs write access
# to the rbenv
- name: install comments service bundle - name: install comments service bundle
shell: bundle install --deployment chdir={{ forum_code_dir }} shell: bundle install --deployment chdir={{ forum_code_dir }}
sudo_user: "{{ common_web_user }}" sudo_user: "{{ forum_user }}"
environment: "{{ forum_environment }}" environment: "{{ forum_environment }}"
notify: restart the forum service notify: restart the forum service
tags: tags:
......
...@@ -23,18 +23,23 @@ ...@@ -23,18 +23,23 @@
- name: create application user - name: create application user
user: > user: >
name="{{ forum_user }}" home="{{ forum_app_dir }}" name="{{ forum_user }}"
createhome=no home="{{ forum_app_dir }}"
createhome=yes
shell=/bin/false shell=/bin/false
generate_ssh_key=yes
notify: restart the forum service notify: restart the forum service
tags: tags:
- install - install
- install:base - install:base
- name: create forum app dir # Ensure the directory is accessible to the web service
- name: set forum app dir permissions
file: > file: >
path="{{ forum_app_dir }}" state=directory path="{{ forum_app_dir }}"
owner="{{ forum_user }}" group="{{ common_web_group }}" state=directory
owner="{{ forum_user }}"
group="{{ common_web_group }}"
notify: restart the forum service notify: restart the forum service
tags: tags:
- install - install
......
...@@ -21,23 +21,6 @@ ...@@ -21,23 +21,6 @@
group: "{{ common_web_group }}" group: "{{ common_web_group }}"
when: edxapp_user is defined when: edxapp_user is defined
# Ensure forum user has permissions to access .gem and .rbenv
# This is a little twisty: the forum role sets the owner and group to www-data
# So we add the forum user to the www-data group and give group write permissions
- name: add forum user to www-data group
user: name={{ forum_user }} groups={{ common_web_group }} append=yes
when: forum_user is defined
# Need this in order for the forum user to install and uninstall
# gems using 'bundle' or 'gem'. Can't make it 760 because that
# would break the bin directory under .gem
- name: set forum rbenv and gem permissions
file:
path={{ item }} state=directory recurse=yes mode="g+rw"
with_items:
- "{{ forum_app_dir }}/.gem"
when: forum_user is defined
# Create scripts to configure environment # Create scripts to configure environment
- name: create login scripts - name: create login scripts
template: template:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment