Commit 6dfa74b9 by e0d

Merge pull request #643 from edx/e0d/forum-updates

E0d/forum updates
parents 8f5cdba4 cb391060
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
- roles/ora/defaults/main.yml - roles/ora/defaults/main.yml
- roles/xqueue/defaults/main.yml - roles/xqueue/defaults/main.yml
- roles/xserver/defaults/main.yml - roles/xserver/defaults/main.yml
- roles/forum/defaults/main.yml
roles: roles:
# rerun common to set the hostname, nginx to set basic auth # rerun common to set the hostname, nginx to set basic auth
- common - common
...@@ -42,6 +43,7 @@ ...@@ -42,6 +43,7 @@
- ora - ora
- xqueue - xqueue
- xserver - xserver
- forum
nginx_default_sites: nginx_default_sites:
- lms - lms
# gh_users hash must be passed # gh_users hash must be passed
......
...@@ -40,7 +40,7 @@ EDXAPP_EMAIL_BACKEND: 'django.core.mail.backends.smtp.EmailBackend' ...@@ -40,7 +40,7 @@ EDXAPP_EMAIL_BACKEND: 'django.core.mail.backends.smtp.EmailBackend'
EDXAPP_LOG_LEVEL: 'INFO' EDXAPP_LOG_LEVEL: 'INFO'
EDXAPP_MEMCACHE: [ 'localhost:11211' ] EDXAPP_MEMCACHE: [ 'localhost:11211' ]
EDXAPP_COMMENTS_SERVICE_URL: 'http://localhost:4567' EDXAPP_COMMENTS_SERVICE_URL: 'http://localhost:18080'
EDXAPP_COMMENTS_SERVICE_KEY: 'password' EDXAPP_COMMENTS_SERVICE_KEY: 'password'
EDXAPP_EDXAPP_SECRET_KEY: '' EDXAPP_EDXAPP_SECRET_KEY: ''
......
...@@ -13,35 +13,38 @@ forum_path: "{{ forum_code_dir }}/bin:{{ forum_rbenv_bin }}:{{ forum_rbenv_shims ...@@ -13,35 +13,38 @@ forum_path: "{{ forum_code_dir }}/bin:{{ forum_rbenv_bin }}:{{ forum_rbenv_shims
FORUM_MONGO_USER: "cs_comments_service" FORUM_MONGO_USER: "cs_comments_service"
FORUM_MONGO_PASSWORD: "password" FORUM_MONGO_PASSWORD: "password"
FORUM_MONGO_HOST: "localhost" FORUM_MONGO_HOSTS:
- "localhost"
FORUM_MONGO_PORT: "27017" FORUM_MONGO_PORT: "27017"
FORUM_MONGO_DATABASE: "cs_comments_service"
FORUM_MONGO_URL: "mongodb://{{ FORUM_MONGO_USER }}:{{ FORUM_MONGO_PASSWORD }}@{%- for host in FORUM_MONGO_HOSTS -%}
{{host}}:{{ FORUM_MONGO_PORT }}{%- if not loop.last -%},{%- endif -%}
{%- endfor -%}/{{ FORUM_MONGO_DATABASE }}"
FORUM_SINATRA_ENV: "development" FORUM_SINATRA_ENV: "development"
FORUM_RACK_ENV: "development"
FORUM_NGINX_PORT: "18080"
FORUM_API_KEY: "password"
FORUM_ELASTICSEARCH_HOST: "localhost"
FORUM_ELASTICSEARCH_PORT: "9200"
FORUM_ELASTICSEARCH_URL: "http://{{ FORUM_ELASTICSEARCH_HOST }}:{{ FORUM_ELASTICSEARCH_PORT }}"
forum_environment: forum_environment:
RBENV_ROOT: "{{ forum_rbenv_root }}" RBENV_ROOT: "{{ forum_rbenv_root }}"
GEM_HOME: "{{ forum_gem_root }}" GEM_HOME: "{{ forum_gem_root }}"
GEM_PATH: "{{ forum_gem_root }}" GEM_PATH: "{{ forum_gem_root }}"
PATH: "{{ forum_path }}" PATH: "{{ forum_path }}"
MONGOHQ_USER: "{{ FORUM_MONGO_USER }}" RACK_ENV: "{{ FORUM_RACK_ENV }}"
MONGOHQ_PASS: "{{ FORUM_MONGO_PASSWORD }}"
RACK_ENV: "{{ forum_rack_env }}"
SINATRA_ENV: "{{ FORUM_SINATRA_ENV }}" SINATRA_ENV: "{{ FORUM_SINATRA_ENV }}"
API_KEY: "{{ forum_api_key }}" API_KEY: "{{ FORUM_API_KEY }}"
SEARCH_SERVER: "{{ forum_elasticsearch_url }}" SEARCH_SERVER: "{{ FORUM_ELASTICSEARCH_URL }}"
MONGOHQ_URL: "{{ forum_mongo_url }}" MONGOHQ_URL: "{{ FORUM_MONGO_URL }}"
HOME: "{{ forum_app_dir }}" HOME: "{{ forum_app_dir }}"
forum_user: "forum" forum_user: "forum"
forum_ruby_version: "1.9.3-p448" forum_ruby_version: "1.9.3-p448"
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_database: "cs_comments_service" forum_unicorn_port: "4567"
forum_mongo_url: "mongodb://{{ FORUM_MONGO_USER }}:{{ FORUM_MONGO_PASSWORD }}@{{ FORUM_MONGO_HOST }}:{{ FORUM_MONGO_PORT }}/{{ forum_mongo_database }}"
forum_rack_env: "development"
forum_api_key: "password"
forum_elasticsearch_host: "localhost"
forum_elasticsearch_port: "9200"
forum_elasticsearch_url: "http://{{ forum_elasticsearch_host }}:{{ forum_elasticsearch_port }}"
# #
# test config # test config
...@@ -49,11 +52,9 @@ forum_elasticsearch_url: "http://{{ forum_elasticsearch_host }}:{{ forum_elastic ...@@ -49,11 +52,9 @@ forum_elasticsearch_url: "http://{{ forum_elasticsearch_host }}:{{ forum_elastic
# #
# The following services should be listening on the associated # The following services should be listening on the associated
# ports when the role has been successfully created. # ports when the role has been successfully created. Note that
# connectivity to Mongo is also tested, but separately.
# #
forum_services: forum_services:
- {service: "sinatra", host: "localhost", port: "4567"} - {service: "sinatra", host: "localhost", port: "{{ forum_unicorn_port }}"}
- {service: "mongo", host: "{{ FORUM_MONGO_HOST }}", port: "27017"} - {service: "elasticsearch", host: "{{ FORUM_ELASTICSEARCH_HOST }}", port: "{{ FORUM_ELASTICSEARCH_PORT }}"}
- {service: "mongo", host: "{{ FORUM_MONGO_HOST }}", port: "28017"} \ No newline at end of file
- {service: "elasticsearch", host: "{{ forum_elasticsearch_host }}", port: "9200"}
- {service: "elasticsearch", host: "{{ forum_elasticsearch_host }}", port: "9300"}
...@@ -7,3 +7,11 @@ ...@@ -7,3 +7,11 @@
tags: tags:
- forum - forum
- test - test
- name: forum | test that mongo replica set members are listing
wait_for: port={{ FORUM_MONGO_PORT }} host={{ item }} timeout=30
with_items: "{{ FORUM_MONGO_HOSTS }}"
when: not devstack
tags:
- forum
- test
{%- if "forum" in nginx_default_sites -%}
{%- set default_site = "default" -%}
{%- else -%}
{%- set default_site = "" -%}
{%- endif -%}
upstream forum_app_server {
server localhost:{{ forum_unicorn_port }} fail_timeout=0;
}
server {
server_name forum.*;
listen {{ FORUM_NGINX_PORT }} {{default_site}};
client_max_body_size 1M;
keepalive_timeout 5;
location / {
try_files $uri @proxy_to_app;
}
location @proxy_to_app {
proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto;
proxy_set_header X-Forwarded-Port $http_x_forwarded_port;
proxy_set_header X-Forwarded-For $http_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://forum_app_server;
}
}
\ No newline at end of file
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