Commit 753be18d by Arbab Nazar Committed by GitHub

Merge pull request #3125 from edx/arbab/ops-1593

parameters written as fully expanded YAML dictionaries
parents 759fd5f6 b9ab1682
......@@ -38,7 +38,7 @@
- name: set git fetch.prune to ignore deleted remote refs
shell: git config --global fetch.prune true
sudo_user: "{{ edxapp_user }}"
become_user: "{{ edxapp_user }}"
tags:
- install
- install:base
......@@ -50,7 +50,7 @@
repo: "{{ edx_platform_repo }}"
version: "{{ edx_platform_version }}"
accept_hostkey: yes
sudo_user: "{{ edxapp_user }}"
become_user: "{{ edxapp_user }}"
environment:
GIT_SSH: "{{ edxapp_git_ssh }}"
register: edxapp_platform_checkout
......@@ -60,7 +60,7 @@
- name: git clean after checking out edx-platform
shell: cd {{ edxapp_code_dir }} && git clean -xdf
sudo_user: "{{ edxapp_user }}"
become_user: "{{ edxapp_user }}"
tags:
- install
- install:code
......@@ -78,7 +78,7 @@
version: "{{ edxapp_theme_version }}"
accept_hostkey: yes
when: edxapp_theme_name != ''
sudo_user: "{{ edxapp_user }}"
become_user: "{{ edxapp_user }}"
environment:
GIT_SSH: "{{ edxapp_git_ssh }}"
register: edxapp_theme_checkout
......@@ -97,7 +97,7 @@
version: "{{ EDXAPP_COMPREHENSIVE_THEME_VERSION }}"
accept_hostkey: yes
when: EDXAPP_COMPREHENSIVE_THEME_SOURCE_REPO != ''
sudo_user: "{{ edxapp_user }}"
become_user: "{{ edxapp_user }}"
environment:
GIT_SSH: "{{ edxapp_git_ssh }}"
register: edxapp_comprehensive_theme_checkout
......@@ -120,7 +120,7 @@
- name: Updating requirement files for git mirror
command: |
/bin/sed -i -e 's/github\.com/{{ COMMON_GIT_MIRROR }}/g' {{ item.item }}
sudo_user: "{{ edxapp_user }}"
become_user: "{{ edxapp_user }}"
when: item.stat.exists
with_items: "{{ requirement_file_stats.results }}"
tags:
......@@ -153,7 +153,7 @@
# Node play that need to be run after platform updates.
- name: Install edx-platform npm dependencies
shell: npm install chdir={{ edxapp_code_dir }}
sudo_user: "{{ edxapp_user }}"
become_user: "{{ edxapp_user }}"
environment: "{{ edxapp_environment }}"
tags:
- install
......@@ -164,7 +164,7 @@
virtualenv {{ edxapp_venv_dir }}
chdir={{ edxapp_code_dir }}
creates={{ edxapp_venv_dir }}/bin/pip
sudo_user: "{{ edxapp_user }}"
become_user: "{{ edxapp_user }}"
environment: "{{ edxapp_environment }}"
tags:
- install
......@@ -187,7 +187,7 @@
command: >
{{ edxapp_venv_dir }}/bin/pip install {{ COMMON_PIP_VERBOSITY }} -i {{ COMMON_PYPI_MIRROR_URL }} --exists-action w -r {{ item.item }}
chdir={{ edxapp_code_dir }}
sudo_user: "{{ edxapp_user }}"
become_user: "{{ edxapp_user }}"
environment: "{{ edxapp_environment }}"
when: item.stat.exists
with_items: "{{ python_requirement_files.results }}"
......@@ -206,7 +206,7 @@
chdir={{ edxapp_code_dir }}
with_items:
- "{{ private_requirements_file }}"
sudo_user: "{{ edxapp_user }}"
become_user: "{{ edxapp_user }}"
environment:
GIT_SSH: "{{ edxapp_git_ssh }}"
when: EDXAPP_INSTALL_PRIVATE_REQUIREMENTS
......@@ -223,7 +223,7 @@
virtualenv: "{{ edxapp_venv_dir }}"
state: present
with_items: EDXAPP_EXTRA_REQUIREMENTS
sudo_user: "{{ edxapp_user }}"
become_user: "{{ edxapp_user }}"
tags:
- install
- install:app-requirements
......@@ -236,7 +236,7 @@
virtualenv: "{{ edxapp_venv_dir }}"
state: present
extra_args: "-i {{ COMMON_PYPI_MIRROR_URL }} --exists-action w"
sudo_user: "{{ edxapp_user }}"
become_user: "{{ edxapp_user }}"
when: EDXAPP_CAS_ATTRIBUTE_PACKAGE|length > 0
tags:
- install
......@@ -254,7 +254,7 @@
- "{{ sandbox_base_requirements }}"
- "{{ sandbox_local_requirements }}"
- "{{ sandbox_post_requirements }}"
sudo_user: "{{ edxapp_user }}"
become_user: "{{ edxapp_user }}"
when: not EDXAPP_PYTHON_SANDBOX
tags:
- install
......@@ -278,7 +278,7 @@
virtualenv: "{{ edxapp_sandbox_venv_dir }}"
state: present
extra_args: "-i {{ COMMON_PYPI_MIRROR_URL }} --exists-action w"
sudo_user: "{{ edxapp_sandbox_user }}"
become_user: "{{ edxapp_sandbox_user }}"
when: EDXAPP_PYTHON_SANDBOX
tags:
- edxapp-sandbox
......@@ -292,7 +292,7 @@
with_items:
- "{{ sandbox_local_requirements }}"
- "{{ sandbox_post_requirements }}"
sudo_user: "{{ edxapp_sandbox_user }}"
become_user: "{{ edxapp_sandbox_user }}"
when: EDXAPP_PYTHON_SANDBOX
register: sandbox_install_output
changed_when: sandbox_install_output.stdout is defined and 'installed' in sandbox_install_output.stdout
......@@ -311,7 +311,7 @@
- name: compiling all py files in the edx-platform repo
shell: "{{ edxapp_venv_bin }}/python -m compileall -q -x .git/.* {{ edxapp_code_dir }}"
sudo_user: "{{ edxapp_user }}"
become_user: "{{ edxapp_user }}"
tags:
- install
- install:code
......@@ -345,7 +345,7 @@
- name: update supervisor configuration
shell: "{{ supervisor_ctl }} -c {{ supervisor_cfg }} update"
register: supervisor_update
sudo_user: "{{ supervisor_service_user }}"
become_user: "{{ supervisor_service_user }}"
changed_when: supervisor_update.stdout is defined and supervisor_update.stdout != ""
when: not disable_edx_services
tags:
......@@ -357,7 +357,7 @@
supervisorctl_path: "{{ supervisor_ctl }}"
config: "{{ supervisor_cfg }}"
state: started
sudo_user: "{{ supervisor_service_user }}"
become_user: "{{ supervisor_service_user }}"
when: celery_worker is not defined and not disable_edx_services
tags:
- manage
......@@ -369,7 +369,7 @@
config: "{{ supervisor_cfg }}"
state: started
when: celery_worker is defined and not disable_edx_services
sudo_user: "{{ supervisor_service_user }}"
become_user: "{{ supervisor_service_user }}"
tags:
- manage
......@@ -413,7 +413,7 @@
config: "{{ supervisor_cfg }}"
state: restarted
when: edxapp_installed is defined and celery_worker is not defined and not disable_edx_services
sudo_user: "{{ supervisor_service_user }}"
become_user: "{{ supervisor_service_user }}"
tags:
- manage
......@@ -424,6 +424,6 @@
config: "{{ supervisor_cfg }}"
state: restarted
when: edxapp_installed is defined and celery_worker is defined and not disable_edx_services
sudo_user: "{{ common_web_user }}"
become_user: "{{ common_web_user }}"
tags:
- manage
......@@ -3,7 +3,7 @@
template:
src: "{{ item[0] }}.{{ item[1] }}.json.j2"
dest: "{{ edxapp_app_dir }}/{{ item[0] }}.{{ item[1] }}.json"
sudo_user: "{{ edxapp_user }}"
become_user: "{{ edxapp_user }}"
with_nested:
- "{{ service_variants_enabled }}"
- [ 'env', 'auth' ]
......@@ -16,7 +16,7 @@
template:
src: "{{ item[0] }}.{{ item[1] }}.yaml.j2"
dest: "{{ EDXAPP_CFG_DIR }}/{{ item[0] }}.{{ item[1] }}.yaml"
sudo_user: "{{ edxapp_user }}"
become_user: "{{ edxapp_user }}"
with_nested:
- "{{ service_variants_enabled }}"
- [ 'env', 'auth' ]
......@@ -32,7 +32,7 @@
dest: "{{ supervisor_available_dir }}/{{ item }}.conf"
owner: "{{ supervisor_user }}"
group: "{{ supervisor_user }}"
sudo_user: "{{ supervisor_user }}"
become_user: "{{ supervisor_user }}"
with_items: "{{ service_variants_enabled }}"
tags:
- install
......@@ -45,7 +45,7 @@
dest: "{{ supervisor_available_dir }}/{{ item }}"
owner: "{{ supervisor_user }}"
group: "{{ supervisor_user }}"
sudo_user: "{{ supervisor_user }}"
become_user: "{{ supervisor_user }}"
with_items:
- edxapp.conf
- workers.conf
......@@ -57,7 +57,7 @@
template:
src: "{{ item }}_gunicorn.py.j2"
dest: "{{ edxapp_app_dir }}/{{ item }}_gunicorn.py"
sudo_user: "{{ edxapp_user }}"
become_user: "{{ edxapp_user }}"
with_items: "{{ service_variants_enabled }}"
tags:
- install
......@@ -70,7 +70,7 @@
dest: "{{ supervisor_cfg_dir }}/{{ item }}.conf"
state: link
force: yes
sudo_user: "{{ supervisor_user }}"
become_user: "{{ supervisor_user }}"
with_items: "{{ service_variants_enabled }}"
when: celery_worker is not defined and not disable_edx_services
tags:
......@@ -83,7 +83,7 @@
dest: "{{ supervisor_cfg_dir }}/edxapp.conf"
state: link
force: yes
sudo_user: "{{ supervisor_user }}"
become_user: "{{ supervisor_user }}"
when: celery_worker is not defined and not disable_edx_services
tags:
- install
......@@ -95,7 +95,7 @@
dest: "{{ supervisor_cfg_dir }}/workers.conf"
state: link
force: yes
sudo_user: "{{ supervisor_user }}"
become_user: "{{ supervisor_user }}"
when: celery_worker is defined and not disable_edx_services
tags:
- install
......
......@@ -26,14 +26,14 @@
args:
chdir: "{{ NEWRELIC_NPI_PREFIX }}"
creates: "{{ NEWRELIC_NPI_PREFIX }}/plugins/{{ ELASTICSEARCH_MONITOR_PLUGIN }}.compressed"
sudo_user: "{{ NEWRELIC_USER }}"
become_user: "{{ NEWRELIC_USER }}"
- name: prepare elasticsearch plugin
shell: >
./npi prepare {{ ELASTICSEARCH_MONITOR_PLUGIN }} -n
args:
chdir: "{{ NEWRELIC_NPI_PREFIX }}"
sudo_user: "{{ NEWRELIC_USER }}"
become_user: "{{ NEWRELIC_USER }}"
- name: configure elasticsearch plugin
template: >
......@@ -47,5 +47,5 @@
./npi add-service {{ ELASTICSEARCH_MONITOR_PLUGIN }} --start --user={{ NEWRELIC_USER }}
args:
chdir: "{{ NEWRELIC_NPI_PREFIX }}"
sudo_user: "root"
become_user: "root"
......@@ -41,7 +41,7 @@
virtualenv: "{{ flower_venv_dir }}"
state: present
extra_args: "-i {{ COMMON_PYPI_MIRROR_URL }}"
sudo_user: "{{ FLOWER_USER }}"
become_user: "{{ FLOWER_USER }}"
environment: "{{ flower_environment }}"
with_items: "{{ flower_python_reqs }}"
notify:
......@@ -53,7 +53,7 @@
dest: "{{ supervisor_available_dir }}/{{ FLOWER_USER }}.conf"
owner: "{{ supervisor_user }}"
group: "{{ supervisor_user }}"
sudo_user: "{{ supervisor_user }}"
become_user: "{{ supervisor_user }}"
notify:
- restart flower
......@@ -63,14 +63,14 @@
dest: "{{ supervisor_cfg_dir }}/{{ FLOWER_USER }}.conf"
state: link
force: yes
sudo_user: "{{ supervisor_user }}"
become_user: "{{ supervisor_user }}"
notify:
- restart flower
- name: Update supervisor configuration
shell: "{{ supervisor_ctl }} -c {{ supervisor_cfg }} update"
register: supervisor_update
sudo_user: "{{ supervisor_service_user }}"
become_user: "{{ supervisor_service_user }}"
changed_when: supervisor_update.stdout is defined and supervisor_update.stdout != ""
notify:
- restart flower
......@@ -6,7 +6,7 @@
owner: "{{ supervisor_user }}"
group: "{{ supervisor_user }}"
mode: 0644
sudo_user: "{{ supervisor_user }}"
become_user: "{{ supervisor_user }}"
register: forum_supervisor
tags:
- install
......@@ -20,7 +20,7 @@
state: link
force: yes
mode: 0644
sudo_user: "{{ supervisor_user }}"
become_user: "{{ supervisor_user }}"
when: not disable_edx_services
register: forum_supervisor
tags:
......@@ -32,7 +32,7 @@
src: "{{ forum_supervisor_wrapper|basename }}.j2"
dest: "{{ forum_supervisor_wrapper }}"
mode: 0755
sudo_user: "{{ forum_user }}"
become_user: "{{ forum_user }}"
notify: restart the forum service
tags:
- install
......@@ -44,7 +44,7 @@
repo: "{{ forum_source_repo }}"
version: "{{ forum_version }}"
accept_hostkey: yes
sudo_user: "{{ forum_user }}"
become_user: "{{ forum_user }}"
register: forum_checkout
notify: restart the forum service
tags:
......@@ -53,7 +53,7 @@
- name: install comments service bundle
shell: "bundle install --deployment --path {{ forum_gem_root }} chdir={{ forum_code_dir }}"
sudo_user: "{{ forum_user }}"
become_user: "{{ forum_user }}"
environment: "{{ forum_environment }}"
notify: restart the forum service
tags:
......
......@@ -19,7 +19,7 @@
#
- name: set git fetch.prune to ignore deleted remote refs
shell: git config --global fetch.prune true
sudo_user: "{{ repo_owner }}"
become_user: "{{ repo_owner }}"
when: GIT_REPOS is defined
tags:
- install
......@@ -53,7 +53,7 @@
version: "{{ item.VERSION }}"
accept_hostkey: yes
key_file: "{{ git_home }}/.ssh/{{ item.REPO }}"
sudo_user: "{{ repo_owner }}"
become_user: "{{ repo_owner }}"
register: code_checkout
when: item.PROTOCOL == "ssh" and GIT_REPOS is defined
with_items: GIT_REPOS
......@@ -66,7 +66,7 @@
repo: "https://{{ item.DOMAIN }}/{{ item.PATH }}/{{ item.REPO }}"
dest: "{{ item.DESTINATION }}"
version: "{{ item.VERSION }}"
sudo_user: "{{ repo_owner }}"
become_user: "{{ repo_owner }}"
register: code_checkout
when: item.PROTOCOL == "https" and GIT_REPOS is defined
with_items: GIT_REPOS
......
......@@ -2,7 +2,7 @@
- name: clone all course repos
git_2_0_1: dest={{ GITRELOAD_REPODIR }}/{{ item.name }} repo={{ item.url }} version={{ item.commit }}
sudo_user: "{{ common_web_user }}"
become_user: "{{ common_web_user }}"
with_items: GITRELOAD_REPOS
- name: do import of courses
......@@ -10,7 +10,7 @@
executable=/bin/bash
chdir="{{ edxapp_code_dir }}"
SERVICE_VARIANT=lms {{ edxapp_venv_bin }}/python manage.py lms --settings=aws git_add_course {{ item.url }} {{ GITRELOAD_REPODIR }}/{{ item.name }}
sudo_user: "{{ common_web_user }}"
become_user: "{{ common_web_user }}"
with_items: GITRELOAD_REPOS
- name: change ownership on repos for access by edxapp and www-data
......
- name: create ssh dir for the content repos key
file: path=~/.ssh state=directory mode=0700
sudo_user: "{{ common_web_user }}"
become_user: "{{ common_web_user }}"
- name: install ssh key for the content repos
copy: content="{{ GITRELOAD_GIT_IDENTITY }}" dest=~/.ssh/id_rsa mode=0600
sudo_user: "{{ common_web_user }}"
become_user: "{{ common_web_user }}"
- include: course_pull.yml
when: GITRELOAD_COURSE_CHECKOUT|bool
......@@ -15,18 +15,18 @@
name=git+{{ gitreload_repo }}@{{ gitreload_version }}#egg=gitreload
virtualenv={{ gitreload_venv }}
extra_args="--exists-action w"
sudo_user: "{{ gitreload_user }}"
become_user: "{{ gitreload_user }}"
notify: restart gitreload
- name: copy configuration
template: src=edx/app/gitreload/gr.env.json.j2 dest={{ gitreload_dir }}/gr.env.json
sudo_user: "{{ gitreload_user }}"
become_user: "{{ gitreload_user }}"
notify: restart gitreload
- name: "add gunicorn configuration file"
template: >
src=edx/app/gitreload/gitreload_gunicorn.py.j2 dest={{ gitreload_dir }}/gitreload_gunicorn.py
sudo_user: "{{ gitreload_user }}"
become_user: "{{ gitreload_user }}"
notify: restart gitreload
- name: "writing supervisor script"
......
......@@ -20,7 +20,7 @@
# Example playbook:
#
# - hosts: all
# sudo: True
# become: True
# gather_facts: True
# vars:
# COMMON_ENABLE_BASIC_AUTH: True
......@@ -60,7 +60,7 @@
- name: grab ssh host keys
shell: ssh-keyscan {{ item }}
sudo_user: "{{ common_web_user }}"
become_user: "{{ common_web_user }}"
with_items: GITRELOAD_HOSTS
register: gitreload_repo_host_keys
......@@ -69,7 +69,7 @@
create=yes
dest=~/.ssh/known_hosts
line="{{ item.stdout }}"
sudo_user: "{{ common_web_user }}"
become_user: "{{ common_web_user }}"
with_items: gitreload_repo_host_keys.results
- name: create a symlink for venv python
......
......@@ -18,7 +18,7 @@
#
# - name: Configure instance(s)
# hosts: go-server
# sudo: True
# become: True
# vars_files:
# - "{{ secure_dir }}/admin/sandbox.yml"
# gather_facts: True
......
......@@ -22,7 +22,7 @@
#
# - name: Configure instance(s)
# hosts: go-server
# sudo: True
# become: True
# vars_files:
# - "{{ secure_dir }}/admin/sandbox.yml"
# gather_facts: True
......
......@@ -18,7 +18,7 @@
#
# - name: Configure instance(s)
# hosts: go-server
# sudo: True
# become: True
# vars_files:
# - "{{ secure_dir }}/admin/sandbox.yml"
# gather_facts: True
......
......@@ -19,7 +19,7 @@
#
# - name: Configure instance(s)
# hosts: go-server
# sudo: True
# become: True
# vars_files:
# - "{{ secure_dir }}/admin/sandbox.yml"
# gather_facts: True
......
......@@ -36,5 +36,5 @@
- name: namenode formatted
shell: >
. {{ HADOOP_COMMON_CONF_DIR }}/hadoop-env.sh && hdfs namenode -format
sudo_user: "{{ hadoop_common_user }}"
become_user: "{{ hadoop_common_user }}"
when: not namenode_version_file.stat.exists
......@@ -18,7 +18,7 @@
dest={{ harprofiler_dir }}
repo={{ harprofiler_github_url }} version={{ harprofiler_version }}
accept_hostkey=yes
sudo_user: "{{ harprofiler_user }}"
become_user: "{{ harprofiler_user }}"
- name: set bashrc for harprofiler user
template: >
......@@ -28,7 +28,7 @@
- name: install requirements
pip: >
requirements="{{ harprofiler_dir }}/requirements.txt" virtualenv="{{ harprofiler_venv_dir }}"
sudo_user: "{{ harprofiler_user }}"
become_user: "{{ harprofiler_user }}"
- name: update config file
# harprofiler ships with a default config file. Doing a line-replace for the default
......@@ -45,10 +45,10 @@
src: validate_harprofiler_install.sh.j2
dest: "{{ harprofiler_dir }}/{{ harprofiler_validation_script }}"
mode: 0755
sudo_user: "{{ harprofiler_user }}"
become_user: "{{ harprofiler_user }}"
- name: test install
shell: >
./{{ harprofiler_validation_script }} chdir={{ harprofiler_dir }}
sudo_user: "{{ harprofiler_user }}"
become_user: "{{ harprofiler_user }}"
......@@ -30,7 +30,7 @@
tags:
- install
- install:app-requirements
sudo_user: "{{ harstorage_user }}"
become_user: "{{ harstorage_user }}"
with_items: harstorage_python_pkgs
- name: create directories
......
......@@ -37,7 +37,7 @@
requirements="{{ insights_requirements_base }}/{{ item }}"
virtualenv="{{ insights_venv_dir }}"
state=present extra_args="--exists-action w"
sudo_user: "{{ insights_user }}"
become_user: "{{ insights_user }}"
with_items: insights_requirements
tags:
- install
......@@ -47,14 +47,14 @@
shell: >
creates={{ insights_nodeenv_dir }}
{{ insights_venv_dir }}/bin/nodeenv {{ insights_nodeenv_dir }} --prebuilt
sudo_user: "{{ insights_user }}"
become_user: "{{ insights_user }}"
tags:
- install
- install:base
- name: install node dependencies
npm: executable={{ insights_nodeenv_bin }}/npm path={{ insights_code_dir }} production=yes
sudo_user: "{{ insights_user }}"
become_user: "{{ insights_user }}"
tags:
- install
- install:app-requirements
......@@ -64,7 +64,7 @@
shell: >
chdir={{ insights_code_dir }}
. {{ insights_nodeenv_bin }}/activate && {{ insights_node_bin }}/bower install --production --config.interactive=false
sudo_user: "{{ insights_user }}"
become_user: "{{ insights_user }}"
tags:
- install
- install:app-requirements
......@@ -75,7 +75,7 @@
DB_MIGRATION_USER='{{ COMMON_MYSQL_MIGRATE_USER }}'
DB_MIGRATION_PASS='{{ COMMON_MYSQL_MIGRATE_PASS }}'
{{ insights_venv_dir }}/bin/python {{ insights_manage }} migrate --noinput
sudo_user: "{{ insights_user }}"
become_user: "{{ insights_user }}"
environment: "{{ insights_environment }}"
when: migrate_db is defined and migrate_db|lower == "yes"
tags:
......@@ -86,7 +86,7 @@
shell: >
chdir={{ insights_code_dir }}
. {{ insights_nodeenv_bin }}/activate && {{ insights_node_bin }}/r.js -o build.js
sudo_user: "{{ insights_user }}"
become_user: "{{ insights_user }}"
tags:
- assets
- assets:gather
......@@ -95,7 +95,7 @@
shell: >
chdir={{ insights_code_dir }}
{{ insights_venv_dir }}/bin/python {{ insights_manage }} {{ item }}
sudo_user: "{{ insights_user }}"
become_user: "{{ insights_user }}"
environment: "{{ insights_environment }}"
with_items:
- "collectstatic --noinput"
......@@ -108,7 +108,7 @@
shell: >
chdir={{ insights_code_dir }}/analytics_dashboard
. {{ insights_venv_dir }}/bin/activate && i18n_tool generate -v
sudo_user: "{{ insights_user }}"
become_user: "{{ insights_user }}"
tags:
- assets
- assets:gather
......@@ -178,6 +178,6 @@
config={{ supervisor_cfg }}
name={{ insights_service_name }}
when: not disable_edx_services
sudo_user: "{{ supervisor_service_user }}"
become_user: "{{ supervisor_service_user }}"
tags:
- manage:start
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