Commit a38d87ef by Edward Zarecor

Merge pull request #2509 from edx/e0d/edxapp-tags

E0d/edxapp tags
parents 86c0af33 38573310
...@@ -3,11 +3,17 @@ ...@@ -3,11 +3,17 @@
src=edxapp_env.j2 dest={{ edxapp_app_dir }}/edxapp_env src=edxapp_env.j2 dest={{ edxapp_app_dir }}/edxapp_env
owner={{ edxapp_user }} group={{ common_web_user }} owner={{ edxapp_user }} group={{ common_web_user }}
mode=0644 mode=0644
tags:
- install
- install:configuration
- name: create edxapp configuration dir - name: create edxapp configuration dir
file: > file: >
path="{{ EDXAPP_CFG_DIR }}" state=directory path="{{ EDXAPP_CFG_DIR }}" state=directory
owner="{{ edxapp_user }}" group="{{ common_web_group }}" owner="{{ edxapp_user }}" group="{{ common_web_group }}"
tags:
- install
- install:configuration
# Optional auth for git # Optional auth for git
- name: create ssh script for git (not authenticated) - name: create ssh script for git (not authenticated)
...@@ -15,22 +21,34 @@ ...@@ -15,22 +21,34 @@
src=git_ssh_noauth.sh.j2 dest={{ edxapp_git_ssh }} src=git_ssh_noauth.sh.j2 dest={{ edxapp_git_ssh }}
owner={{ edxapp_user }} mode=750 owner={{ edxapp_user }} mode=750
when: not EDXAPP_USE_GIT_IDENTITY when: not EDXAPP_USE_GIT_IDENTITY
tags:
- install
- install:base
- name: create ssh script for git (authenticated) - name: create ssh script for git (authenticated)
template: > template: >
src=git_ssh_auth.sh.j2 dest={{ edxapp_git_ssh }} src=git_ssh_auth.sh.j2 dest={{ edxapp_git_ssh }}
owner={{ edxapp_user }} mode=750 owner={{ edxapp_user }} mode=750
when: EDXAPP_USE_GIT_IDENTITY when: EDXAPP_USE_GIT_IDENTITY
tags:
- install
- install:base
- name: install read-only ssh key - name: install read-only ssh key
copy: > copy: >
content="{{ EDXAPP_GIT_IDENTITY }}" dest={{ edxapp_git_identity }} content="{{ EDXAPP_GIT_IDENTITY }}" dest={{ edxapp_git_identity }}
force=yes owner={{ edxapp_user }} mode=0600 force=yes owner={{ edxapp_user }} mode=0600
when: EDXAPP_USE_GIT_IDENTITY when: EDXAPP_USE_GIT_IDENTITY
tags:
- install
- install:base
- name: set git fetch.prune to ignore deleted remote refs - name: set git fetch.prune to ignore deleted remote refs
shell: git config --global fetch.prune true shell: git config --global fetch.prune true
sudo_user: "{{ edxapp_user }}" sudo_user: "{{ edxapp_user }}"
tags:
- install
- install:base
# Do A Checkout # Do A Checkout
- name: checkout edx-platform repo into {{ edxapp_code_dir }} - name: checkout edx-platform repo into {{ edxapp_code_dir }}
...@@ -43,10 +61,16 @@ ...@@ -43,10 +61,16 @@
environment: environment:
GIT_SSH: "{{ edxapp_git_ssh }}" GIT_SSH: "{{ edxapp_git_ssh }}"
register: edxapp_platform_checkout register: edxapp_platform_checkout
tags:
- install
- install:code
- name: git clean after checking out edx-platform - name: git clean after checking out edx-platform
shell: cd {{ edxapp_code_dir }} && git clean -xdf shell: cd {{ edxapp_code_dir }} && git clean -xdf
sudo_user: "{{ edxapp_user }}" sudo_user: "{{ edxapp_user }}"
tags:
- install
- install:code
- name: checkout theme - name: checkout theme
git: > git: >
...@@ -59,11 +83,18 @@ ...@@ -59,11 +83,18 @@
environment: environment:
GIT_SSH: "{{ edxapp_git_ssh }}" GIT_SSH: "{{ edxapp_git_ssh }}"
register: edxapp_theme_checkout register: edxapp_theme_checkout
tags:
- install
- install:code
- name: Stat each requirements file to ensure it exists - name: Stat each requirements file to ensure it exists
stat: path="{{ item }}" stat: path="{{ item }}"
with_items: "{{ edxapp_requirements_with_github_urls }}" with_items: "{{ edxapp_requirements_with_github_urls }}"
register: requirement_file_stats register: requirement_file_stats
tags:
- install
- install:code
- install:app-requirements
# Substitute github mirror in all requirements files # Substitute github mirror in all requirements files
# This is run on every single deploy # This is run on every single deploy
...@@ -73,6 +104,10 @@ ...@@ -73,6 +104,10 @@
sudo_user: "{{ edxapp_user }}" sudo_user: "{{ edxapp_user }}"
when: item.stat.exists when: item.stat.exists
with_items: "{{ requirement_file_stats.results }}" with_items: "{{ requirement_file_stats.results }}"
tags:
- install
- install:code
- install:app-requirements
# Ruby plays that need to be run after platform updates. # Ruby plays that need to be run after platform updates.
- name: gem install bundler - name: gem install bundler
...@@ -82,6 +117,9 @@ ...@@ -82,6 +117,9 @@
executable=/bin/bash executable=/bin/bash
environment: "{{ edxapp_environment }}" environment: "{{ edxapp_environment }}"
sudo_user: "{{ edxapp_user }}" sudo_user: "{{ edxapp_user }}"
tags:
- install
- install:app-requirements
- name: bundle install - name: bundle install
shell: > shell: >
...@@ -90,6 +128,9 @@ ...@@ -90,6 +128,9 @@
executable=/bin/bash executable=/bin/bash
sudo_user: "{{ edxapp_user }}" sudo_user: "{{ edxapp_user }}"
environment: "{{ edxapp_environment }}" environment: "{{ edxapp_environment }}"
tags:
- install
- install:app-requirements
# Set the npm registry # Set the npm registry
# This needs to be done as root since npm is weird about # This needs to be done as root since npm is weird about
...@@ -99,19 +140,27 @@ ...@@ -99,19 +140,27 @@
npm config set registry '{{ COMMON_NPM_MIRROR_URL }}' npm config set registry '{{ COMMON_NPM_MIRROR_URL }}'
creates="{{ edxapp_app_dir }}/.npmrc" creates="{{ edxapp_app_dir }}/.npmrc"
environment: "{{ edxapp_environment }}" environment: "{{ edxapp_environment }}"
tags:
- install
- install:app-requirements
# Set the npm registry permissions # Set the npm registry permissions
- name: Set the npm registry permissions - name: Set the npm registry permissions
file: file:
path="{{ edxapp_app_dir }}/.npmrc" path="{{ edxapp_app_dir }}/.npmrc"
owner=edxapp group=edxapp owner=edxapp group=edxapp
tags:
- install
- install:app-requirements
# Node play that need to be run after platform updates. # Node play that need to be run after platform updates.
- name: Install edx-platform npm dependencies - name: Install edx-platform npm dependencies
shell: npm install chdir={{ edxapp_code_dir }} shell: npm install chdir={{ edxapp_code_dir }}
sudo_user: "{{ edxapp_user }}" sudo_user: "{{ edxapp_user }}"
environment: "{{ edxapp_environment }}" environment: "{{ edxapp_environment }}"
tags:
- install
- install:app-requirements
# Install the python pre requirements into {{ edxapp_venv_dir }} # Install the python pre requirements into {{ edxapp_venv_dir }}
- name : install python pre-requirements - name : install python pre-requirements
...@@ -122,6 +171,9 @@ ...@@ -122,6 +171,9 @@
extra_args="-i {{ COMMON_PYPI_MIRROR_URL }} --exists-action w" extra_args="-i {{ COMMON_PYPI_MIRROR_URL }} --exists-action w"
sudo_user: "{{ edxapp_user }}" sudo_user: "{{ edxapp_user }}"
environment: "{{ edxapp_environment }}" environment: "{{ edxapp_environment }}"
tags:
- install
- install:app-requirements
# Install the python modules into {{ edxapp_venv_dir }} # Install the python modules into {{ edxapp_venv_dir }}
- name : install python base-requirements - name : install python base-requirements
...@@ -133,10 +185,16 @@ ...@@ -133,10 +185,16 @@
chdir={{ edxapp_code_dir }} chdir={{ edxapp_code_dir }}
environment: "{{ edxapp_environment }}" environment: "{{ edxapp_environment }}"
sudo_user: "{{ edxapp_user }}" sudo_user: "{{ edxapp_user }}"
tags:
- install
- install:app-requirements
- stat: path="{{ post_requirements_file }}" - stat: path="{{ post_requirements_file }}"
register: post_requirements register: post_requirements
sudo_user: "{{ edxapp_user }}" sudo_user: "{{ edxapp_user }}"
tags:
- install
- install:app-requirements
# Install the python post requirements into {{ edxapp_venv_dir }} # Install the python post requirements into {{ edxapp_venv_dir }}
- name : install python post-requirements - name : install python post-requirements
...@@ -148,6 +206,9 @@ ...@@ -148,6 +206,9 @@
sudo_user: "{{ edxapp_user }}" sudo_user: "{{ edxapp_user }}"
environment: "{{ edxapp_environment }}" environment: "{{ edxapp_environment }}"
when: post_requirements.stat.exists when: post_requirements.stat.exists
tags:
- install
- install:app-requirements
# Install the python paver requirements into {{ edxapp_venv_dir }} # Install the python paver requirements into {{ edxapp_venv_dir }}
- name : install python paver-requirements - name : install python paver-requirements
...@@ -158,12 +219,18 @@ ...@@ -158,12 +219,18 @@
extra_args="-i {{ COMMON_PYPI_MIRROR_URL }} --exists-action w" extra_args="-i {{ COMMON_PYPI_MIRROR_URL }} --exists-action w"
sudo_user: "{{ edxapp_user }}" sudo_user: "{{ edxapp_user }}"
environment: "{{ edxapp_environment }}" environment: "{{ edxapp_environment }}"
tags:
- install
- install:app-requirements
# Install the python custom requirements into {{ edxapp_venv_dir }} # Install the python custom requirements into {{ edxapp_venv_dir }}
- stat: path="{{ custom_requirements_file }}" - stat: path="{{ custom_requirements_file }}"
register: custom_requirements register: custom_requirements
sudo_user: "{{ edxapp_user }}" sudo_user: "{{ edxapp_user }}"
tags:
- install
- install:app-requirements
- name : install python custom-requirements - name : install python custom-requirements
pip: > pip: >
...@@ -174,6 +241,9 @@ ...@@ -174,6 +241,9 @@
sudo_user: "{{ edxapp_user }}" sudo_user: "{{ edxapp_user }}"
environment: "{{ edxapp_environment }}" environment: "{{ edxapp_environment }}"
when: custom_requirements.stat.exists when: custom_requirements.stat.exists
tags:
- install
- install:app-requirements
# Install the final python modules into {{ edxapp_venv_dir }} # Install the final python modules into {{ edxapp_venv_dir }}
- name : install python post-post requirements - name : install python post-post requirements
...@@ -187,6 +257,9 @@ ...@@ -187,6 +257,9 @@
- "{{ github_requirements_file }}" - "{{ github_requirements_file }}"
- "{{ local_requirements_file }}" - "{{ local_requirements_file }}"
sudo_user: "{{ edxapp_user }}" sudo_user: "{{ edxapp_user }}"
tags:
- install
- install:app-requirements
# Private requriements require a ssh key to install, use the same key as the private key for edx-platform # Private requriements require a ssh key to install, use the same key as the private key for edx-platform
# If EDXAPP_INSTALL_PRIVATE_REQUIREMENTS is set to true EDXAPP_USE_GIT_IDENTITY must also be true # If EDXAPP_INSTALL_PRIVATE_REQUIREMENTS is set to true EDXAPP_USE_GIT_IDENTITY must also be true
...@@ -203,6 +276,9 @@ ...@@ -203,6 +276,9 @@
environment: environment:
GIT_SSH: "{{ edxapp_git_ssh }}" GIT_SSH: "{{ edxapp_git_ssh }}"
when: EDXAPP_INSTALL_PRIVATE_REQUIREMENTS when: EDXAPP_INSTALL_PRIVATE_REQUIREMENTS
tags:
- install
- install:app-requirements
# Install any custom extra requirements if defined in EDXAPP_EXTRA_REQUIREMENTS. # Install any custom extra requirements if defined in EDXAPP_EXTRA_REQUIREMENTS.
- name: install python extra requirements - name: install python extra requirements
...@@ -214,6 +290,9 @@ ...@@ -214,6 +290,9 @@
state=present state=present
with_items: EDXAPP_EXTRA_REQUIREMENTS with_items: EDXAPP_EXTRA_REQUIREMENTS
sudo_user: "{{ edxapp_user }}" sudo_user: "{{ edxapp_user }}"
tags:
- install
- install:app-requirements
# If using CAS and you have a function for mapping attributes, install # If using CAS and you have a function for mapping attributes, install
# the module here. The next few tasks set up the python code sandbox # the module here. The next few tasks set up the python code sandbox
...@@ -225,6 +304,9 @@ ...@@ -225,6 +304,9 @@
extra_args="-i {{ COMMON_PYPI_MIRROR_URL }} --exists-action w" extra_args="-i {{ COMMON_PYPI_MIRROR_URL }} --exists-action w"
sudo_user: "{{ edxapp_user }}" sudo_user: "{{ edxapp_user }}"
when: EDXAPP_CAS_ATTRIBUTE_PACKAGE|length > 0 when: EDXAPP_CAS_ATTRIBUTE_PACKAGE|length > 0
tags:
- install
- install:app-requirements
# Install the sandbox python modules into {{ edxapp_venv_dir }} # Install the sandbox python modules into {{ edxapp_venv_dir }}
- name : install sandbox requirements into regular venv - name : install sandbox requirements into regular venv
...@@ -240,6 +322,9 @@ ...@@ -240,6 +322,9 @@
- "{{ sandbox_post_requirements }}" - "{{ sandbox_post_requirements }}"
sudo_user: "{{ edxapp_user }}" sudo_user: "{{ edxapp_user }}"
when: not EDXAPP_PYTHON_SANDBOX when: not EDXAPP_PYTHON_SANDBOX
tags:
- install
- install:app-requirements
# The next few tasks set up the python code sandbox # The next few tasks set up the python code sandbox
...@@ -250,6 +335,8 @@ ...@@ -250,6 +335,8 @@
when: EDXAPP_PYTHON_SANDBOX when: EDXAPP_PYTHON_SANDBOX
tags: tags:
- edxapp-sandbox - edxapp-sandbox
- install
- install:app-requirements
- name: code sandbox | Install base sandbox requirements and create sandbox virtualenv - name: code sandbox | Install base sandbox requirements and create sandbox virtualenv
pip: > pip: >
...@@ -261,6 +348,8 @@ ...@@ -261,6 +348,8 @@
when: EDXAPP_PYTHON_SANDBOX when: EDXAPP_PYTHON_SANDBOX
tags: tags:
- edxapp-sandbox - edxapp-sandbox
- install
- install:app-requirements
- name: code sandbox | Install sandbox requirements into sandbox venv - name: code sandbox | Install sandbox requirements into sandbox venv
shell: > shell: >
...@@ -275,22 +364,32 @@ ...@@ -275,22 +364,32 @@
changed_when: sandbox_install_output.stdout is defined and 'installed' in sandbox_install_output.stdout changed_when: sandbox_install_output.stdout is defined and 'installed' in sandbox_install_output.stdout
tags: tags:
- edxapp-sandbox - edxapp-sandbox
- install
- install:app-requirements
- name: code sandbox | put code sandbox into aa-enforce or aa-complain mode, depending on EDXAPP_SANDBOX_ENFORCE - name: code sandbox | put code sandbox into aa-enforce or aa-complain mode, depending on EDXAPP_SANDBOX_ENFORCE
command: /usr/sbin/{{ edxapp_aa_command }} /etc/apparmor.d/code.sandbox command: /usr/sbin/{{ edxapp_aa_command }} /etc/apparmor.d/code.sandbox
when: EDXAPP_PYTHON_SANDBOX when: EDXAPP_PYTHON_SANDBOX
tags: tags:
- edxapp-sandbox - edxapp-sandbox
- install
- install:app-requirements
- name: compiling all py files in the edx-platform repo - name: compiling all py files in the edx-platform repo
shell: "{{ edxapp_venv_bin }}/python -m compileall -x .git/.* {{ edxapp_code_dir }}" shell: "{{ edxapp_venv_bin }}/python -m compileall -x .git/.* {{ edxapp_code_dir }}"
sudo_user: "{{ edxapp_user }}" sudo_user: "{{ edxapp_user }}"
tags:
- install
- install:code
# alternative would be to give {{ common_web_user }} read access # alternative would be to give {{ common_web_user }} read access
# to the virtualenv but that permission change will require # to the virtualenv but that permission change will require
# root access. # root access.
- name: give other read permissions to the virtualenv - name: give other read permissions to the virtualenv
command: chmod -R o+r "{{ edxapp_venv_dir }}" command: chmod -R o+r "{{ edxapp_venv_dir }}"
tags:
- install
- install:code
# https://code.launchpad.net/~wligtenberg/django-openid-auth/mysql_fix/+merge/22726 # https://code.launchpad.net/~wligtenberg/django-openid-auth/mysql_fix/+merge/22726
# This is necessary for when syncdb is run and the django_openid_auth module is installed, # This is necessary for when syncdb is run and the django_openid_auth module is installed,
...@@ -299,6 +398,9 @@ ...@@ -299,6 +398,9 @@
shell: sed -i -e 's/claimed_id = models.TextField(max_length=2047, unique=True/claimed_id = models.TextField(max_length=2047/' {{ edxapp_venv_dir }}/lib/python2.7/site-packages/django_openid_auth/models.py shell: sed -i -e 's/claimed_id = models.TextField(max_length=2047, unique=True/claimed_id = models.TextField(max_length=2047/' {{ edxapp_venv_dir }}/lib/python2.7/site-packages/django_openid_auth/models.py
when: openid_workaround is defined when: openid_workaround is defined
sudo_user: "{{ edxapp_user }}" sudo_user: "{{ edxapp_user }}"
tags:
- install
- install:code
# creates the supervisor jobs for the # creates the supervisor jobs for the
# service variants configured, runs # service variants configured, runs
...@@ -319,6 +421,8 @@ ...@@ -319,6 +421,8 @@
sudo_user: "{{ supervisor_service_user }}" sudo_user: "{{ supervisor_service_user }}"
changed_when: supervisor_update.stdout is defined and supervisor_update.stdout != "" changed_when: supervisor_update.stdout is defined and supervisor_update.stdout != ""
when: not disable_edx_services when: not disable_edx_services
tags:
- manage
- name: ensure edxapp has started - name: ensure edxapp has started
supervisorctl: > supervisorctl: >
...@@ -329,6 +433,8 @@ ...@@ -329,6 +433,8 @@
sudo_user: "{{ supervisor_service_user }}" sudo_user: "{{ supervisor_service_user }}"
when: celery_worker is not defined and not disable_edx_services when: celery_worker is not defined and not disable_edx_services
with_items: service_variants_enabled with_items: service_variants_enabled
tags:
- manage
- name: ensure edxapp_workers has started - name: ensure edxapp_workers has started
supervisorctl: > supervisorctl: >
...@@ -339,6 +445,8 @@ ...@@ -339,6 +445,8 @@
when: celery_worker is defined and not disable_edx_services when: celery_worker is defined and not disable_edx_services
with_items: edxapp_workers with_items: edxapp_workers
sudo_user: "{{ supervisor_service_user }}" sudo_user: "{{ supervisor_service_user }}"
tags:
- manage
- name: create symlinks from the venv bin dir - name: create symlinks from the venv bin dir
file: > file: >
...@@ -349,6 +457,9 @@ ...@@ -349,6 +457,9 @@
- python - python
- pip - pip
- django-admin.py - django-admin.py
tags:
- install
- install:configuration
- name: create symlinks from the repo dir - name: create symlinks from the repo dir
file: > file: >
...@@ -357,13 +468,23 @@ ...@@ -357,13 +468,23 @@
state=link state=link
with_items: with_items:
- manage.py - manage.py
tags:
- install
- install:configuration
- name: remove read-only ssh key - name: remove read-only ssh key
file: path={{ edxapp_git_identity }} state=absent file: path={{ edxapp_git_identity }} state=absent
when: EDXAPP_USE_GIT_IDENTITY when: EDXAPP_USE_GIT_IDENTITY
tags:
- install
- install:configuration
- install:code
- include: tag_ec2.yml tags=deploy - include: tag_ec2.yml tags=deploy
when: COMMON_TAG_EC2_INSTANCE when: COMMON_TAG_EC2_INSTANCE
tags:
- remove
- aws
- set_fact: edxapp_installed=true - set_fact: edxapp_installed=true
...@@ -376,6 +497,8 @@ ...@@ -376,6 +497,8 @@
when: edxapp_installed is defined and celery_worker is not defined and not disable_edx_services when: edxapp_installed is defined and celery_worker is not defined and not disable_edx_services
sudo_user: "{{ supervisor_service_user }}" sudo_user: "{{ supervisor_service_user }}"
with_items: service_variants_enabled with_items: service_variants_enabled
tags:
- manage
- name: restart edxapp_workers - name: restart edxapp_workers
supervisorctl: > supervisorctl: >
...@@ -386,3 +509,5 @@ ...@@ -386,3 +509,5 @@
when: edxapp_installed is defined and celery_worker is defined and not disable_edx_services when: edxapp_installed is defined and celery_worker is defined and not disable_edx_services
with_items: edxapp_workers with_items: edxapp_workers
sudo_user: "{{ common_web_user }}" sudo_user: "{{ common_web_user }}"
tags:
- manage
...@@ -6,6 +6,9 @@ ...@@ -6,6 +6,9 @@
user: > user: >
name="{{ edxapp_user }}" home="{{ edxapp_app_dir }}" name="{{ edxapp_user }}" home="{{ edxapp_app_dir }}"
createhome=no shell=/bin/false createhome=no shell=/bin/false
tags:
- install
- install:base
- name: create edxapp user dirs - name: create edxapp user dirs
file: > file: >
...@@ -20,12 +23,18 @@ ...@@ -20,12 +23,18 @@
- "{{ edxapp_staticfile_dir }}" - "{{ edxapp_staticfile_dir }}"
- "{{ edxapp_course_static_dir }}" - "{{ edxapp_course_static_dir }}"
- "{{ edxapp_course_data_dir }}" - "{{ edxapp_course_data_dir }}"
tags:
- install
- install:base
# var should have more permissive permissions than the rest # var should have more permissive permissions than the rest
- name: create edxapp var dir - name: create edxapp var dir
file: > file: >
path={{ edxapp_data_dir }} state=directory mode=0775 path={{ edxapp_data_dir }} state=directory mode=0775
owner="{{ edxapp_user }}" group="{{ common_web_group }}" owner="{{ edxapp_user }}" group="{{ common_web_group }}"
tags:
- install
- install:base
# directory to import the courses from github # directory to import the courses from github
- name: create directory to import the courses from github - name: create directory to import the courses from github
...@@ -43,11 +52,17 @@ ...@@ -43,11 +52,17 @@
state=link state=link
owner="{{ edxapp_user }}" owner="{{ edxapp_user }}"
group="{{ common_web_group }}" group="{{ common_web_group }}"
tags:
- install
- install:base
- name: create edxapp log dir - name: create edxapp log dir
file: > file: >
path="{{ edxapp_log_dir }}" state=directory path="{{ edxapp_log_dir }}" state=directory
owner="{{ common_log_user }}" group="{{ common_log_user }}" owner="{{ common_log_user }}" group="{{ common_log_user }}"
tags:
- install
- install:base
- name: create web-writable edxapp data dirs - name: create web-writable edxapp data dirs
file: > file: >
...@@ -58,19 +73,31 @@ ...@@ -58,19 +73,31 @@
- "{{ edxapp_course_data_dir }}" - "{{ edxapp_course_data_dir }}"
- "{{ edxapp_upload_dir }}" - "{{ edxapp_upload_dir }}"
- "{{ edxapp_media_dir }}" - "{{ edxapp_media_dir }}"
tags:
- install
- install:base
# adding chris-lea nodejs repo # adding chris-lea nodejs repo
- name: add ppas for current versions of nodejs - name: add ppas for current versions of nodejs
apt_repository: repo="{{ edxapp_chrislea_ppa }}" apt_repository: repo="{{ edxapp_chrislea_ppa }}"
tags:
- install
- install:base
- name: install system packages on which LMS and CMS rely - name: install system packages on which LMS and CMS rely
apt: pkg={{','.join(edxapp_debian_pkgs)}} state=present update_cache=yes apt: pkg={{','.join(edxapp_debian_pkgs)}} state=present update_cache=yes
tags:
- install
- install:base
- name: set up edxapp .npmrc - name: set up edxapp .npmrc
template: template:
src=.npmrc.j2 dest={{ edxapp_app_dir }}/.npmrc src=.npmrc.j2 dest={{ edxapp_app_dir }}/.npmrc
owner={{ edxapp_user }} group={{ common_web_group }} owner={{ edxapp_user }} group={{ common_web_group }}
mode=0600 mode=0600
tags:
- install
- install:base
- name: create log directories for service variants - name: create log directories for service variants
file: > file: >
...@@ -78,6 +105,9 @@ ...@@ -78,6 +105,9 @@
owner={{ common_log_user }} group={{ common_log_user }} owner={{ common_log_user }} group={{ common_log_user }}
mode=0750 mode=0750
with_items: service_variants_enabled with_items: service_variants_enabled
tags:
- install
- install:base
# Set up the python sandbox execution environment # Set up the python sandbox execution environment
- include: python_sandbox_env.yml tags=deploy - include: python_sandbox_env.yml tags=deploy
......
...@@ -3,33 +3,44 @@ ...@@ -3,33 +3,44 @@
src={{ item }}.env.json.j2 src={{ item }}.env.json.j2
dest={{ edxapp_app_dir }}/{{ item }}.env.json dest={{ edxapp_app_dir }}/{{ item }}.env.json
sudo_user: "{{ edxapp_user }}" sudo_user: "{{ edxapp_user }}"
tags: edxapp_cfg
with_items: service_variants_enabled with_items: service_variants_enabled
tags:
- install
- install:configuration
- edxapp_cfg
- name: "create {{ item }} auth file" - name: "create {{ item }} auth file"
template: > template: >
src={{ item }}.auth.json.j2 src={{ item }}.auth.json.j2
dest={{ edxapp_app_dir }}/{{ item }}.auth.json dest={{ edxapp_app_dir }}/{{ item }}.auth.json
sudo_user: "{{ edxapp_user }}" sudo_user: "{{ edxapp_user }}"
tags: edxapp_cfg
with_items: service_variants_enabled with_items: service_variants_enabled
tags:
- install
- install:configuration
- edxapp_cfg
- name: "create {{ item }} yaml application config" - name: "create {{ item }} yaml application config"
template: > template: >
src={{ item }}.env.yaml.j2 src={{ item }}.env.yaml.j2
dest={{ EDXAPP_CFG_DIR }}/{{ item }}.env.yaml dest={{ EDXAPP_CFG_DIR }}/{{ item }}.env.yaml
sudo_user: "{{ edxapp_user }}" sudo_user: "{{ edxapp_user }}"
tags: edxapp_cfg
with_items: service_variants_enabled with_items: service_variants_enabled
tags:
- install
- install:configuration
- edxapp_cfg
- name: "create {{ item }} yaml auth file" - name: "create {{ item }} yaml auth file"
template: > template: >
src={{ item }}.auth.yaml.j2 src={{ item }}.auth.yaml.j2
dest={{ EDXAPP_CFG_DIR }}/{{ item }}.auth.yaml dest={{ EDXAPP_CFG_DIR }}/{{ item }}.auth.yaml
sudo_user: "{{ edxapp_user }}" sudo_user: "{{ edxapp_user }}"
tags: edxapp_cfg
with_items: service_variants_enabled with_items: service_variants_enabled
tags:
- install
- install:configuration
- edxapp_cfg
# write the supervisor scripts for the service variants # write the supervisor scripts for the service variants
...@@ -40,6 +51,9 @@ ...@@ -40,6 +51,9 @@
group={{ supervisor_user }} group={{ supervisor_user }}
with_items: service_variants_enabled with_items: service_variants_enabled
sudo_user: "{{ supervisor_user }}" sudo_user: "{{ supervisor_user }}"
tags:
- install
- install:configuration
- name: writing edxapp supervisor script - name: writing edxapp supervisor script
template: > template: >
...@@ -47,12 +61,18 @@ ...@@ -47,12 +61,18 @@
owner={{ supervisor_user }} owner={{ supervisor_user }}
group={{ supervisor_user }} group={{ supervisor_user }}
sudo_user: "{{ supervisor_user }}" sudo_user: "{{ supervisor_user }}"
tags:
- install
- install:configuration
- name: "add gunicorn configuration files" - name: "add gunicorn configuration files"
template: > template: >
src={{ item }}_gunicorn.py.j2 dest={{ edxapp_app_dir }}/{{ item }}_gunicorn.py src={{ item }}_gunicorn.py.j2 dest={{ edxapp_app_dir }}/{{ item }}_gunicorn.py
with_items: service_variants_enabled with_items: service_variants_enabled
sudo_user: "{{ edxapp_user }}" sudo_user: "{{ edxapp_user }}"
tags:
- install
- install:configuration
# write the supervisor script for celery workers # write the supervisor script for celery workers
...@@ -62,6 +82,9 @@ ...@@ -62,6 +82,9 @@
owner={{ supervisor_user }} owner={{ supervisor_user }}
group={{ supervisor_user }} group={{ supervisor_user }}
sudo_user: "{{ supervisor_user }}" sudo_user: "{{ supervisor_user }}"
tags:
- install
- install:configuration
# Enable the supervisor jobs # Enable the supervisor jobs
- name: "enable {{ item }} supervisor script" - name: "enable {{ item }} supervisor script"
...@@ -73,6 +96,9 @@ ...@@ -73,6 +96,9 @@
with_items: service_variants_enabled with_items: service_variants_enabled
when: celery_worker is not defined and not disable_edx_services when: celery_worker is not defined and not disable_edx_services
sudo_user: "{{ supervisor_user }}" sudo_user: "{{ supervisor_user }}"
tags:
- install
- install:configuration
- name: "enable edxapp supervisor script" - name: "enable edxapp supervisor script"
file: > file: >
...@@ -82,6 +108,9 @@ ...@@ -82,6 +108,9 @@
force=yes force=yes
when: celery_worker is not defined and not disable_edx_services when: celery_worker is not defined and not disable_edx_services
sudo_user: "{{ supervisor_user }}" sudo_user: "{{ supervisor_user }}"
tags:
- install
- install:configuration
- name: "enable celery worker supervisor script" - name: "enable celery worker supervisor script"
file: > file: >
...@@ -91,6 +120,9 @@ ...@@ -91,6 +120,9 @@
force=yes force=yes
when: celery_worker is defined and not disable_edx_services when: celery_worker is defined and not disable_edx_services
sudo_user: "{{ supervisor_user }}" sudo_user: "{{ supervisor_user }}"
tags:
- install
- install:configuration
- name: create helper scripts for managing edxapp - name: create helper scripts for managing edxapp
template: > template: >
...@@ -101,6 +133,9 @@ ...@@ -101,6 +133,9 @@
with_nested: with_nested:
- edxapp_helper_scripts - edxapp_helper_scripts
- service_variants_enabled - service_variants_enabled
tags:
- install
- install:configuration
# Syncdb with migrate when the migrate user is overridden in extra vars # Syncdb with migrate when the migrate user is overridden in extra vars
- name: migrate - name: migrate
...@@ -111,6 +146,8 @@ ...@@ -111,6 +146,8 @@
DB_MIGRATION_PASS: "{{ COMMON_MYSQL_MIGRATE_PASS }}" DB_MIGRATION_PASS: "{{ COMMON_MYSQL_MIGRATE_PASS }}"
EDX_PLATFORM_SETTINGS_OVERRIDE: "aws_migrate" EDX_PLATFORM_SETTINGS_OVERRIDE: "aws_migrate"
with_items: service_variants_enabled with_items: service_variants_enabled
tags:
- migrate
# Gather assets using paver if possible # Gather assets using paver if possible
...@@ -119,3 +156,5 @@ ...@@ -119,3 +156,5 @@
when: celery_worker is not defined and not devstack and item != "lms-preview" when: celery_worker is not defined and not devstack and item != "lms-preview"
tags: gather_static_assets tags: gather_static_assets
with_items: service_variants_enabled with_items: service_variants_enabled
tags:
- assets
...@@ -3,3 +3,6 @@ ...@@ -3,3 +3,6 @@
- name: Install system packages - name: Install system packages
apt: pkg={{','.join(edxapp_common_debian_pkgs)}} apt: pkg={{','.join(edxapp_common_debian_pkgs)}}
state=present update_cache=yes state=present update_cache=yes
tags:
- install
- install:base
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