Skip to content
This repository has been archived by the owner on May 6, 2024. It is now read-only.

Commit

Permalink
Merge pull request #4243 from open-craft/kshitij/run_migrations_once_2
Browse files Browse the repository at this point in the history
Restrict migration tasks to single host.
  • Loading branch information
nadeemshahzad authored Jan 5, 2018
2 parents ba692cb + b614377 commit 4e4c2fa
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions playbooks/roles/analytics_api/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
become_user: "{{ analytics_api_user }}"
environment: "{{ analytics_api_environment }}"
when: migrate_db is defined and migrate_db|lower == "yes"
run_once: yes
tags:
- migrate
- migrate:db
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
sudo_user: "{{ '{{' }} {{ role_name }}_user }}"
environment: "{{ '{{' }} {{ role_name }}_migration_environment }}"
when: migrate_db is defined and migrate_db|lower == "yes"
run_once: yes
tags:
- migrate
- migrate:db
Expand Down
2 changes: 2 additions & 0 deletions playbooks/roles/edx_django_service/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@
become_user: "{{ edx_django_service_user }}"
environment: "{{ edx_django_service_migration_environment }}"
when: migrate_db is defined and migrate_db|lower == "yes"
run_once: yes
tags:
- migrate
- migrate:db
Expand All @@ -123,6 +124,7 @@
environment: "{{ edx_django_service_environment }}"
with_items: '{{ edx_django_service_post_migrate_commands }}'
when: migrate_db is defined and migrate_db|lower == "yes" and item.when | bool
run_once: yes
tags:
- migrate
- migrate:db
Expand Down
1 change: 1 addition & 0 deletions playbooks/roles/edx_notes_api/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
environment:
EDXNOTES_CONFIG_ROOT: "{{ COMMON_CFG_DIR }}"
when: migrate_db is defined and migrate_db|lower == "yes"
run_once: yes
tags:
- migrate
- migrate:db
Expand Down
1 change: 1 addition & 0 deletions playbooks/roles/edxapp/tasks/service_variant_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@
- name: migrate
command: "{{ COMMON_BIN_DIR }}/edxapp-migrate-{{ item }}"
when: migrate_db is defined and migrate_db|lower == "yes" and COMMON_MYSQL_MIGRATE_PASS and item != "lms-preview"
run_once: yes
environment:
DB_MIGRATION_USER: "{{ COMMON_MYSQL_MIGRATE_USER }}"
DB_MIGRATION_PASS: "{{ COMMON_MYSQL_MIGRATE_PASS }}"
Expand Down
2 changes: 2 additions & 0 deletions playbooks/roles/forum/tasks/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
become_user: "{{ forum_user }}"
environment: "{{ forum_base_env }}"
when: migrate_db is defined and migrate_db|lower == "yes"
run_once: yes
tags:
- migrate
- migrate:db
Expand All @@ -78,6 +79,7 @@
become_user: "{{ forum_user }}"
environment: "{{ forum_base_env }}"
when: migrate_db is defined and migrate_db|lower == "yes" and FORUM_REBUILD_INDEX|bool
run_once: yes
tags:
- migrate
- migrate:db
Expand Down
1 change: 1 addition & 0 deletions playbooks/roles/insights/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
become_user: "{{ insights_user }}"
environment: "{{ insights_environment }}"
when: migrate_db is defined and migrate_db|lower == "yes"
run_once: yes
tags:
- migrate
- migrate:db
Expand Down
1 change: 1 addition & 0 deletions playbooks/roles/xqueue/tasks/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
DB_MIGRATION_USER: "{{ COMMON_MYSQL_MIGRATE_USER }}"
DB_MIGRATION_PASS: "{{ COMMON_MYSQL_MIGRATE_PASS }}"
when: migrate_db is defined and migrate_db|lower == "yes" and COMMON_MYSQL_MIGRATE_PASS
run_once: yes
tags:
- migrate
- migrate:db
Expand Down

0 comments on commit 4e4c2fa

Please sign in to comment.