parameters written as fully expanded YAML dictionaries

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