Commit 530ee8a9 by arbabnazar

use the YAML style parameter passing instead of old style module calls

parent 5937b3f9
- name: "create {{ item }} application config" ---
template: > - name: create application and auth config
src={{ item }}.env.json.j2 template:
dest={{ edxapp_app_dir }}/{{ item }}.env.json src: "{{ item[0] }}.{{ item[1] }}.json.j2"
dest: "{{ edxapp_app_dir }}/{{ item[0] }}.{{ item[1] }}.json"
sudo_user: "{{ edxapp_user }}" sudo_user: "{{ edxapp_user }}"
with_items: service_variants_enabled with_nested:
- "{{ service_variants_enabled }}"
- [ 'env', 'auth' ]
tags: tags:
- install - install
- install:configuration - install:configuration
- edxapp_cfg - edxapp_cfg
- name: "create {{ item }} auth file" - name: create auth and application yaml config
template: > template:
src={{ item }}.auth.json.j2 src: "{{ item[0] }}.{{ item[1] }}.yaml.j2"
dest={{ edxapp_app_dir }}/{{ item }}.auth.json dest: "{{ EDXAPP_CFG_DIR }}/{{ item[0] }}.{{ item[1] }}.yaml"
sudo_user: "{{ edxapp_user }}" sudo_user: "{{ edxapp_user }}"
with_items: service_variants_enabled with_nested:
tags: - "{{ service_variants_enabled }}"
- install - [ 'env', 'auth' ]
- install:configuration
- edxapp_cfg
- name: "create {{ item }} yaml application config"
template: >
src={{ item }}.env.yaml.j2
dest={{ EDXAPP_CFG_DIR }}/{{ item }}.env.yaml
sudo_user: "{{ edxapp_user }}"
with_items: service_variants_enabled
tags:
- install
- install:configuration
- edxapp_cfg
- name: "create {{ item }} yaml auth file"
template: >
src={{ item }}.auth.yaml.j2
dest={{ EDXAPP_CFG_DIR }}/{{ item }}.auth.yaml
sudo_user: "{{ edxapp_user }}"
with_items: service_variants_enabled
tags: tags:
- install - install
- install:configuration - install:configuration
- edxapp_cfg - edxapp_cfg
# write the supervisor scripts for the service variants # write the supervisor scripts for the service variants
- name: "writing {{ item }} supervisor script" - name: "writing {{ item }} supervisor script"
template: > template:
src={{ item }}.conf.j2 dest={{ supervisor_available_dir }}/{{ item }}.conf src: "{{ item }}.conf.j2"
owner={{ supervisor_user }} dest: "{{ supervisor_available_dir }}/{{ item }}.conf"
group={{ supervisor_user }} owner: "{{ supervisor_user }}"
with_items: service_variants_enabled group: "{{ supervisor_user }}"
sudo_user: "{{ supervisor_user }}" sudo_user: "{{ supervisor_user }}"
with_items: "{{ service_variants_enabled }}"
tags: tags:
- install - install
- install:configuration - install:configuration
- name: writing edxapp supervisor script # write the supervisor script for edxapp and celery workers
template: > - name: writing edxapp and celery supervisor scripts
src=edxapp.conf.j2 dest={{ supervisor_available_dir }}/edxapp.conf template:
owner={{ supervisor_user }} src: "{{ item }}.j2"
group={{ supervisor_user }} dest: "{{ supervisor_available_dir }}/{{ item }}"
owner: "{{ supervisor_user }}"
group: "{{ supervisor_user }}"
sudo_user: "{{ supervisor_user }}" sudo_user: "{{ supervisor_user }}"
with_items:
- edxapp.conf
- workers.conf
tags: tags:
- install - install
- install:configuration - 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"
with_items: service_variants_enabled dest: "{{ edxapp_app_dir }}/{{ item }}_gunicorn.py"
sudo_user: "{{ edxapp_user }}" sudo_user: "{{ edxapp_user }}"
tags: with_items: "{{ service_variants_enabled }}"
- install
- install:configuration
# write the supervisor script for celery workers
- name: writing celery worker supervisor script
template: >
src=workers.conf.j2 dest={{ supervisor_available_dir }}/workers.conf
owner={{ supervisor_user }}
group={{ supervisor_user }}
sudo_user: "{{ supervisor_user }}"
tags: tags:
- install - install
- install:configuration - install:configuration
# Enable the supervisor jobs # Enable the supervisor jobs
- name: "enable {{ item }} supervisor script" - name: "enable {{ item }} supervisor script"
file: > file:
src={{ supervisor_available_dir }}/{{ item }}.conf src: "{{ supervisor_available_dir }}/{{ item }}.conf"
dest={{ supervisor_cfg_dir }}/{{ item }}.conf dest: "{{ supervisor_cfg_dir }}/{{ item }}.conf"
state=link state: link
force=yes force: yes
with_items: service_variants_enabled
when: celery_worker is not defined and not disable_edx_services
sudo_user: "{{ supervisor_user }}" sudo_user: "{{ supervisor_user }}"
with_items: "{{ service_variants_enabled }}"
when: celery_worker is not defined and not disable_edx_services
tags: tags:
- install - install
- install:configuration - install:configuration
- name: "enable edxapp supervisor script" - name: enable edxapp supervisor script
file: > file:
src={{ supervisor_available_dir }}/edxapp.conf src: "{{ supervisor_available_dir }}/edxapp.conf"
dest={{ supervisor_cfg_dir }}/edxapp.conf dest: "{{ supervisor_cfg_dir }}/edxapp.conf"
state=link state: link
force=yes force: yes
when: celery_worker is not defined and not disable_edx_services
sudo_user: "{{ supervisor_user }}" sudo_user: "{{ supervisor_user }}"
when: celery_worker is not defined and not disable_edx_services
tags: tags:
- install - install
- install:configuration - install:configuration
- name: "enable celery worker supervisor script" - name: enable celery worker supervisor script
file: > file:
src={{ supervisor_available_dir }}/workers.conf src: "{{ supervisor_available_dir }}/workers.conf"
dest={{ supervisor_cfg_dir }}/workers.conf dest: "{{ supervisor_cfg_dir }}/workers.conf"
state=link state: link
force=yes force: yes
when: celery_worker is defined and not disable_edx_services
sudo_user: "{{ supervisor_user }}" sudo_user: "{{ supervisor_user }}"
when: celery_worker is defined and not disable_edx_services
tags: tags:
- install - install
- install:configuration - install:configuration
- name: create helper scripts for managing edxapp - name: create helper scripts for managing edxapp
template: > template:
src=edx/bin/{{ item[0] }}-{{ item[1] }}.j2 src: "edx/bin/{{ item[0] }}-{{ item[1] }}.j2"
dest={{ COMMON_BIN_DIR }}/{{ item[0] }}-{{ item[1] }} dest: "{{ COMMON_BIN_DIR }}/{{ item[0] }}-{{ item[1] }}"
owner={{ edxapp_user }} owner: "{{ edxapp_user }}"
mode=0755 mode: 0755
with_nested: with_nested:
- edxapp_helper_scripts - "{{ edxapp_helper_scripts }}"
- service_variants_enabled - "{{ service_variants_enabled }}"
tags: tags:
- install - install
- install:configuration - install:configuration
...@@ -145,16 +122,15 @@ ...@@ -145,16 +122,15 @@
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 }}"
EDX_PLATFORM_SETTINGS_OVERRIDE: "aws_migrate" EDX_PLATFORM_SETTINGS_OVERRIDE: "aws_migrate"
with_items: service_variants_enabled with_items: "{{ service_variants_enabled }}"
tags: tags:
- migrate - migrate
# Gather assets using paver if possible # Gather assets using paver if possible
- name: "gather {{ item }} static assets with paver"
- name: gather {{ item }} static assets with paver
command: "{{ COMMON_BIN_DIR }}/edxapp-update-assets-{{ item }}" command: "{{ COMMON_BIN_DIR }}/edxapp-update-assets-{{ item }}"
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"
with_items: service_variants_enabled with_items: "{{ service_variants_enabled }}"
tags: tags:
- gather_static_assets - gather_static_assets
- assets - assets
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