Commit e559060c by Max Rothman

Dashes to underscores

parent 95bc39e3
...@@ -89,7 +89,7 @@ analytics_api_environment: ...@@ -89,7 +89,7 @@ analytics_api_environment:
DJANGO_SETTINGS_MODULE: "analyticsdataserver.settings.production" DJANGO_SETTINGS_MODULE: "analyticsdataserver.settings.production"
ANALYTICS_API_CFG: "{{ COMMON_CFG_DIR }}/{{ analytics_api_service_name }}.yaml" ANALYTICS_API_CFG: "{{ COMMON_CFG_DIR }}/{{ analytics_api_service_name }}.yaml"
analytics_api_service_name: "analytics-api" analytics_api_service_name: "analytics_api"
analytics_api_user: "analytics-api" analytics_api_user: "analytics-api"
analytics_api_home: "{{ COMMON_APP_DIR }}/{{ analytics_api_service_name }}" analytics_api_home: "{{ COMMON_APP_DIR }}/{{ analytics_api_service_name }}"
analytics_api_code_dir: "{{ analytics_api_home }}/{{ analytics_api_service_name }}" analytics_api_code_dir: "{{ analytics_api_home }}/{{ analytics_api_service_name }}"
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
# code style: https://github.com/edx/configuration/wiki/Ansible-Coding-Conventions # code style: https://github.com/edx/configuration/wiki/Ansible-Coding-Conventions
# license: https://github.com/edx/configuration/blob/master/LICENSE.TXT # license: https://github.com/edx/configuration/blob/master/LICENSE.TXT
# #
# Tasks for role analytics-api # Tasks for role analytics_api
# #
# Overview: # Overview:
# #
...@@ -27,14 +27,14 @@ ...@@ -27,14 +27,14 @@
# ENABLE_NEWRELIC: False # ENABLE_NEWRELIC: False
# roles: # roles:
# - aws # - aws
# - analytics-api # - analytics_api
# #
# ansible-playbook -i 'api.example.com,' ./analyticsapi.yml -e@/ansible/vars/deployment.yml -e@/ansible/vars/env-deployment.yml # ansible-playbook -i 'api.example.com,' ./analyticsapi.yml -e@/ansible/vars/deployment.yml -e@/ansible/vars/env-deployment.yml
# #
- name: setup the analytics-api env file - name: setup the analytics_api env file
template: > template: >
src="edx/app/analytics-api/analytics_api_env.j2" src="edx/app/analytics_api/analytics_api_env.j2"
dest="{{ analytics_api_home }}/analytics_api_env" dest="{{ analytics_api_home }}/analytics_api_env"
owner={{ analytics_api_user }} owner={{ analytics_api_user }}
group={{ analytics_api_user }} group={{ analytics_api_user }}
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
- name: "add gunicorn configuration file" - name: "add gunicorn configuration file"
template: > template: >
src=edx/app/analytics-api/analytics_api_gunicorn.py.j2 src=edx/app/analytics_api/analytics_api_gunicorn.py.j2
dest={{ analytics_api_home }}/analytics_api_gunicorn.py dest={{ analytics_api_home }}/analytics_api_gunicorn.py
sudo_user: "{{ analytics_api_user }}" sudo_user: "{{ analytics_api_user }}"
notify: "restart the analytics service" notify: "restart the analytics service"
...@@ -82,14 +82,14 @@ ...@@ -82,14 +82,14 @@
- name: write out the supervisior wrapper - name: write out the supervisior wrapper
template: > template: >
src=edx/app/analytics-api/analytics-api.sh.j2 src=edx/app/analytics_api/analytics_api.sh.j2
dest={{ analytics_api_home }}/{{ analytics_api_service_name }}.sh dest={{ analytics_api_home }}/{{ analytics_api_service_name }}.sh
mode=0650 owner={{ supervisor_user }} group={{ common_web_user }} mode=0650 owner={{ supervisor_user }} group={{ common_web_user }}
notify: restart the analytics service notify: restart the analytics service
- name: write supervisord config - name: write supervisord config
template: > template: >
src=edx/app/supervisor/conf.d.available/analytics-api.conf.j2 src=edx/app/supervisor/conf.d.available/analytics_api.conf.j2
dest="{{ supervisor_available_dir }}/{{ analytics_api_service_name }}.conf" dest="{{ supervisor_available_dir }}/{{ analytics_api_service_name }}.conf"
owner={{ supervisor_user }} group={{ common_web_user }} mode=0644 owner={{ supervisor_user }} group={{ common_web_user }} mode=0644
notify: restart the analytics service notify: restart the analytics service
...@@ -110,7 +110,7 @@ ...@@ -110,7 +110,7 @@
- name: create symlinks from the venv bin dir - name: create symlinks from the venv bin dir
file: > file: >
src="{{ analytics_api_home }}/venvs/{{ analytics_api_service_name }}/bin/{{ item }}" src="{{ analytics_api_home }}/venvs/{{ analytics_api_service_name }}/bin/{{ item }}"
dest="{{ COMMON_BIN_DIR }}/{{ item.split('.')[0] }}.analytics-api" dest="{{ COMMON_BIN_DIR }}/{{ item.split('.')[0] }}.analytics_api"
state=link state=link
with_items: with_items:
- python - python
...@@ -120,7 +120,7 @@ ...@@ -120,7 +120,7 @@
- name: create symlinks from the repo dir - name: create symlinks from the repo dir
file: > file: >
src="{{ analytics_api_code_dir }}/{{ item }}" src="{{ analytics_api_code_dir }}/{{ item }}"
dest="{{ COMMON_BIN_DIR }}/{{ item.split('.')[0] }}.analytics-api" dest="{{ COMMON_BIN_DIR }}/{{ item.split('.')[0] }}.analytics_api"
state=link state=link
with_items: with_items:
- manage.py - manage.py
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
# {{ ansible_managed }} # {{ ansible_managed }}
{% if COMMON_ENABLE_NEWRELIC_APP %} {% if COMMON_ENABLE_NEWRELIC_APP %}
{% set analytics_api_venv_bin = analytics_api_home + "/venvs/" + analytics_api_service_name + "/bin/" %}
{% set executable = analytics_api_venv_bin + '/newrelic-admin run-program ' + analytics_api_venv_bin + '/gunicorn' %} {% set executable = analytics_api_venv_bin + '/newrelic-admin run-program ' + analytics_api_venv_bin + '/gunicorn' %}
{% else %} {% else %}
{% set executable = analytics_api_venv_bin + '/gunicorn' %} {% set executable = analytics_api_venv_bin + '/gunicorn' %}
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
[program:{{ analytics_api_service_name }}] [program:{{ analytics_api_service_name }}]
command={{ analytics_api_home }}/analytics-api.sh command={{ analytics_api_home }}/{{ analytics_api_service_name }}.sh
user={{ common_web_user }} user={{ common_web_user }}
directory={{ analytics_api_code_dir }} directory={{ analytics_api_code_dir }}
stdout_logfile={{ supervisor_log_dir }}/%(program_name)-stdout.log stdout_logfile={{ supervisor_log_dir }}/%(program_name)-stdout.log
......
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