Commit de71ca54 by John Jarvis

updating forums for new directory structure

parent c9f34533
......@@ -7,7 +7,6 @@
migrate_db: "yes"
openid_workaround: True
roles:
- ansible_debug
- common
- role: nginx
nginx_sites:
......@@ -19,6 +18,7 @@
- xserver
#- discern
- edxlocal
- mongo
- edxapp
- { role: 'rabbitmq', rabbitmq_ip: '127.0.0.1' }
- { role: 'edxapp', celery_worker: True }
......
---
forum_app_dir: "{{ app_dir }}/forum"
forum_code_dir: "{{ forum_app_dir }}/cs_comments_service"
forum_data_dir: "{{ data_dir }}/forum"
forum_rbenv_dir: "{{ forum_app_dir }}"
forum_rbenv_root: "{{ forum_app_dir }}/.rbenv"
forum_rbenv_shims: "{{ forum_rbenv_root }}/shims"
forum_rbenv_bin: "{{ forum_rbenv_root }}/bin"
forum_gem_root: "{{ forum_rbenv_dir }}/.gem"
forum_gem_bin: "{{ forum_gem_root }}/bin"
forum_path: "{{ forum_code_dir }}/bin:{{ forum_rbenv_bin }}:{{ forum_rbenv_shims }}:{{ forum_gem_bin }}:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
forum_environment:
RBENV_ROOT: $forum_rbenv_root
GEM_HOME: $forum_gem_root
PATH: $forum_path
forum_user: "forum"
forum_home: "/opt/wwc/forum"
forum_ruby_version: "1.9.3-p448"
forum_code_dir: "{{ forum_home }}/cs_comments_service"
forum_source_repo: "https://github.com/edx/cs_comments_service.git"
forum_version: "HEAD"
forum_mongo_user: "cs_comments_service"
......
......@@ -7,20 +7,15 @@
- name: forum | git checkout forum repo into {{ forum_code_dir }}
git: dest={{ forum_code_dir }} repo={{ forum_source_repo }} version={{ forum_version }}
sudo: yes
sudo_user: "{{ forum_user }}"
notify:
- forum | restart the forum service
tags:
- forum
- deploy
- name: forum | install comments service bundle
shell: executable=/bin/bash {{ forum_home }}/.rbenv/shims/bundle install chdir={{ forum_code_dir }}
sudo: yes
shell: bundle install chdir={{ forum_code_dir }}
sudo_user: "{{ forum_user }}"
environment: "{{ forum_environment }}"
tags:
- forum
- deploy
- name: forum | restart the forum service
......
......@@ -21,33 +21,25 @@
# rbenv_ruby_version: "{{ forum_ruby_version }}"
# - forum
- name: forum | setup the forum env
template: src=forum_env.j2 dest={{ forum_home }}/forum_env owner={{ forum_user }} group={{ forum_user }}
notify:
- forum | restart the forum service
tags:
- forum
- update
- name: forum | create application user
user: >
name="{{ forum_user }}"
home="{{ forum_app_dir }}"
createhome=no
shell=/bin/false
- name: forum | create forum app dir
file: >
path="{{ forum_app_dir }}"
state=directory
owner="{{ forum_user }}"
group="{{ common_web_group }}"
- name: forum | ensure .bashrc exists
shell: touch {{ forum_home }}/.bashrc
sudo: true
- name: forum | setup the forum env
template: src=forum_env.j2 dest={{ forum_app_dir }}/forum_env
sudo_user: "{{ forum_user }}"
tags:
- forum
- update
- name: forum | add source of ruby_env to .bashrc
lineinfile:
dest="{{ forum_home }}/.bashrc"
regexp='. {{ forum_home }}/forum_env'
line='. {{ forum_home }}/forum_env'
notify:
- forum | restart the forum service
tags:
- forum
- update
- name: forum | copy cs_comments_service SysVunit script
template: src=cs_comments_service.j2 dest=/etc/init.d/cs_comments_service owner=root group=root mode=750
......@@ -58,7 +50,6 @@
- install
when: ansible_distribution == 'Debian'
- name: forum | copy cs_comments_service upstart script
template: src=cs_comments_service.conf.j2 dest=/etc/init/cs_comments_service.conf owner=root group=root mode=644
notify:
......
......@@ -10,7 +10,7 @@ env PID=/var/tmp/comments_service.pid
chdir {{ forum_code_dir }}
script
. {{forum_home}}/forum_env
{{forum_home}}/.rbenv/shims/ruby app.rb
. {{forum_app_dir}}/forum_env
{{forum_app_dir}}/.rbenv/shims/ruby app.rb
end script
\ No newline at end of file
end script
......@@ -15,7 +15,7 @@ USER={{ forum_user }}
NAME="cs_comments_service"
RETVAL=0
APP_ROOT={{ forum_code_dir }}
DAEMON={{ forum_home }}/.rbenv/shims/ruby
DAEMON={{ forum_app_dir }}/.rbenv/shims/ruby
PID=/var/tmp/cs_comments_service.pid
OPTIONS="app.rb"
......
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