Commit e7d0b841 by John Jarvis

updating from mastser

parents e1ec25b7 d5cc4d9f
......@@ -8,3 +8,4 @@ John Kern <kern3020@gmail.com>
Will Daly <will@edx.org>
Bethany LaPenta <lapentab@mit.edu>
Jay Zoldak <jzoldak@edx.org>
Philippe Chiu <philippe.chiu@gmail.com>
......@@ -2,6 +2,7 @@
hosts: localhost
connection: local
gather_facts: False
pre_tasks:
roles:
- role: launch_ec2
keypair: "{{ keypair }}"
......@@ -13,6 +14,7 @@
root_ebs_size: "{{ root_ebs_size }}"
dns_name: "{{ dns_name }}"
dns_zone: "{{ dns_zone }}"
terminate_instance: true
- name: Configure instance(s)
hosts: launched
......
......@@ -33,10 +33,11 @@
roles:
- common
- role: nginx
nginx_conf: true
nginx_sites:
- lms
- cms
- lms-preview
- {'role': 'edxapp', 'openid_workaround': true}
- {'role': 'edxapp', 'openid_workaround': true, 'template_subdir': 'cme'}
# run this role last
# - in_production
# this gets all running prod webservers
#- hosts: tag_environment_prod:&tag_function_ora
# or we can get subsets of them by name
- hosts: ~tag_Name_ora(10|11)_prod
#- hosts: ~tag_Name_ora(10|11)_prod
- hosts: ~tag_Name_ora10_prod
#- hosts: ~tag_Name_ora11_prod
#- hosts: security_group_edx-prod-EdxappServerSecurityGroup-NSKCQTMZIPQB
sudo: True
vars:
......
#!/usr/bin/python
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
DOCUMENTATION = '''
---
module: ec2_lookup
short_description: returns a list of ec2 instances that meet search criteria
description:
- Returns a list of ec2 instances that meet search criteria
version_added: "1.4"
options:
region:
description:
- The AWS region to use. Must be specified if ec2_url
is not used. If not specified then the value of the
EC2_REGION environment variable, if any, is used.
required: false
default: null
aliases: [ 'aws_region', 'ec2_region' ]
aws_secret_key:
description:
- AWS secret key. If not set then the value of
the AWS_SECRET_KEY environment variable is used.
required: false
default: null
aliases: [ 'ec2_secret_key', 'secret_key' ]
aws_access_key:
description:
- AWS access key. If not set then the value of the
AWS_ACCESS_KEY environment variable is used.
required: false
default: null
aliases: [ 'ec2_access_key', 'access_key' ]
tags:
desription:
- tags to lookup
required: false
default: null
type: dict
aliases: []
requirements: [ "boto" ]
author: John Jarvis
'''
EXAMPLES = '''
# Note: None of these examples set aws_access_key, aws_secret_key, or region.
# It is assumed that their matching environment variables are set.
# Return all instances that match the tag "Name: foo"
- local_action:
module: ec2_lookup
tags:
Name: foo
'''
import sys
AWS_REGIONS = ['ap-northeast-1',
'ap-southeast-1',
'ap-southeast-2',
'eu-west-1',
'sa-east-1',
'us-east-1',
'us-west-1',
'us-west-2']
try:
import boto.ec2
from boto.ec2 import connect_to_region
except ImportError:
print "failed=True msg='boto required for this module'"
sys.exit(1)
def main():
module=AnsibleModule(
argument_spec=dict(
ec2_url=dict(),
region=dict(aliases=['aws_region', 'ec2_region'],
choices=AWS_REGIONS),
aws_secret_key=dict(aliases=['ec2_secret_key', 'secret_key'],
no_log=True),
aws_access_key=dict(aliases=['ec2_access_key', 'access_key']),
tags=dict(default=None, type='dict'),
)
)
tags = module.params.get('tags')
aws_secret_key = module.params.get('aws_secret_key')
aws_access_key = module.params.get('aws_access_key')
region = module.params.get('region')
ec2_url = module.params.get('ec2_url')
# If we have a region specified, connect to its endpoint.
if region:
try:
ec2 = connect_to_region(region, aws_access_key_id=aws_access_key,
aws_secret_access_key=aws_secret_key)
except boto.exception.NoAuthHandlerFound, e:
module.fail_json(msg=str(e))
# If we specified an ec2_url then try connecting to it
elif ec2_url:
try:
ec2 = boto.connect_ec2_endpoint(ec2_url, aws_access_key,
aws_secret_key)
except boto.exception.NoAuthHandlerFound, e:
module.fail_json(msg=str(e))
else:
module.fail_json(msg="Either region or ec2_url must be specified")
instances = []
instance_ids = []
for res in ec2.get_all_instances(filters={'tag:' + tag: value
for tag, value in tags.iteritems()}):
for inst in res.instances:
if inst.state == "running":
instances.append({k: v for k, v in inst.__dict__.iteritems()
if isinstance(v, (basestring))})
instance_ids.append(inst.id)
module.exit_json(changed=False, instances=instances,
instance_ids=instance_ids)
# this is magic, see lib/ansible/module_common.py
#<<INCLUDE_ANSIBLE_MODULE_COMMON>>
main()
---
#
# edX Configuration
#
# github: https://github.com/edx/configuration
# wiki: https://github.com/edx/configuration/wiki
# code style: https://github.com/edx/configuration/wiki/Ansible-Coding-Conventions
# license: https://github.com/edx/configuration/blob/master/LICENSE.TXT
#
#
# Vars for role analytics
# vars are namespace with the module name.
#
ANALYTICS_DB_ANALYTICS_PASSWORD: 'CHANGEME!'
ANALYTICS_DB_ANALYTICS_USER: 'analytics001'
ANALYTICS_DB_ANALYTICS_HOST: 'localhost'
ANALYTICS_SERVER_PORT: '9000'
ANALYTICS_ENV_LANG: 'en_US.UTF-8'
ANALYTICS_LOG_LEVEL: 'INFO'
ANALYTICS_WORKERS: '4'
DATABASES:
default: &databases_default
ENGINE: 'django.db.backends.mysql'
NAME: 'wwc'
USER: 'analytics001'
PASSWORD: 'CHANGEME!'
HOST: 'CHANGEME'
PORT: 3306
analytics_auth_config:
DATABASES:
analytics:
<<: *databases_default
USER: $ANALYTICS_DB_ANALYTICS_USER
PASSWORD: $ANALYTICS_DB_ANALYTICS_PASSWORD
HOST: $ANALYTICS_DB_ANALYTICS_HOST
ANALYTICS_API_KEY: $ANALYTICS_API_KEY
ANALYTICS_RESULTS_DB:
MONGO_URI: $ANALYTICS_DB_RESULTS_URL
MONGO_DB: $ANALYTICS_DB_RESULTS_DB
MONGO_STORED_QUERIES_COLLECTION: $ANALYTICS_DB_RESULTS_COLLECTION
analytics_role_name: "analytics"
analytics_user: "analytics"
analytics_home: "/opt/wwc/analytics"
analytics_venv_dir: "{{ analytics_home }}/virtualenvs/analytics"
analytics_source_repo: "git@github.com:edx/analytics-server.git"
analytics_code_dir: "{{ analytics_home }}/src"
analytics_version: "master"
analytics_git_identity_path: "{{ secure_dir }}/files/git-identity"
analytics_git_identity_dest: "/etc/{{ analytics_role_name }}.git-identity"
analytics_git_ssh: "/tmp/{{ analytics_role_name }}.git_ssh.sh"
analytics_requirements_file: "{{ analytics_code_dir }}/requirements.txt"
analytics_rsyslog_enabled: "yes"
analytics_web_user: "www-data"
analytics_env: "analytics_env"
analytics_service_variant: 'analytics'
analytics_django_settings: 'anserv.settings'
analytics_env_vars:
ANALYTICS_LOG_LEVEL: "{{ ANALYTICS_LOG_LEVEL }}"
#
# Used by the included role, automated.
# See meta/main.yml
#
analytics_automated_rbash_links:
- /usr/bin/sudo
- /usr/bin/scp
#
# OS packages
#
analytics_debian_pkgs:
- mongodb-clients
- zip
- libmysqlclient-dev
analytics_redhat_pkgs:
- zip
- community-mysql-libs
#
# Installed via pip to get the IAM role feature.
#
analytics_pip_pkgs:
- git+https://github.com/s3tools/s3cmd.git#egg=s3cmd
\ No newline at end of file
---
#
# edX Configuration
#
# github: https://github.com/edx/configuration
# wiki: https://github.com/edx/configuration/wiki
# code style: https://github.com/edx/configuration/wiki/Ansible-Coding-Conventions
# license: https://github.com/edx/configuration/blob/master/LICENSE.TXT
#
#
#
# Handlers for role analytics
#
# Overview:
#
#
- name: analytics | stop the analytics service
service: name=analytics state=stopped
- name: analytics | start the analytics service
service: name=analytics state=started
#
# TODO: Needed while this repo is private
#
- name: analytics | upload ssh script
template:
src=tmp/{{ analytics_role_name }}.git_ssh.sh.j2 dest={{ analytics_git_ssh }}
force=yes owner=root group=adm mode=750
tags:
- analytics
- deploy
- install
- update
#
# TODO: Needed while this repo is private
#
- name: analytics | install read-only ssh key required for checkout
copy:
src={{ analytics_git_identity_path }} dest={{ analytics_git_identity_dest }}
force=yes owner=ubuntu group=adm mode=0600
tags:
- analytics
- deploy
- install
- update
- name: analytics | checkout code
git:
dest={{ analytics_code_dir }} repo={{ analytics_source_repo }}
version={{ analytics_version }} force=true
environment:
GIT_SSH: $analytics_git_ssh
notify: analytics | restart the analytics service
notify: analytics | start the analytics service
tags:
- analytics
- deploy
- install
- update
#
# TODO: Needed while this repo is private
#
- name: analytics | update src permissions
file:
path={{ analytics_code_dir }} state=directory owner={{ analytics_user }}
group={{ analytics_web_user }} mode=2750 recurse=yes
tags:
- analytics
- deploy
- install
- update
#
# TODO: Needed while this repo is private
#
- name: analytics | remove read-only ssh key for the content repo
file: path={{ analytics_git_identity_dest }} state=absent
tags:
- analytics
- deploy
- install
- update
#
# TODO: Needed while this repo is private
#
- name: analytics | remove ssh script
file: path={{ analytics_git_ssh }} state=absent
tags:
- analytics
- deploy
- install
- update
- name: analytics | install application requirements
pip:
requirements={{ analytics_requirements_file }}
virtualenv={{ analytics_venv_dir }} state=present
sudo: true
sudo_user: "{{ analytics_user }}"
notify: analytics | start the analytics service
tags:
- analytics
- deploy
- install
- update
# {{ ansible_managed }}
description "Analytics gunicorn"
start on runlevel [2345]
stop on runlevel [!2345]
respawn
respawn limit 3 30
env SERVICE_VARIANT={{ analytics_service_variant }}
env PID=/var/tmp/analytics.pid
env WORKERS={{ ANALYTICS_WORKERS }}
env PORT={{ ANALYTICS_SERVER_PORT }}
env LANG={{ ANALYTICS_ENV_LANG }}
env DJANGO_SETTINGS_MODULE={{ analytics_django_settings }}
chdir {{ analytics_code_dir }}
setuid {{ analytics_web_user }}
exec {{ analytics_venv_dir }}/bin/gunicorn -b 0.0.0.0:$PORT -w $WORKERS --pythonpath={{ analytics_code_dir }}/anserv anserv.wsgi
# {{ ansible_managed }}
{% for name,value in analytics_env_vars.items() %}
{% if value %}
export {{ name }}="{{ value }}"
{% endif %}
{% endfor %}
#!/bin/sh
exec /usr/bin/ssh -o StrictHostKeyChecking=no -i {{ analytics_git_identity_dest }} "$@"
......@@ -18,7 +18,10 @@ automated_role_name: automated
automated_user: "automator"
automated_home: "/home/automator"
automated_rbash_links: !!null
#
automated_sudoers_template: !!null
automated_sudoers_file: !!null
#
# OS packages
#
......
......@@ -68,10 +68,10 @@
- name: automated | create sudoers file from file
copy:
dest=/etc/sudoers.d/{{ automated_sudoers_file.split('/').pop() }}
dest=/etc/sudoers.d/{{ automated_sudoers_dest }}
src={{ automated_sudoers_file }} owner="root"
group="root" mode=0440 validate='visudo -cf %s'
when: automated_sudoers_file is defined
when: automated_sudoers_file
tags:
- automated
- install
......@@ -79,10 +79,10 @@
- name: automated | create sudoers file from template
template:
dest=/etc/sudoers.d/{{ automated_sudoers_file.split('/').pop() }}
dest=/etc/sudoers.d/{{ automated_sudoers_dest }}
src={{ automated_sudoers_template }} owner="root"
group="root" mode=0440 validate='visudo -cf %s'
when: automated_sudoers_template is defined
when: automated_sudoers_template
tags:
- automated
- install
......
......@@ -10,5 +10,6 @@ nltk_data_dir: /usr/share/nltk_data
ease_branch: master
discern_branch: dev
discern_gunicorn_port: 8070
discern_gunicorn_host: 127.0.0.1
discern_user: discern
site_name: discern
......@@ -12,10 +12,11 @@ respawn limit 3 30
env PID=/var/run/gunicorn/discern.pid
env WORKERS={{ ansible_processor_cores * 2 }}
env PORT={{ discern_gunicorn_port }}
env ADDRESS={{ discern_gunicorn_host }}
env LANG=en_US.UTF-8
env DJANGO_SETTINGS_MODULE={{discern_settings}}
chdir {{discern_dir}}
setuid {{discern_user}}
exec {{venv_dir}}/bin/gunicorn --preload -b 127.0.0.1:$PORT -w $WORKERS --timeout=30 --pythonpath={{discern_dir}} discern.wsgi
exec {{venv_dir}}/bin/gunicorn --preload -b $ADDRESS:$PORT -w $WORKERS --timeout=30 --pythonpath={{discern_dir}} discern.wsgi
......@@ -238,18 +238,15 @@ lms_preview_env_config:
edx_platform_code_dir: "{{ app_base_dir }}/edx-platform"
# gunicorn ports, these shouldn't need to be overridden
# gunicorn ports/hosts, these shouldn't need to be overridden
edxapp_cms_gunicorn_port: 8010
edxapp_cms_gunicorn_host: 127.0.0.1
edxapp_lms_gunicorn_port: 8000
edxapp_lms_gunicorn_host: 127.0.0.1
edxapp_lms_preview_gunicorn_port: 8020
edxapp_lms_preview_gunicorn_host: 127.0.0.1
edxapp_cms_app_address: 127.0.0.1
edxapp_lms_app_address: 127.0.0.1
edxapp_lms_preview_app_address: 127.0.0.1
# These vars are for creating the application json config
# files. There are two for each service that uses the
# 'edx-platform' code. Defining them will create the upstart
......
......@@ -17,7 +17,7 @@ env WORKERS={{ ansible_processor|length * worker_core_mult.cms }}
env WORKERS={{ worker_core_mult.cms }}
{% endif %}
env PORT={{edxapp_cms_gunicorn_port}}
env ADDRESS={{edxapp_cms_app_address}}
env ADDRESS={{edxapp_cms_gunicorn_host}}
env LANG=en_US.UTF-8
env DJANGO_SETTINGS_MODULE=cms.envs.aws
env SERVICE_VARIANT="cms"
......
......@@ -18,7 +18,7 @@ env WORKERS={{ ansible_processor|length * worker_core_mult.lms_preview }}
env WORKERS={{ worker_core_mult.lms_preview }}
{% endif %}
env PORT={{edxapp_lms_preview_gunicorn_port}}
env ADDRESS={{edxapp_lms_preview_app_address}}
env ADDRESS={{edxapp_lms_preview_gunicorn_host}}
env LANG=en_US.UTF-8
env DJANGO_SETTINGS_MODULE=lms.envs.aws
env SERVICE_VARIANT="lms-preview"
......
......@@ -15,7 +15,7 @@ env WORKERS={{ ansible_processor|length * worker_core_mult.lms }}
env WORKERS={{ worker_core_mult.lms }}
{% endif %}
env PORT={{edxapp_lms_gunicorn_port}}
env ADDRESS={{edxapp_lms_app_address}}
env ADDRESS={{edxapp_lms_gunicorn_host}}
env LANG=en_US.UTF-8
env DJANGO_SETTINGS_MODULE={{ edxapp_lms_env }}
env SERVICE_VARIANT="lms"
......
# Launches an ec2 instance and blocks until the instance is up
# adds it to the host group
# Will terminate an instance if one and only one already exists
# with the same name
- name: lookup tags for terminating existing instance
local_action:
module: ec2_lookup
region: "{{ region }}"
tags:
Name: "{{ name_tag }}"
register: tag_lookup
when: terminate_instance == true
- debug: msg="Too many results returned, not terminating!"
when: terminate_instance == true and tag_lookup.instance_ids|length > 1
- name: terminating single instance
local_action:
module: ec2
state: 'absent'
region: "{{ region }}"
instance_ids: ${tag_lookup.instance_ids}
when: terminate_instance == true and tag_lookup.instance_ids|length == 1
- name: launch_ec2 | Launch ec2 instance
local_action:
......
......@@ -4,6 +4,18 @@ pkgs:
nginx:
state: installed
nginx_xserver_gunicorn_hosts:
- 127.0.0.1
nginx_xqueue_gunicorn_hosts:
- 127.0.0.1
nginx_ora_gunicorn_hosts:
- 127.0.0.1
nginx_lms_gunicorn_hosts:
- 127.0.0.1
nginx_lms_preview_gunicorn_hosts:
- 127.0.0.1
nginx_cms_gunicorn_hosts:
- 127.0.0.1
nginx_cfg:
# - link - turn on
......
upstream cms-backend {
# For a TCP configuration:
server 127.0.0.1:{{ edxapp_cms_gunicorn_port }} fail_timeout=0;
{% for host in nginx_cms_gunicorn_hosts %}
server {{ host }}:{{ edxapp_cms_gunicorn_port }} fail_timeout=0;
{% endfor %}
}
server {
......
upstream lms-preview-backend {
# For a TCP configuration:
server 127.0.0.1:{{ edxapp_lms_preview_gunicorn_port }} fail_timeout=0;
{% for host in nginx_lms_preview_gunicorn_hosts %}
server {{ host }}:{{ edxapp_lms_preview_gunicorn_port }} fail_timeout=0;
{% endfor %}
}
server {
......
upstream lms-backend {
# For a TCP configuration:
server 127.0.0.1:{{ edxapp_lms_gunicorn_port }} fail_timeout=0;
{% for host in nginx_lms_gunicorn_hosts %}
server {{ host }}:{{ edxapp_lms_gunicorn_port }} fail_timeout=0;
{% endfor %}
}
server {
......
upstream app_server {
# For a TCP configuration:
server 127.0.0.1:{{ ora_gunicorn_port }} fail_timeout=0;
{% for host in nginx_ora_gunicorn_hosts %}
server {{ host }}:{{ ora_gunicorn_port }} fail_timeout=0;
{% endfor %}
}
server {
......
upstream xqueue_app_server {
# For a TCP configuration:
server 127.0.0.1:{{ xqueue_gunicorn_port }} fail_timeout=0;
{% for host in nginx_xqueue_gunicorn_hosts %}
server {{ host }}:{{ xqueue_gunicorn_port }} fail_timeout=0;
{% endfor %}
}
server {
......
......@@ -9,8 +9,9 @@
# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
##
upstream xserver_app_server {
# For a TCP configuration:
server 127.0.0.1:{{ xserver_gunicorn_port }} fail_timeout=0;
{% for host in nginx_xserver_gunicorn_hosts %}
server {{ host }}:{{ xserver_gunicorn_port }} fail_timeout=0;
{% endfor %}
}
server {
......
......@@ -13,6 +13,7 @@ ora_venv_dir: "{{ ora_user_home }}/virtualenvs/{{ ora_user }}"
ease_venv_dir: "{{ ora_venv_dir }}"
ora_gunicorn_workers: 4
ora_gunicorn_port: 8060
ora_gunicorn_host: 127.0.0.1
# ora_env_config and ora_auth_config
# should be overridden for your
......
......@@ -12,6 +12,7 @@ respawn limit 3 30
env PID=/var/run/gunicorn/edx-ora.pid
env WORKERS={{ ora_gunicorn_workers }}
env PORT={{ ora_gunicorn_port }}
env ADDRESS={{ ora_gunicorn_host }}
env LANG=en_US.UTF-8
env DJANGO_SETTINGS_MODULE=edx_ora.aws
env SERVICE_VARIANT=ora
......@@ -22,4 +23,4 @@ end script
chdir {{ ora_code_dir }}
setuid {{ ora_user }}
exec {{ ora_venv_dir}}/bin/gunicorn --preload -b 127.0.0.1:$PORT -w $WORKERS --timeout=90 --pythonpath={{ ora_code_dir}} edx_ora.wsgi
exec {{ ora_venv_dir}}/bin/gunicorn --preload -b $ADDRESS:$PORT -w $WORKERS --timeout=90 --pythonpath={{ ora_code_dir}} edx_ora.wsgi
......@@ -11,6 +11,7 @@ xqueue_code_dir: "{{ app_base_dir }}/xqueue"
# to serve all content on port 80
xqueue_code_dir: "{{ app_base_dir }}/xqueue"
xqueue_gunicorn_port: 8040
xqueue_gunicorn_host: 127.0.0.1
xqueue_user: "xqueue"
xqueue_user_home: "/opt/xqueue"
......@@ -27,7 +28,7 @@ XQUEUE_LOGGING_ENV: sandbox
XQUEUE_SYSLOG_SERVER: 'syslog.a.m.i4x.org'
XQUEUE_S3_BUCKET : 'sandbox-bucket'
XQUEUE_S3_PATH_PREFIX: 'sandbox-xqueue'
XQUEUE_LOCAL_LOGLEVEL: 'DEBUG'
XQUEUE_LOCAL_LOGLEVEL: 'INFO'
XQUEUE_AWS_ACCESS_KEY_ID : ''
XQUEUE_AWS_SECRET_ACCESS_KEY : ''
XQUEUE_BASIC_AUTH: ['edx', 'edx']
......@@ -35,6 +36,7 @@ XQUEUE_DJANGO_USER: 'lms'
XQUEUE_DJANGO_PASSWORD: 'password'
XQUEUE_RABBITMQ_USER: 'edx'
XQUEUE_RABBITMQ_PASS: 'edx'
XQUEUE_RABBITMQ_HOSTNAME: 'localhost'
XQUEUE_MYSQL_DB_NAME: 'xqueue'
XQUEUE_MYSQL_USER: 'root'
......@@ -48,7 +50,7 @@ xqueue_env_config:
LOGGING_ENV : $XQUEUE_LOGGING_ENV
SYSLOG_SERVER: $XQUEUE_SYSLOG_SERVER
LOG_DIR : "{{ storage_base_dir }}/logs/xqueue"
RABBIT_HOST : $XQUEUE_RABBIT_HOSTNAME
RABBIT_HOST : $XQUEUE_RABBITMQ_HOSTNAME
S3_BUCKET : $XQUEUE_S3_BUCKET
S3_PATH_PREFIX: $XQUEUE_S3_PATH_PREFIX
LOCAL_LOGLEVEL: $XQUEUE_LOCAL_LOGLEVEL
......
......@@ -13,6 +13,7 @@ env WORKERS={{ ansible_processor|length * 2 }}
env WORKERS=2
{% endif %}
env PORT={{ xqueue_gunicorn_port }}
env ADDRESS={{ xqueue_gunicorn_host }}
env LANG=en_US.UTF-8
env DJANGO_SETTINGS_MODULE=xqueue.aws_settings
env SERVICE_VARIANT="xqueue"
......@@ -21,4 +22,4 @@ env SERVICE_VARIANT="xqueue"
chdir {{ xqueue_code_dir }}
setuid {{ xqueue_user }}
exec {{ xqueue_venv_dir }}/bin/gunicorn --preload -b 127.0.0.1:$PORT -w $WORKERS --timeout=300 --pythonpath={{ xqueue_code_dir }} xqueue.wsgi
exec {{ xqueue_venv_dir }}/bin/gunicorn --preload -b $ADDRESS:$PORT -w $WORKERS --timeout=300 --pythonpath={{ xqueue_code_dir }} xqueue.wsgi
......@@ -38,6 +38,7 @@ xserver_sandbox_venv_dir: "{{ venv_dir }}_apparmor_sandbox"
xserver_requirements_file: "{{ xserver_code_dir }}/requirements.txt"
xserver_gunicorn_port: 8050
xserver_gunicorn_host: 8050
xserver_debian_pkgs:
- build-essential
......
......@@ -14,6 +14,7 @@ env NEW_RELIC_CONFIG_FILE={{ app_base_dir }}/newrelic.ini
env NEWRELIC={{ venv_dir }}/bin/newrelic-admin
env WORKERS={{ ansible_processor|length }}
env PORT={{ xserver_gunicorn_port }}
env ADDRESS={{ xserver_gunicorn_host }}
env LANG=en_US.UTF-8
env DJANGO_SETTINGS_MODULE=xserver_aws_settings
env SERVICE_VARIANT="xserver"
......@@ -22,5 +23,5 @@ env SERVICE_VARIANT="xserver"
chdir {{ xserver_code_dir }}
setuid www-data
exec {{ venv_dir }}/bin/gunicorn --preload -b 127.0.0.1:$PORT -w $WORKERS --timeout=30 --pythonpath={{ xserver_code_dir }} pyxserver_wsgi:application
exec {{ venv_dir }}/bin/gunicorn --preload -b $ADDRESS:$PORT -w $WORKERS --timeout=30 --pythonpath={{ xserver_code_dir }} pyxserver_wsgi:application
......@@ -78,6 +78,7 @@ ami: $ami
region: $region
instance_tags: '{"environment": "$environment", "github_username": "$github_username", "Name": "$name_tag", "source": "jenkins", "owner": "$BUILD_USER"}'
root_ebs_size: $root_ebs_size
name_tag: $name_tag
pip_index_url: 'https://pypi.edx.org/root/pypi/+simple/'
gh_users:
- user: jarv
......
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