Commit 86fec7d5 by Edward Zarecor Committed by GitHub

Merge pull request #3322 from edx/e0d/extending-automated

Adding automated to edxapp and discovery plays
parents 38c9838e 3ff6ee7b
...@@ -9,6 +9,8 @@ ...@@ -9,6 +9,8 @@
CLUSTER_NAME: 'discovery' CLUSTER_NAME: 'discovery'
roles: roles:
- aws - aws
- role: automated
AUTOMATED_USERS: "{{ DISCOVERY_AUTOMATED_USERS | default({}) }}"
- role: nginx - role: nginx
nginx_default_sites: nginx_default_sites:
- discovery - discovery
......
...@@ -7,22 +7,24 @@ ...@@ -7,22 +7,24 @@
CLUSTER_NAME: 'edxapp' CLUSTER_NAME: 'edxapp'
serial: "{{ serial_count }}" serial: "{{ serial_count }}"
roles: roles:
- aws - aws
- role: nginx - role: automated
nginx_sites: AUTOMATED_USERS: "{{ EDXAPP_AUTOMATED_USERS | default({}) }}"
- lms - role: nginx
- cms nginx_sites:
nginx_default_sites: - lms
- lms - cms
nginx_extra_sites: "{{ NGINX_EDXAPP_EXTRA_SITES }}" nginx_default_sites:
nginx_extra_configs: "{{ NGINX_EDXAPP_EXTRA_CONFIGS }}" - lms
nginx_redirects: "{{ NGINX_EDXAPP_CUSTOM_REDIRECTS }}" nginx_extra_sites: "{{ NGINX_EDXAPP_EXTRA_SITES }}"
- edxapp nginx_extra_configs: "{{ NGINX_EDXAPP_EXTRA_CONFIGS }}"
- role: datadog nginx_redirects: "{{ NGINX_EDXAPP_CUSTOM_REDIRECTS }}"
when: COMMON_ENABLE_DATADOG - edxapp
- role: splunkforwarder - role: datadog
when: COMMON_ENABLE_SPLUNKFORWARDER when: COMMON_ENABLE_DATADOG
- role: newrelic - role: splunkforwarder
when: COMMON_ENABLE_NEWRELIC when: COMMON_ENABLE_SPLUNKFORWARDER
- role: minos - role: newrelic
when: COMMON_ENABLE_MINOS when: COMMON_ENABLE_NEWRELIC
- role: minos
when: COMMON_ENABLE_MINOS
...@@ -166,6 +166,19 @@ DISCOVERY_HOSTNAME: '~^((stage|prod)-)?discovery.*' ...@@ -166,6 +166,19 @@ DISCOVERY_HOSTNAME: '~^((stage|prod)-)?discovery.*'
nginx_discovery_gunicorn_hosts: nginx_discovery_gunicorn_hosts:
- 127.0.0.1 - 127.0.0.1
# Vars that are used when the automated role is "mixed-in" via the deploying play
# This data structure specifies all the users with access to run command remotely
# over SSH and the fully qualified command that they can run via sudo to the
# application user
DISCOVERY_AUTOMATED_USERS:
automated_user:
sudo_commands:
- command: "{{ discovery_venv_dir }}/python {{ discovery_home }}/{{ discovery_service_name }}/manage.py migrate --list"
sudo_user: "discovery"
authorized_keys:
- "SSH authorized key"
# #
# vars are namespace with the module name. # vars are namespace with the module name.
# #
......
...@@ -351,20 +351,18 @@ EDXAPP_PYTHON_SANDBOX: true ...@@ -351,20 +351,18 @@ EDXAPP_PYTHON_SANDBOX: true
# it puts the sandbox in 'complain' mode, for reporting but not enforcement # it puts the sandbox in 'complain' mode, for reporting but not enforcement
EDXAPP_SANDBOX_ENFORCE: true EDXAPP_SANDBOX_ENFORCE: true
# Supply authorized keys used for remote management via the user # Vars that are used when the automated role is "mixed-in" via the deploying play
# role. # This data structure specifies all the users with access to run command remotely
EDXAPP_AUTOMATOR_NAME: automator # over SSH and the fully qualified command that they can run via sudo to the
EDXAPP_AUTOMATOR_AUTHORIZED_KEYS: [] # application user
# These are the commands allowed by the automator role.
# The --settings parameter must be set at the end so that EDXAPP_AUTOMATED_USERS:
# is caught by the glob. automated_user:
# Example: sudo -u www-data /edx/bin/python.edxapp /edx/bin/manage.edxapp lms migrate --settings=aws sudo_commands:
EDXAPP_AUTOMATOR_SUDO_CMDS: - command: "{{ edxapp_venv_bin }}/python {{ edxapp_code_dir }}/manage.py lms migrate --list --settings=aws"
- "ALL=({{ common_web_user }}) NOPASSWD:SETENV:{{ COMMON_BIN_DIR }}/python.edxapp {{ COMMON_BIN_DIR }}/manage.edxapp lms migrate *" sudo_user: "edxapp"
- "ALL=({{ common_web_user }}) NOPASSWD:SETENV:{{ COMMON_BIN_DIR }}/python.edxapp {{ COMMON_BIN_DIR }}/manage.edxapp cms migrate *" authorized_keys:
- "ALL=({{ common_web_user }}) NOPASSWD:SETENV:{{ COMMON_BIN_DIR }}/python.edxapp {{ COMMON_BIN_DIR }}/manage.edxapp lms seed_permissions_roles *" - "SSH authorized key"
- "ALL=({{ common_web_user }}) NOPASSWD:SETENV:{{ COMMON_BIN_DIR }}/python.edxapp {{ COMMON_BIN_DIR }}/manage.edxapp lms set_staff *"
- "ALL=({{ common_web_user }}) NOPASSWD:SETENV:{{ COMMON_BIN_DIR }}/python.edxapp {{ COMMON_BIN_DIR }}/manage.edxapp lms transfer_students *"
EDXAPP_USE_GIT_IDENTITY: false EDXAPP_USE_GIT_IDENTITY: false
# Paste the contents of the git identity # Paste the contents of the git identity
......
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