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
0952ed47
Commit
0952ed47
authored
Feb 07, 2014
by
e0d
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #732 from edx/e0d/forum-refactor
productionalization of forum role
parents
6684f02e
2bd990b2
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
52 additions
and
9 deletions
+52
-9
playbooks/roles/forum/defaults/main.yml
+15
-5
playbooks/roles/forum/tasks/main.yml
+8
-2
playbooks/roles/forum/tasks/test.yml
+2
-1
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 @
0952ed47
...
...
@@ -28,6 +28,7 @@ FORUM_ELASTICSEARCH_PORT: "9200"
FORUM_ELASTICSEARCH_URL
:
"
http://{{
FORUM_ELASTICSEARCH_HOST
}}:{{
FORUM_ELASTICSEARCH_PORT
}}"
FORUM_NEW_RELIC_LICENSE_KEY
:
"
new-relic-license-key"
FORUM_NEW_RELIC_APP_NAME
:
"
forum-newrelic-app"
FORUM_WORKER_PROCESSES
:
"
4"
forum_environment
:
RBENV_ROOT
:
"
{{
forum_rbenv_root
}}"
...
...
@@ -41,12 +42,22 @@ forum_environment:
MONGOHQ_URL
:
"
{{
FORUM_MONGO_URL
}}"
HOME
:
"
{{
forum_app_dir
}}"
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_ruby_version
:
"
1.9.3-p448"
forum_source_repo
:
"
https://github.com/edx/cs_comments_service.git"
forum_version
:
"
HEAD"
# Currently we are installing a branch of the comments service
# that configures unicorn to listen on a unix socket and get the
# worker count configuration from the environment. We are not
# merging to master of the comments service yet as this will have
# some incompatibilities with our Heroku deployments.
#
# https://github.com/edx/cs_comments_service/pull/83
#
forum_version
:
"
e0d/unicorn-config"
forum_unicorn_port
:
"
4567"
#
...
...
@@ -59,5 +70,5 @@ forum_unicorn_port: "4567"
# connectivity to Mongo is also tested, but separately.
#
forum_services
:
-
{
service
:
"
sinatra"
,
host
:
"
localhost"
,
port
:
"
{{
forum_unicorn_port
}}"
}
-
{
service
:
"
elasticsearch"
,
host
:
"
{{
FORUM_ELASTICSEARCH_HOST
}}"
,
port
:
"
{{
FORUM_ELASTICSEARCH_PORT
}}"
}
\ No newline at end of file
-
{
service
:
"
elasticsearch"
,
host
:
"
{{
FORUM_ELASTICSEARCH_HOST
}}"
,
port
:
"
{{
FORUM_ELASTICSEARCH_PORT
}}"
}
playbooks/roles/forum/tasks/main.yml
View file @
0952ed47
...
...
@@ -42,5 +42,10 @@
notify
:
-
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/tasks/test.yml
View file @
0952ed47
...
...
@@ -8,4 +8,4 @@
-
name
:
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
when
:
not devstack
\ No newline at end of file
playbooks/roles/forum/templates/forum-supervisor.sh.j2
View file @
0952ed47
#!/bin/bash
source
{{
forum_app_dir
}}
/forum_env
cd
{{
forum_code_dir
}}
{
%
if
devstack %
}
{{
forum_rbenv_shims
}}
/ruby app.rb
{
%
else
%
}
{{
forum_gem_bin
}}
/unicorn
-c
config/unicorn.rb
{
% endif %
}
playbooks/roles/nginx/templates/forum.j2
View file @
0952ed47
#
# {{ 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 -%}
{%- set default_site = "default" -%}
{%- else -%}
{%- set default_site = "" -%}
{%- endif -%}
{% if devstack %}
{# Connects to webbrick on port 4567 typically. Appropriate for development deployments #}
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 {
...
...
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