Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
configuration
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
configuration
Commits
2a47f845
Commit
2a47f845
authored
Jan 31, 2014
by
e0d
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changes to make the forums run using unicorn and
unix sockets.
parent
3eeb0aa1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
43 additions
and
7 deletions
+43
-7
playbooks/roles/forum/defaults/main.yml
+7
-3
playbooks/roles/forum/tasks/main.yml
+9
-3
playbooks/roles/forum/templates/forum-supervisor.sh.j2
+6
-0
playbooks/roles/nginx/templates/forum.j2
+21
-1
No files found.
playbooks/roles/forum/defaults/main.yml
View file @
2a47f845
...
@@ -28,6 +28,7 @@ FORUM_ELASTICSEARCH_PORT: "9200"
...
@@ -28,6 +28,7 @@ FORUM_ELASTICSEARCH_PORT: "9200"
FORUM_ELASTICSEARCH_URL
:
"
http://{{
FORUM_ELASTICSEARCH_HOST
}}:{{
FORUM_ELASTICSEARCH_PORT
}}"
FORUM_ELASTICSEARCH_URL
:
"
http://{{
FORUM_ELASTICSEARCH_HOST
}}:{{
FORUM_ELASTICSEARCH_PORT
}}"
FORUM_NEW_RELIC_LICENSE_KEY
:
"
new-relic-license-key"
FORUM_NEW_RELIC_LICENSE_KEY
:
"
new-relic-license-key"
FORUM_NEW_RELIC_APP_NAME
:
"
forum-newrelic-app"
FORUM_NEW_RELIC_APP_NAME
:
"
forum-newrelic-app"
FORUM_WORKER_PROCESSES
:
"
4"
forum_environment
:
forum_environment
:
RBENV_ROOT
:
"
{{
forum_rbenv_root
}}"
RBENV_ROOT
:
"
{{
forum_rbenv_root
}}"
...
@@ -41,12 +42,14 @@ forum_environment:
...
@@ -41,12 +42,14 @@ forum_environment:
MONGOHQ_URL
:
"
{{
FORUM_MONGO_URL
}}"
MONGOHQ_URL
:
"
{{
FORUM_MONGO_URL
}}"
HOME
:
"
{{
forum_app_dir
}}"
HOME
:
"
{{
forum_app_dir
}}"
NEW_RELIC_APP_NAME
:
"
{{
FORUM_NEW_RELIC_APP_NAME
}}"
NEW_RELIC_APP_NAME
:
"
{{
FORUM_NEW_RELIC_APP_NAME
}}"
NEW_RELIC_LICENSE_KEY
:
"
{{
FORUM_NEW_RELIC_LICENSE_KEY
}}"
NEW_RELIC_LICENSE_KEY
:
"
{{
FORUM_NEW_RELIC_LICENSE_KEY
}}"
WORKER_PROCESSES
:
"
{{
FORUM_WORKER_PROCESSES
}}"
DATA_DIR
:
"
{{
forum_data_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
:
"
e0d/unicorn-config
"
forum_unicorn_port
:
"
4567"
forum_unicorn_port
:
"
4567"
#
#
...
@@ -59,5 +62,5 @@ forum_unicorn_port: "4567"
...
@@ -59,5 +62,5 @@ forum_unicorn_port: "4567"
# connectivity to Mongo is also tested, but separately.
# connectivity to Mongo is also tested, but separately.
#
#
forum_services
:
forum_services
:
-
{
service
:
"
sinatra"
,
host
:
"
localhost"
,
port
:
"
{{
forum_unicorn_port
}}"
}
#
- {service: "sinatra", host: "localhost", port: "{{ forum_unicorn_port }}"}
-
{
service
:
"
elasticsearch"
,
host
:
"
{{
FORUM_ELASTICSEARCH_HOST
}}"
,
port
:
"
{{
FORUM_ELASTICSEARCH_PORT
}}"
}
-
{
service
:
"
elasticsearch"
,
host
:
"
{{
FORUM_ELASTICSEARCH_HOST
}}"
,
port
:
"
{{
FORUM_ELASTICSEARCH_PORT
}}"
}
\ No newline at end of file
playbooks/roles/forum/tasks/main.yml
View file @
2a47f845
...
@@ -38,9 +38,14 @@
...
@@ -38,9 +38,14 @@
template
:
>
template
:
>
src=forum_env.j2 dest={{ forum_app_dir }}/forum_env
src=forum_env.j2 dest={{ forum_app_dir }}/forum_env
owner={{ forum_user }} group={{ common_web_user }}
owner={{ forum_user }} group={{ common_web_user }}
mode=0
64
4
mode=0
77
4
notify
:
notify
:
-
restart the forum service
-
restart the forum service
-
include
:
deploy.yml tags=deploy
-
name
:
create {{ forum_data_dir }}
file
:
>
path={{ forum_data_dir }} state=directory
owner="{{ common_web_user }}" group="{{ common_web_group }}"
mode=0777
-
include
:
deploy.yml tags=deploy
\ No newline at end of file
playbooks/roles/forum/templates/forum-supervisor.sh.j2
View file @
2a47f845
#!/bin/bash
#!/bin/bash
source
{{
forum_app_dir
}}
/forum_env
source
{{
forum_app_dir
}}
/forum_env
cd
{{
forum_code_dir
}}
cd
{{
forum_code_dir
}}
{
%
if
devstack %
}
{{
forum_rbenv_shims
}}
/ruby app.rb
{{
forum_rbenv_shims
}}
/ruby app.rb
{
%
else
%
}
{{
forum_gem_bin
}}
/unicorn
-c
config/unicorn.rb
{
% endif %
}
playbooks/roles/nginx/templates/forum.j2
View file @
2a47f845
#
# {{ ansible_managed }}
#
{# This prevents the injected comment from eating the server
directive. There's probably a better way of doing this,
but I don't know it currently.
#}
{% raw %}
{% endraw %}
{%- if "forum" in nginx_default_sites -%}
{%- if "forum" in nginx_default_sites -%}
{%- set default_site = "default" -%}
{%- set default_site = "default" -%}
{%- else -%}
{%- else -%}
{%- set default_site = "" -%}
{%- set default_site = "" -%}
{%- endif -%}
{%- endif -%}
{% if devstack %}
{# Connects to webbrick on port 4567 typically. Appropriate for development deployments #}
upstream forum_app_server {
upstream forum_app_server {
server localhost:{{ forum_unicorn_port }} fail_timeout=0;
}
{% else %}
{# Connects to unicorn over a unix socket. Appropriate for production deployments #}
server localhost:{{ forum_unicorn_port }} fail_timeout=0;
upstream forum_app_server {
server unix:{{ forum_data_dir }}/forum.sock fail_timeout=0;
}
}
{% endif %}
server {
server {
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment