Commit db8414cd by John Jarvis

replacing deploy tags with taggged include

parent 98ca0e0f
......@@ -17,8 +17,6 @@
- name: analytics-server | stop the analytics service
service: name=analytics state=stopped
tags: deploy
- name: analytics-server | start the analytics service
service: name=analytics state=started
tags: deploy
......@@ -2,12 +2,11 @@
# TODO: Needed while this repo is private
#
- name: analytics-server | upload ssh script
template:
template:
src=tmp/{{ as_role_name }}.git_ssh.sh.j2 dest={{ as_git_ssh }}
force=yes owner=root group=adm mode=750
tags:
- analytics-server
- deploy
- install
- update
......@@ -15,18 +14,17 @@
# TODO: Needed while this repo is private
#
- name: analytics-server | install read-only ssh key required for checkout
copy:
copy:
src={{ as_git_identity_path }} dest={{ as_git_identity_dest }}
force=yes owner=ubuntu group=adm mode=0600
tags:
- analytics-server
- deploy
- install
- update
- name: analytics-server | checkout code
git:
dest={{ as_code_dir }} repo={{ as_source_repo }}
git:
dest={{ as_code_dir }} repo={{ as_source_repo }}
version={{ as_version }} force=true
environment:
GIT_SSH: $as_git_ssh
......@@ -34,7 +32,6 @@
notify: analytics-server | start the analytics service
tags:
- analytics-server
- deploy
- install
- update
......@@ -42,12 +39,11 @@
# TODO: Needed while this repo is private
#
- name: analytics-server | update src permissions
file:
path={{ as_code_dir }} state=directory owner={{ as_user }}
file:
path={{ as_code_dir }} state=directory owner={{ as_user }}
group={{ as_web_user }} mode=2750 recurse=yes
tags:
- analytics-server
- deploy
- install
- update
......@@ -58,7 +54,6 @@
file: path={{ as_git_identity_dest }} state=absent
tags:
- analytics-server
- deploy
- install
- update
......@@ -69,19 +64,17 @@
file: path={{ as_git_ssh }} state=absent
tags:
- analytics-server
- deploy
- install
- update
- name: analytics-server | install application requirements
pip:
pip:
requirements={{ as_requirements_file }}
virtualenv={{ as_venv_dir }} state=present
sudo: true
sudo: true
sudo_user: "{{ as_user }}"
notify: analytics-server | start the analytics service
notify: analytics-server | start the analytics service
tags:
- analytics-server
- deploy
- install
- update
......@@ -11,7 +11,7 @@
#
#
# Tasks for role analytics-server
#
#
# Overview:
#
# Installs the edX analytics-server Django application which provides
......@@ -22,7 +22,7 @@
# common role
#
# Depends upon the automated role
#
#
# Example play:
#
# - name: Configure analytics instance(s)
......@@ -45,8 +45,8 @@
- update
- name: analytics-server | create analytics-server user {{ as_user }}
user:
name={{ as_user }} state=present shell=/bin/bash
user:
name={{ as_user }} state=present shell=/bin/bash
home={{ as_home }} createhome=yes
tags:
- analytics-server
......@@ -54,9 +54,9 @@
- update
- name: analytics-server | setup the analytics-server env
template:
template:
src=opt/wwc/analytics-server/{{ as_env }}.j2
dest={{ as_home }}/{{ as_env }}
dest={{ as_home }}/{{ as_env }}
owner="{{ as_user }}" group="{{ as_user }}"
tags:
- analytics-server
......@@ -65,15 +65,15 @@
- name: analytics-server | drop a bash_profile
copy: >
src=../../common/files/bash_profile
dest={{ as_home }}/.bash_profile
owner={{ as_user }}
src=../../common/files/bash_profile
dest={{ as_home }}/.bash_profile
owner={{ as_user }}
group={{ as_user }}
# Awaiting next ansible release.
#- name: analytics-server | ensure .bashrc exists
# file: path={{ as_home }}/.bashrc state=touch
# sudo: true
# sudo: true
# sudo_user: "{{ as_user }}"
# tags:
# - analytics-server
......@@ -82,7 +82,7 @@
- name: analytics-server | ensure .bashrc exists
shell: touch {{ as_home }}/.bashrc
sudo: true
sudo: true
sudo_user: "{{ as_user }}"
tags:
- analytics-server
......@@ -92,7 +92,7 @@
- name: analytics-server | add source of analytics-server_env to .bashrc
lineinfile:
dest={{ as_home }}/.bashrc
regexp='. {{ as_home }}/analytics-server_env'
regexp='. {{ as_home }}/analytics-server_env'
line='. {{ as_home }}/analytics_server_env'
tags:
- analytics-server
......@@ -102,7 +102,7 @@
- name: analytics-server | add source venv to .bashrc
lineinfile:
dest={{ as_home }}/.bashrc
regexp='. {{ as_venv_dir }}/bin/activate'
regexp='. {{ as_venv_dir }}/bin/activate'
line='. {{ as_venv_dir }}/bin/activate'
tags:
- analytics-server
......@@ -118,7 +118,7 @@
- update
- name: analytics-server | create config
template:
template:
src=opt/wwc/analytics.auth.json.j2
dest=/opt/wwc/analytics.auth.json
mode=0600
......@@ -127,10 +127,10 @@
- analytics-server
- install
- update
- name: analytics-server | install service
template:
src=etc/init/analytics.conf.j2 dest=/etc/init/analytics.conf
owner=root group=root
- include: deploy.yml
- include: deploy.yml tags=deploy
......@@ -17,8 +17,6 @@
- name: analytics | stop the analytics service
service: name=analytics state=stopped
tags: deploy
- name: analytics | start the analytics service
service: name=analytics state=started
tags: deploy
......@@ -2,12 +2,11 @@
# TODO: Needed while this repo is private
#
- name: analytics | upload ssh script
template:
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
......@@ -15,18 +14,17 @@
# TODO: Needed while this repo is private
#
- name: analytics | install read-only ssh key required for checkout
copy:
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 }}
git:
dest={{ analytics_code_dir }} repo={{ analytics_source_repo }}
version={{ analytics_version }} force=true
environment:
GIT_SSH: $analytics_git_ssh
......@@ -34,7 +32,6 @@
notify: analytics | start the analytics service
tags:
- analytics
- deploy
- install
- update
......@@ -42,12 +39,11 @@
# TODO: Needed while this repo is private
#
- name: analytics | update src permissions
file:
path={{ analytics_code_dir }} state=directory owner={{ analytics_user }}
file:
path={{ analytics_code_dir }} state=directory owner={{ analytics_user }}
group={{ analytics_web_user }} mode=2750 recurse=yes
tags:
- analytics
- deploy
- install
- update
......@@ -58,7 +54,6 @@
file: path={{ analytics_git_identity_dest }} state=absent
tags:
- analytics
- deploy
- install
- update
......@@ -69,19 +64,17 @@
file: path={{ analytics_git_ssh }} state=absent
tags:
- analytics
- deploy
- install
- update
- name: analytics | install application requirements
pip:
pip:
requirements={{ analytics_requirements_file }}
virtualenv={{ analytics_venv_dir }} state=present
sudo: true
sudo: true
sudo_user: "{{ analytics_user }}"
notify: analytics | start the analytics service
notify: analytics | start the analytics service
tags:
- analytics
- deploy
- install
- update
......@@ -11,7 +11,7 @@
#
#
# Tasks for role analytics
#
#
# Overview:
#
# Installs the edX analytics Django application which provides
......@@ -22,7 +22,7 @@
# common role
#
# Depends upon the automated role
#
#
# Example play:
#
# - name: Configure analytics instance(s)
......@@ -45,8 +45,8 @@
- update
- name: analytics | create analytics user {{ analytics_user }}
user:
name={{ analytics_user }} state=present shell=/bin/bash
user:
name={{ analytics_user }} state=present shell=/bin/bash
home={{ analytics_home }} createhome=yes
tags:
- analytics
......@@ -54,9 +54,9 @@
- update
- name: analytics | setup the analytics env
template:
template:
src=opt/wwc/analytics/{{ analytics_env }}.j2
dest={{ analytics_home }}/{{ analytics_env }}
dest={{ analytics_home }}/{{ analytics_env }}
owner="{{ analytics_user }}" group="{{ analytics_user }}"
tags:
- analytics
......@@ -65,15 +65,15 @@
- name: analytics | drop a bash_profile
copy: >
src=../../common/files/bash_profile
dest={{ analytics_home }}/.bash_profile
owner={{ analytics_user }}
src=../../common/files/bash_profile
dest={{ analytics_home }}/.bash_profile
owner={{ analytics_user }}
group={{ analytics_user }}
# Awaiting next ansible release.
#- name: analytics | ensure .bashrc exists
# file: path={{ analytics_home }}/.bashrc state=touch
# sudo: true
# sudo: true
# sudo_user: "{{ analytics_user }}"
# tags:
# - analytics
......@@ -82,7 +82,7 @@
- name: analytics | ensure .bashrc exists
shell: touch {{ analytics_home }}/.bashrc
sudo: true
sudo: true
sudo_user: "{{ analytics_user }}"
tags:
- analytics
......@@ -92,7 +92,7 @@
- name: analytics | add source of analytics_env to .bashrc
lineinfile:
dest={{ analytics_home }}/.bashrc
regexp='. {{ analytics_home }}/analytics_env'
regexp='. {{ analytics_home }}/analytics_env'
line='. {{ analytics_home }}/analytics_env'
tags:
- analytics
......@@ -102,7 +102,7 @@
- name: analytics | add source venv to .bashrc
lineinfile:
dest={{ analytics_home }}/.bashrc
regexp='. {{ analytics_venv_dir }}/bin/activate'
regexp='. {{ analytics_venv_dir }}/bin/activate'
line='. {{ analytics_venv_dir }}/bin/activate'
tags:
- analytics
......@@ -118,7 +118,7 @@
- update
- name: analytics | create config
template:
template:
src=opt/wwc/analytics.auth.json.j2
dest=/opt/wwc/analytics.auth.json
mode=0600
......@@ -127,10 +127,10 @@
- analytics
- install
- update
- name: analytics | install service
template:
src=etc/init/analytics.conf.j2 dest=/etc/init/analytics.conf
owner=root group=root
- include: deploy.yml
- include: deploy.yml tags=deploy
---
- name: apache | restart apache
service: name=apache2 state=restarted
tags: deploy
......@@ -20,5 +20,4 @@
supervisorctl_path={{ supervisor_ctl }}
config={{ supervisor_cfg }}
state=restarted
tags: deploy
......@@ -6,7 +6,6 @@
dest={{ certs_app_dir }}/env.json
sudo_user: "{{ certs_user }}"
notify: certs | restart certs
tags: deploy
- name: certs | create certificate auth file
template: >
......@@ -14,28 +13,24 @@
dest={{ certs_app_dir }}/auth.json
sudo_user: "{{ certs_user }}"
notify: certs | restart certs
tags: deploy
- name: certs | writing supervisor script for certificates
template: >
src=certs.conf.j2 dest={{ supervisor_cfg_dir }}/certs.conf
owner={{ supervisor_user }} mode=0644
notify: certs | restart certs
tags: deploy
- name: certs | create ssh script for git
template: >
src={{ certs_git_ssh|basename }}.j2 dest={{ certs_git_ssh }}
owner={{ certs_user }} mode=750
notify: certs | restart certs
tags: deploy
- name: certs | install read-only ssh key for the certs repo
copy: >
src={{ CERTS_LOCAL_GIT_IDENTITY }} dest={{ certs_git_identity }}
force=yes owner={{ certs_user }} mode=0600
notify: certs | restart certs
tags: deploy
- name: certs | checkout certificates repo into {{ certs_code_dir }}
git: dest={{ certs_code_dir }} repo={{ certs_repo }} version={{ certs_version }}
......@@ -43,18 +38,15 @@
environment:
GIT_SSH: "{{ certs_git_ssh }}"
notify: certs | restart certs
tags: deploy
- name: certs | remove read-only ssh key for the certs repo
file: path={{ certs_git_identity }} state=absent
notify: certs | restart certs
tags: deploy
- name : install python requirements
pip: requirements="{{ certs_requirements_file }}" virtualenv="{{ certs_venv_dir }}" state=present
sudo_user: "{{ certs_user }}"
notify: certs | restart certs
tags: deploy
# call supervisorctl update. this reloads
# the supervisorctl config and restarts
......
......@@ -77,7 +77,7 @@
when: certs_gpg_key.changed
notify: certs | restart certs
- include: deploy.yml
- include: deploy.yml tags=deploy
- name: certs | create a symlink for venv python
file: >
......
......@@ -2,4 +2,3 @@
- name: common | restart rsyslogd
service: name=rsyslog state=restarted
sudo: True
tags: deploy
......@@ -2,4 +2,3 @@
- name: datadog | restart the datadog service
service: name=datadog-agent state=restarted
tags: deploy
......@@ -4,7 +4,6 @@
git: dest={{ demo_code_dir }} repo={{ demo_repo }} version={{ demo_version }}
sudo_user: "{{ edxapp_user }}"
register: demo_checkout
tags: deploy
- name: demo | import demo course
shell: >
......@@ -12,7 +11,6 @@
chdir={{ edxapp_code_dir }}
sudo_user: "{{ common_web_user }}"
when: demo_checkout.changed
tags: deploy
- name: demo | create some test users and enroll them in the course
shell: >
......@@ -21,7 +19,6 @@
sudo_user: "{{ common_web_user }}"
with_items: demo_test_users
when: demo_checkout.changed
tags: deploy
- name: demo | create staff user
shell: >
......@@ -29,7 +26,6 @@
chdir={{ edxapp_code_dir }}
sudo_user: "{{ common_web_user }}"
when: demo_checkout.changed
tags: deploy
- name: demo | add test users to the certificate whitelist
shell: >
......@@ -37,7 +33,6 @@
chdir={{ edxapp_code_dir }}
with_items: demo_test_users
when: demo_checkout.changed
tags: deploy
- name: demo | seed the forums for the demo course
shell: >
......@@ -45,5 +40,4 @@
chdir={{ edxapp_code_dir }}
with_items: demo_test_users
when: demo_checkout.changed
tags: deploy
......@@ -35,4 +35,4 @@
path="{{ demo_app_dir }}" state=directory
owner="{{ edxapp_user }}" group="{{ common_web_group }}"
- include: deploy.yml
- include: deploy.yml tags=deploy
......@@ -18,4 +18,3 @@
config={{ devpi_supervisor_cfg }}
name=devpi-server
sudo_user: "{{ devpi_supervisor_user }}"
tags: deploy
......@@ -104,7 +104,6 @@
shell: "{{ devpi_supervisor_ctl }} -c {{ devpi_supervisor_cfg }} update"
register: supervisor_update
changed_when: supervisor_update.stdout != ""
tags: deploy
- name: devpi | ensure devpi is started
supervisorctl_local: >
......
......@@ -8,4 +8,3 @@
with_items:
- discern
- discern_celery
tags: deploy
......@@ -13,32 +13,24 @@
sudo_user: "{{ discern_user }}"
notify:
- discern | restart discern
tags:
- deploy
- name: discern | create discern auth file auth.json
template: src=auth.json.j2 dest={{ discern_app_dir }}/auth.json
sudo_user: "{{ discern_user }}"
notify:
- discern | restart discern
tags:
- deploy
- name: discern | git checkout discern repo into discern_code_dir
git: dest={{ discern_code_dir }} repo={{ discern_source_repo }} version={{ discern_version }}
sudo_user: "{{ discern_user }}"
notify:
- discern | restart discern
tags:
- deploy
- name: discern | git checkout ease repo into discern_ease_code_dir
git: dest={{ discern_ease_code_dir}} repo={{ discern_ease_source_repo }} version={{ discern_ease_version }}
sudo_user: "{{ discern_user }}"
notify:
- discern | restart discern
tags:
- deploy
#Numpy has to be a pre-requirement in order for scipy to build
- name : discern | install python pre-requirements for discern and ease
......@@ -49,8 +41,6 @@
with_items:
- "{{ discern_pre_requirements_file }}"
- "{{ discern_ease_pre_requirements_file }}"
tags:
- deploy
- name : discern | install python requirements for discern and ease
pip: requirements={{item}} virtualenv={{ discern_venv_dir }} state=present
......@@ -60,16 +50,12 @@
with_items:
- "{{ discern_post_requirements_file }}"
- "{{ discern_ease_post_requirements_file }}"
tags:
- deploy
- name: discern | install ease python package
shell: >
{{ discern_venv_dir }}/bin/activate; cd {{ discern_ease_code_dir }}; python setup.py install
notify:
- discern | restart discern
tags:
- deploy
- name: discern | download and install nltk
shell: |
......@@ -83,8 +69,6 @@
sudo_user: "{{ discern_user }}"
notify:
- discern | restart discern
tags:
- deploy
#Run this instead of using the ansible module because the ansible module only support syncdb of these three, and does not
......@@ -100,8 +84,6 @@
- syncdb
- migrate
- collectstatic
tags:
- deploy
#Have this separate from the other three because it doesn't take the noinput flag
- name: discern | django update_index for discern
shell: >
......@@ -110,8 +92,6 @@
sudo_user: "{{ discern_user }}"
notify:
- discern | restart discern
tags:
- deploy
# call supervisorctl update. this reloads
......@@ -124,7 +104,6 @@
register: supervisor_update
sudo_user: "{{ supervisor_service_user }}"
changed_when: supervisor_update.stdout != ""
tags: deploy
- name: discern | ensure discern, discern_celery has started
supervisorctl_local: >
......@@ -135,4 +114,3 @@
with_items:
- discern
- discern_celery
tags: deploy
......@@ -53,7 +53,7 @@
notify:
- discern | restart discern
- include: deploy.yml
- include: deploy.yml tags=deploy
- name: discern | create a symlink for venv python
file: >
......
......@@ -2,29 +2,24 @@
- name: edx_ansible | git checkout edx_ansible repo into edx_ansible_code_dir
git: dest={{ edx_ansible_code_dir }} repo={{ edx_ansible_source_repo }} version={{ configuration_version }}
sudo_user: "{{ edx_ansible_user }}"
tags: deploy
- name : edx_ansible | install edx_ansible venv requirements
pip: requirements="{{ edx_ansible_requirements_file }}" virtualenv="{{ edx_ansible_venv_dir }}" state=present
sudo_user: "{{ edx_ansible_user }}"
tags: deploy
- name: edx_ansible | create update script
template: >
dest={{ edx_ansible_app_dir}}/update
src=update.j2 owner={{ edx_ansible_user }} group={{ edx_ansible_user }} mode=755
tags: deploy
- name: edx_ansible | create a symlink for update.sh
file: >
src={{ edx_ansible_app_dir }}/update
dest={{ COMMON_BIN_DIR }}/update
state=link
tags: deploy
- name: edx_ansible | dump all vars to yaml
template: src=dumpall.yml.j2 dest={{ edx_ansible_var_file }} mode=0600
tags: deploy
- name: edx_ansible | clean up var file, removing all version vars
shell: sed -i -e "/{{item}}/d" {{ edx_ansible_var_file }}
......@@ -41,15 +36,12 @@
- configuration_version
- ease_version
- certs_version
tags: deploy
- name: edx_ansible | remove the special _original_file var
shell: sed -i -e "/_original_file/d" {{ edx_ansible_var_file }}
tags: deploy
- name: edxapp | create a symlink for var file
file: >
src={{ edx_ansible_var_file }}
dest={{ COMMON_CFG_DIR }}/{{ edx_ansible_var_file|basename }}
state=link
tags: deploy
......@@ -44,4 +44,4 @@
- name: edx_ansible | install a bunch of system packages on which edx_ansible relies
apt: pkg={{','.join(edx_ansible_debian_pkgs)}} state=present
- include: deploy.yml
- include: deploy.yml tags=deploy
......@@ -8,7 +8,6 @@
when: celery_worker is not defined and not devstack
sudo_user: "{{ supervisor_service_user }}"
with_items: service_variants_enabled
tags: deploy
- name: edxapp | restart edxapp_workers
supervisorctl_local: >
......@@ -19,4 +18,3 @@
when: celery_worker is defined and not devstack
with_items: edxapp_workers
sudo_user: "{{ common_web_user }}"
tags: deploy
......@@ -6,7 +6,6 @@
src=edxapp_env.j2 dest={{ edxapp_app_dir }}/edxapp_env
owner={{ edxapp_user }} group={{ common_web_user }}
mode=0644
tags: deploy
# Do A Checkout
- name: edxapp | checkout edx-platform repo into {{edxapp_code_dir}}
......@@ -16,7 +15,6 @@
notify:
- "edxapp | restart edxapp"
- "edxapp | restart edxapp_workers"
tags: deploy
- name: edxapp | git clean after checking out edx-platform
shell: cd {{edxapp_code_dir}} && git clean -xdf
......@@ -24,7 +22,6 @@
notify:
- "edxapp | restart edxapp"
- "edxapp | restart edxapp_workers"
tags: deploy
- name: edxapp | checkout theme
git: dest={{ edxapp_app_dir }}/themes/{{edxapp_theme_name}} repo={{edxapp_theme_source_repo}} version={{edxapp_theme_version}}
......@@ -33,26 +30,20 @@
notify:
- "edxapp | restart edxapp"
- "edxapp | restart edxapp_workers"
tags:
- deploy
- name: edxapp | create checksum for requirements, package.json and Gemfile
shell: >
/usr/bin/md5sum {{ " ".join(edxapp_chksum_req_files) }} 2>/dev/null > /var/tmp/edxapp.req.new
sudo_user: "{{ edxapp_user }}"
ignore_errors: true
tags:
- deploy
- stat: path=/var/tmp/edxapp.req.new
register: new
sudo_user: "{{ edxapp_user }}"
tags: deploy
- stat: path=/var/tmp/edxapp.req.installed
register: inst
sudo_user: "{{ edxapp_user }}"
tags: deploy
# Substitute github mirror in all requirements files
# This is run on every single deploy
......@@ -63,7 +54,6 @@
notify:
- "edxapp | restart edxapp"
- "edxapp | restart edxapp_workers"
tags: deploy
# Ruby plays that need to be run after platform updates.
- name: edxapp | gem install bundler
......@@ -76,7 +66,6 @@
notify:
- "edxapp | restart edxapp"
- "edxapp | restart edxapp_workers"
tags: deploy
- name: edxapp | bundle install
shell: >
......@@ -88,7 +77,6 @@
notify:
- "edxapp | restart edxapp"
- "edxapp | restart edxapp_workers"
tags: deploy
# Set the npm registry
- name: edxapp | Set the npm registry
......@@ -100,7 +88,6 @@
notify:
- "edxapp | restart edxapp"
- "edxapp | restart edxapp_workers"
tags: deploy
# Node play that need to be run after platform updates.
- name: edxapp | Install edx-platform npm dependencies
......@@ -110,7 +97,6 @@
notify:
- "edxapp | restart edxapp"
- "edxapp | restart edxapp_workers"
tags: deploy
# Install the python pre requirements into {{ edxapp_venv_dir }}
......@@ -126,7 +112,6 @@
- "edxapp | restart edxapp"
- "edxapp | restart edxapp_workers"
when: not inst.stat.exists or new.stat.md5 != inst.stat.md5
tags: deploy
# Install the python modules into {{ edxapp_venv_dir }}
- name : edxapp | install python base-requirements
......@@ -142,7 +127,6 @@
- "edxapp | restart edxapp"
- "edxapp | restart edxapp_workers"
when: not inst.stat.exists or new.stat.md5 != inst.stat.md5
tags: deploy
# Install the python post requirements into {{ edxapp_venv_dir }}
- name : edxapp | install python post-requirements
......@@ -157,7 +141,6 @@
- "edxapp | restart edxapp"
- "edxapp | restart edxapp_workers"
when: not inst.stat.exists or new.stat.md5 != inst.stat.md5
tags: deploy
# Install the final python modules into {{ edxapp_venv_dir }}
- name : edxapp | install python post-post requirements
......@@ -175,7 +158,6 @@
notify:
- "edxapp | restart edxapp"
- "edxapp | restart edxapp_workers"
tags: deploy
# Install the sandbox python modules into {{ edxapp_venv_dir }}
......@@ -195,7 +177,6 @@
notify:
- "edxapp | restart edxapp"
- "edxapp | restart edxapp_workers"
tags: deploy
# The next few tasks set up the python code sandbox
......@@ -205,7 +186,6 @@
command: /usr/sbin/aa-complain /etc/apparmor.d/code.sandbox
when: EDXAPP_PYTHON_SANDBOX
tags:
- deploy
- edxapp-sandbox
- name: edxapp | code sandbox | Install base sandbox requirements and create sandbox virtualenv
......@@ -220,7 +200,6 @@
- "edxapp | restart edxapp"
- "edxapp | restart edxapp_workers"
tags:
- deploy
- edxapp-sandbox
- name: edxapp | code sandbox | Install sandbox requirements into sandbox venv
......@@ -238,14 +217,12 @@
- "edxapp | restart edxapp"
- "edxapp | restart edxapp_workers"
tags:
- deploy
- edxapp-sandbox
- name: edxapp | 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
when: EDXAPP_PYTHON_SANDBOX
tags:
- deploy
- edxapp-sandbox
- name: edxapp | compiling all py files in the edx-platform repo
......@@ -254,7 +231,6 @@
notify:
- "edxapp | restart edxapp"
- "edxapp | restart edxapp_workers"
tags: deploy
# alternative would be to give {{ common_web_user }} read access
# to the virtualenv but that permission change will require
......@@ -265,13 +241,11 @@
notify:
- "edxapp | restart edxapp"
- "edxapp | restart edxapp_workers"
tags: deploy
- name: edxapp | create checksum for installed requirements
shell: cp /var/tmp/edxapp.req.new /var/tmp/edxapp.req.installed
sudo_user: "{{ edxapp_user }}"
notify: "edxapp | restart edxapp"
tags: deploy
# https://code.launchpad.net/~wligtenberg/django-openid-auth/mysql_fix/+merge/22726
......@@ -284,8 +258,6 @@
notify:
- "edxapp | restart edxapp"
- "edxapp | restart edxapp_workers"
tags:
- deploy
# creates the supervisor jobs for the
# service variants configured, runs
......@@ -303,7 +275,6 @@
sudo_user: "{{ supervisor_service_user }}"
changed_when: supervisor_update.stdout != ""
when: not devstack
tags: deploy
- name: edxapp | ensure edxapp has started
supervisorctl_local: >
......@@ -314,7 +285,6 @@
sudo_user: "{{ supervisor_service_user }}"
when: celery_worker is not defined and not devstack
with_items: service_variants_enabled
tags: deploy
- name: edxapp | ensure edxapp_workers has started
supervisorctl_local: >
......@@ -325,4 +295,3 @@
when: celery_worker is defined and not devstack
with_items: edxapp_workers
sudo_user: "{{ supervisor_service_user }}"
tags: deploy
......@@ -72,7 +72,7 @@
- include: python_sandbox_env.yml
when: EDXAPP_PYTHON_SANDBOX
- include: deploy.yml
- include: deploy.yml tags=deploy
- name: edxapp | create a symlink for venv python
file: >
......
......@@ -7,8 +7,6 @@
notify:
- "edxapp | restart edxapp"
- "edxapp | restart edxapp_workers"
tags:
- deploy
- name: "create {{ item }} auth file"
template: >
......@@ -19,8 +17,6 @@
- "edxapp | restart edxapp"
- "edxapp | restart edxapp_workers"
with_items: service_variants_enabled
tags:
- deploy
# write the supervisor scripts for the service variants
......@@ -31,8 +27,6 @@
with_items: service_variants_enabled
when: celery_worker is not defined and not devstack
sudo_user: "{{ supervisor_user }}"
tags:
- deploy
- name: edxapp | writing edxapp supervisor script
template: >
......@@ -40,8 +34,6 @@
owner={{ supervisor_user }}
when: celery_worker is not defined and not devstack
sudo_user: "{{ supervisor_user }}"
tags:
- deploy
# write the supervisor script for celery workers
......@@ -51,8 +43,6 @@
owner={{ supervisor_user }}
when: celery_worker is defined and not devstack
sudo_user: "{{ supervisor_user }}"
tags:
- deploy
# Gather assets using rake if possible
......@@ -69,8 +59,6 @@
- "edxapp | restart edxapp"
- "edxapp | restart edxapp_workers"
environment: "{{ edxapp_environment }}"
tags:
- deploy
- name: edxapp | syncdb and migrate
......@@ -80,8 +68,6 @@
notify:
- "edxapp | restart edxapp"
- "edxapp | restart edxapp_workers"
tags:
- deploy
- name: edxapp | db migrate
shell: SERVICE_VARIANT=lms {{ edxapp_venv_bin }}/django-admin.py migrate --noinput --settings=lms.envs.aws --pythonpath={{ edxapp_code_dir }}
......@@ -90,5 +76,3 @@
- "edxapp | restart edxapp"
- "edxapp | restart edxapp_workers"
sudo_user: "{{ edxapp_user }}"
tags:
- deploy
......@@ -6,4 +6,3 @@
config={{ supervisor_cfg }}
state=restarted
when: not devstack
tags: deploy
......@@ -8,7 +8,6 @@
sudo_user: "{{ supervisor_user }}"
when: not devstack
register: forum_supervisor
tags: deploy
- name: forum | create the supervisor wrapper
template: >
......@@ -18,13 +17,11 @@
sudo_user: "{{ forum_user }}"
when: not devstack
notify: forum | restart the forum service
tags: deploy
- name: forum | git checkout forum repo into {{ forum_code_dir }}
git: dest={{ forum_code_dir }} repo={{ forum_source_repo }} version={{ forum_version }}
sudo_user: "{{ forum_user }}"
notify: forum | restart the forum service
tags: deploy
# TODO: This is done as the common_web_user
# since the process owner needs write access
......@@ -34,7 +31,6 @@
sudo_user: "{{ common_web_user }}"
environment: "{{ forum_environment }}"
notify: forum | restart the forum service
tags: deploy
# call supervisorctl update. this reloads
# the supervisorctl config and restarts
......@@ -46,7 +42,6 @@
register: supervisor_update
changed_when: supervisor_update.stdout != ""
when: not devstack
tags: deploy
- name: forum | ensure forum is started
supervisorctl_local: >
......@@ -55,4 +50,3 @@
config={{ supervisor_cfg }}
state=started
when: not devstack
tags: deploy
......@@ -42,6 +42,6 @@
notify:
- forum | restart the forum service
- include: deploy.yml
- include: deploy.yml tags=deploy
- include: test.yml
......@@ -18,21 +18,17 @@
- name: legacy_ora | create ora application config
copy:
src={{secure_dir}}/files/{{COMMON_ENV_TYPE}}/legacy_ora/ora.env.json
src={{secure_dir}}/files/{{COMMON_ENV_TYPE}}/legacy_ora/ora.env.json
dest={{ora_app_dir}}/env.json
sudo_user: "{{ ora_user }}"
register: env_state
tags:
- deploy
- name: legacy_ora | create ora auth file
copy:
src={{secure_dir}}/files/{{COMMON_ENV_TYPE}}/legacy_ora/ora.auth.json
src={{secure_dir}}/files/{{COMMON_ENV_TYPE}}/legacy_ora/ora.auth.json
dest={{ora_app_dir}}/auth.json
sudo_user: "{{ ora_user }}"
register: auth_state
tags:
- deploy
# Restart ORA Services
- name: legacy_ora | restart edx-ora
......
......@@ -7,14 +7,12 @@
- name: local_dev | set login shell for app accounts
user: name={{ item.user }} shell="/bin/bash"
with_items: "{{ localdev_accounts }}"
tags: deploy
# Ensure forum user has permissions to access .gem and .rbenv
# This is a little twisty: the forum role sets the owner and group to www-data
# So we add the forum user to the www-data group and give group write permissions
- name: local_dev | add forum user to www-data group
user: name={{ forum_user }} groups={{ common_web_group }} append=yes
tags: deploy
- name: local_dev | set forum rbenv and gem permissions
file:
......@@ -22,7 +20,6 @@
with_items:
- "{{ forum_app_dir }}/.gem"
- "{{ forum_app_dir }}/.rbenv"
tags: deploy
# Create scripts to configure environment
- name: local_dev | create login scripts
......
---
- name: restart mongo
service: name=mongodb state=restarted
tags: deploy
---
- name: nginx | restart nginx
service: name=nginx state=restarted
tags: deploy
- name: nginx | reload nginx
service: name=nginx state=reloaded
tags: deploy
......@@ -6,7 +6,6 @@
state=restarted
config={{ supervisor_cfg }}
supervisorctl_path={{ supervisor_ctl }}
tags: deploy
- name: notifier | restart notifier-celery-workers
supervisorctl_local: >
......@@ -14,4 +13,3 @@
state=restarted
config={{ supervisor_cfg }}
supervisorctl_path={{ supervisor_ctl }}
tags: deploy
---
- name: notifier | checkout code
git:
dest={{ NOTIFIER_CODE_DIR }} repo={{ NOTIFIER_SOURCE_REPO }}
git:
dest={{ NOTIFIER_CODE_DIR }} repo={{ NOTIFIER_SOURCE_REPO }}
version={{ NOTIFIER_VERSION }}
sudo: true
sudo: true
sudo_user: "{{ NOTIFIER_USER }}"
notify:
- notifier | restart notifier-scheduler
- notifier | restart notifier-celery-workers
tags:
- deploy
- name: notifier | source repo group perms
file:
file:
path={{ NOTIFIER_SOURCE_REPO }} mode=2775 state=directory
tags:
- deploy
- name: notifier | install application requirements
pip:
requirements="{{ NOTIFIER_REQUIREMENTS_FILE }}"
pip:
requirements="{{ NOTIFIER_REQUIREMENTS_FILE }}"
virtualenv="{{ NOTIFIER_VENV_DIR }}" state=present
sudo: true
sudo: true
sudo_user: "{{ NOTIFIER_USER }}"
notify:
- notifier | restart notifier-scheduler
- notifier | restart notifier-celery-workers
tags:
- deploy
- name: notifier | syncdb
shell: >
cd {{ NOTIFIER_CODE_DIR }} && {{ NOTIFIER_VENV_DIR }}/bin/python manage.py syncdb
sudo: true
sudo: true
sudo_user: "{{ NOTIFIER_USER }}"
notify:
- notifier | restart notifier-scheduler
- notifier | restart notifier-celery-workers
tags:
- deploy
......@@ -99,4 +99,4 @@
sudo_user: "{{ supervisor_user }}"
notify: notifier | restart notifier-scheduler
- include: deploy.yml
- include: deploy.yml tags=deploy
......@@ -6,7 +6,6 @@
config={{ supervisor_cfg }}
state=restarted
when: not devstack
tags: deploy
- name: ora | restart ora_celery
supervisorctl_local: >
......@@ -15,4 +14,3 @@
config={{ supervisor_cfg }}
state=restarted
when: not devstack
tags: deploy
......@@ -7,22 +7,16 @@
- ora | restart ora_celery
with_items: ['ora', 'ora_celery']
when: not devstack
tags:
- deploy
- include: ease.yml
- name: ora | create ora application config
template: src=ora.env.json.j2 dest={{ora_app_dir}}/ora.env.json
sudo_user: "{{ ora_user }}"
tags:
- deploy
- name: ora | create ora auth file
template: src=ora.auth.json.j2 dest={{ora_app_dir}}/ora.auth.json
sudo_user: "{{ ora_user }}"
tags:
- deploy
- name: ora | setup the ora env
notify:
......@@ -32,8 +26,6 @@
src=ora_env.j2 dest={{ ora_app_dir }}/ora_env
owner={{ ora_user }} group={{ common_web_user }}
mode=0644
tags:
- deploy
# Do A Checkout
- name: ora | git checkout ora repo into {{ ora_app_dir }}
......@@ -42,8 +34,6 @@
notify:
- ora | restart ora
- ora | restart ora_celery
tags:
- deploy
# TODO: Check git.py _run_if_changed() to see if the logic there to skip running certain
# portions of the deploy needs to be incorporated here.
......@@ -56,8 +46,6 @@
notify:
- ora | restart ora
- ora | restart ora_celery
tags:
- deploy
# Install the python post requirements into {{ ora_venv_dir }}
- name: ora | install python post-requirements
......@@ -66,8 +54,6 @@
notify:
- ora | restart ora
- ora | restart ora_celery
tags:
- deploy
#Needed if using redis to prevent memory issues
- name: ora | change memory commit settings -- needed for redis
......@@ -75,8 +61,6 @@
notify:
- ora | restart ora
- ora | restart ora_celery
tags:
- deploy
- name: ora | syncdb and migrate
shell: SERVICE_VARIANT=ora {{ora_venv_dir}}/bin/django-admin.py syncdb --migrate --noinput --settings=edx_ora.aws --pythonpath={{ora_code_dir}}
......@@ -85,8 +69,6 @@
notify:
- ora | restart ora
- ora | restart ora_celery
tags:
- deploy
- name: ora | create users
shell: SERVICE_VARIANT=ora {{ora_venv_dir}}/bin/django-admin.py update_users --settings=edx_ora.aws --pythonpath={{ora_code_dir}}
......@@ -94,8 +76,6 @@
notify:
- ora | restart ora
- ora | restart ora_celery
tags:
- deploy
# call supervisorctl update. this reloads
......@@ -108,7 +88,6 @@
register: supervisor_update
when: not devstack
changed_when: supervisor_update.stdout != ""
tags: deploy
- name: ora | ensure ora is started
supervisorctl_local: >
......@@ -117,7 +96,6 @@
config={{ supervisor_cfg }}
state=started
when: not devstack
tags: deploy
- name: ora | ensure ora_celery is started
supervisorctl_local: >
......@@ -126,4 +104,3 @@
config={{ supervisor_cfg }}
state=started
when: not devstack
tags: deploy
......@@ -5,8 +5,6 @@
notify:
- ora | restart ora
- ora | restart ora_celery
tags:
- deploy
- name: ora | install ease system packages
apt: pkg={{item}} state=present
......@@ -14,8 +12,6 @@
notify:
- ora | restart ora
- ora | restart ora_celery
tags:
- deploy
# Install the python pre requirements into {{ ora_ease_venv_dir }}
......@@ -25,8 +21,6 @@
notify:
- ora | restart ora
- ora | restart ora_celery
tags:
- deploy
# Install the python post requirements into {{ ora_ease_venv_dir }}
- name: ora | install ease python post-requirements
......@@ -35,8 +29,6 @@
notify:
- ora | restart ora
- ora | restart ora_celery
tags:
- deploy
- name: ora | install ease python package
shell: >
......@@ -45,8 +37,6 @@
notify:
- ora | restart ora
- ora | restart ora_celery
tags:
- deploy
- name: ora | download and install nltk
shell: |
......@@ -61,5 +51,3 @@
notify:
- ora | restart ora
- ora | restart ora_celery
tags:
- deploy
......@@ -48,7 +48,7 @@
- ora | restart ora_celery
with_items: ora_ease_debian_pkgs
- include: deploy.yml
- include: deploy.yml tags=deploy
- name: ora | create a symlink for venv python
file: >
......
......@@ -7,4 +7,3 @@
with_items:
- xqueue
- xqueue_consumer
tags: deploy
......@@ -3,8 +3,6 @@
src={{ item }}.conf.j2 dest={{ supervisor_cfg_dir }}/{{ item }}.conf
owner={{ supervisor_user }} group={{ common_web_user }} mode=0644
with_items: ['xqueue', 'xqueue_consumer']
tags:
- deploy
- name: xqueue | create xqueue application config
......@@ -12,16 +10,12 @@
sudo_user: "{{ xqueue_user }}"
notify:
- xqueue | restart xqueue
tags:
- deploy
- name: xqueue | create xqueue auth file
template: src=xqueue.auth.json.j2 dest={{ xqueue_app_dir }}/xqueue.auth.json mode=0644
sudo_user: "{{ xqueue_user }}"
notify:
- xqueue | restart xqueue
tags:
- deploy
# Do A Checkout
- name: xqueue | git checkout xqueue repo into xqueue_code_dir
......@@ -29,8 +23,6 @@
sudo_user: "{{ xqueue_user }}"
notify:
- xqueue | restart xqueue
tags:
- deploy
# Install the python pre requirements into {{ xqueue_venv_dir }}
......@@ -39,8 +31,6 @@
sudo_user: "{{ xqueue_user }}"
notify:
- xqueue | restart xqueue
tags:
- deploy
# Install the python post requirements into {{ xqueue_venv_dir }}
- name : xqueue | install python post-requirements
......@@ -48,8 +38,6 @@
sudo_user: "{{ xqueue_user }}"
notify:
- xqueue | restart xqueue
tags:
- deploy
- name: xqueue | syncdb and migrate
shell: >
......@@ -58,8 +46,6 @@
sudo_user: "{{ xqueue_user }}"
notify:
- xqueue | restart xqueue
tags:
- deploy
- name: xqueue | create users
shell: >
......@@ -67,9 +53,6 @@
sudo_user: "{{ xqueue_user }}"
notify:
- xqueue | restart xqueue
tags:
- deploy
# call supervisorctl update. this reloads
# the supervisorctl config and restarts
......@@ -80,7 +63,6 @@
shell: "{{ supervisor_ctl }} -c {{ supervisor_cfg }} update"
register: supervisor_update
changed_when: supervisor_update.stdout != ""
tags: deploy
- name: xqueue | ensure xqueue, consumer is running
supervisorctl_local: >
......@@ -91,4 +73,3 @@
with_items:
- xqueue
- xqueue_consumer
tags: deploy
......@@ -44,7 +44,7 @@
- xqueue | restart xqueue
when: xqueue_create_db is defined and xqueue_create_db|lower == "yes"
- include: deploy.yml
- include: deploy.yml tags=deploy
- name: xqueue | create a symlink for venv python
file: >
......
......@@ -20,5 +20,4 @@
supervisorctl_path={{ supervisor_ctl }}
config={{ supervisor_cfg }}
state=restarted
tags: deploy
......@@ -2,52 +2,38 @@
template: >
src=xserver.conf.j2 dest={{ supervisor_cfg_dir }}/xserver.conf
owner={{ supervisor_user }} group={{ common_web_user }} mode=0644
tags:
- deploy
- name: xserver | checkout code
git: dest={{xserver_code_dir}} repo={{xserver_source_repo}} version={{xserver_version}}
sudo_user: "{{ xserver_user }}"
notify: xserver | restart xserver
tags:
- deploy
- name: xserver | install requirements
pip: requirements="{{xserver_requirements_file}}" virtualenv="{{ xserver_venv_dir }}" state=present
sudo_user: "{{ xserver_user }}"
notify: xserver | restart xserver
tags:
- deploy
- name: xserver | install sandbox requirements
pip: requirements="{{xserver_requirements_file}}" virtualenv="{{xserver_venv_sandbox_dir}}" state=present
sudo_user: "{{ xserver_user }}"
notify: xserver | restart xserver
tags:
- deploy
- name: xserver | create xserver application config
template: src=xserver.env.json.j2 dest={{ xserver_app_dir }}/env.json
sudo_user: "{{ xserver_user }}"
notify: xserver | restart xserver
tags:
- deploy
- name: xserver | install read-only ssh key for the content repo that is required for grading
copy: >
src={{ XSERVER_LOCAL_GIT_IDENTITY }} dest={{ xserver_git_identity }}
owner={{ xserver_user }} group={{ xserver_user }} mode=0600
notify: xserver | restart xserver
tags:
- deploy
- name: xserver | upload ssh script
template: >
src=git_ssh.sh.j2 dest=/tmp/git_ssh.sh
owner={{ xserver_user }} mode=750
notify: xserver | restart xserver
tags:
- deploy
- name: xserver | checkout grader code
git: dest={{ XSERVER_GRADER_DIR }} repo={{ XSERVER_GRADER_SOURCE }} version={{ xserver_grader_version }}
......@@ -55,14 +41,10 @@
GIT_SSH: /tmp/git_ssh.sh
notify: xserver | restart xserver
sudo_user: "{{ xserver_user }}"
tags:
- deploy
- name: xserver | remove read-only ssh key for the content repo
file: path={{ xserver_git_identity }} state=absent
notify: xserver | restart xserver
tags:
- deploy
# call supervisorctl update. this reloads
# the supervisorctl config and restarts
......@@ -73,7 +55,6 @@
shell: "{{ supervisor_ctl }} -c {{ supervisor_cfg }} update"
register: supervisor_update
changed_when: supervisor_update.stdout != ""
tags: deploy
- name: xserver | ensure xserver is started
supervisorctl_local: >
......@@ -81,5 +62,4 @@
supervisorctl_path={{ supervisor_ctl }}
config={{ supervisor_cfg }}
state=started
tags: deploy
......@@ -62,7 +62,7 @@
- "{{ secure_dir }}/files/edx_apparmor_sandbox.j2"
- "usr.bin.python-sandbox.j2"
- include: deploy.yml
- include: deploy.yml tags=deploy
- name: xserver | enforce app-armor rules
command: aa-enforce {{ xserver_venv_sandbox_dir }}
......
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