Commit 722ac320 by Brian Beggs

Produce a devstack forums env file

parent 80f04e34
......@@ -9,3 +9,5 @@ FORUM_ELASTICSEARCH_HOST: "es.{{ FLOCK_TLD }}"
FORUM_USE_TCP: "true"
FORUM_RACK_ENV: "staging"
FORUM_SINATRA_ENV: "staging"
devstack: "true"
......@@ -48,7 +48,7 @@ FORUM_RESTART_DELAY: 60
# Set to rebuild the forum ElasticSearch index from the database.
FORUM_REBUILD_INDEX: false
forum_environment:
forum_base_env: &forum_base_env
RBENV_ROOT: "{{ forum_rbenv_root }}"
GEM_HOME: "{{ forum_gem_root }}"
GEM_PATH: "{{ forum_gem_root }}"
......@@ -68,6 +68,16 @@ forum_environment:
LISTEN_HOST: "{{ FORUM_LISTEN_HOST }}"
LISTEN_PORT: "{{ FORUM_LISTEN_PORT }}"
forum_env:
<<: *forum_base_env
devstack_forum_env:
<<: *forum_base_env
RACK_ENV: "development"
SINATRA_ENV: "development"
SEARCH_SERVER: "http://edx.devstack.elasticsearch:9200/"
MONGOHQ_URL: "mongodb://cs_comments_service:password@edx.devstack.mongo:27017/cs_comments_service"
forum_user: "forum"
forum_ruby_version: "2.4.1"
forum_source_repo: "https://github.com/edx/cs_comments_service.git"
......
......@@ -52,9 +52,9 @@
- install:code
- name: install comments service bundle
shell: "bundle install --deployment --path {{ forum_gem_root }} chdir={{ forum_code_dir }}"
shell: ". /edx/app/forum/ruby_env && bundle install --deployment --path {{ forum_gem_root }} chdir={{ forum_code_dir }}"
become_user: "{{ forum_user }}"
environment: "{{ forum_environment }}"
environment: "{{ forum_base_env }}"
notify: restart the forum service
tags:
- install
......@@ -65,7 +65,7 @@
args:
chdir: "{{ forum_code_dir }}"
become_user: "{{ forum_user }}"
environment: "{{ forum_environment }}"
environment: "{{ forum_base_env }}"
when: migrate_db is defined and migrate_db|lower == "yes"
tags:
- migrate
......@@ -76,7 +76,7 @@
args:
chdir: "{{ forum_code_dir }}"
become_user: "{{ forum_user }}"
environment: "{{ forum_environment }}"
environment: "{{ forum_base_env }}"
when: migrate_db is defined and migrate_db|lower == "yes" and FORUM_REBUILD_INDEX|bool
tags:
- migrate
......
......@@ -44,11 +44,26 @@
- install
- install:base
- name: setup the forum env
- name: setup the forum env for stage/prod
template:
src: forum_env.j2
dest: "{{ forum_app_dir }}/forum_env"
owner: "{{ forum_user }}"
owner: "{{ forum_user }}"
group: "{{ common_web_user }}"
mode: 0644
notify:
- restart the forum service
tags:
- install
- install:base
with_items:
- "{{ forum_env }}"
- name: setup the forum env for devstack
template:
src: forum_env.j2
dest: "{{ forum_app_dir }}/devstack_forum_env"
owner: "{{ forum_user }}"
group: "{{ common_web_user }}"
mode: 0644
notify:
......@@ -56,6 +71,9 @@
tags:
- install
- install:base
when: devstack is defined and devstack
with_items:
- "{{ devstack_forum_env }}"
- name: create {{ forum_data_dir }}
file:
......@@ -67,7 +85,7 @@
tags:
- install
- install:base
- include: deploy.yml
tags:
tags:
- deploy
# {{ ansible_managed }}
{% for name,value in forum_environment.items() -%}
{% for name,value in item.items() -%}
{%- if value -%}
export {{ name }}="{{ value }}"
{% endif %}
{% endif %}
{%- endfor %}
eval "$(rbenv init -)"
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