Commit de71ca54 by John Jarvis

updating forums for new directory structure

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