mirror of
https://bitbucket.org/atlassian/dc-deployments-automation.git
synced 2025-12-14 00:43:06 -06:00
Merged in DCD-797-restore_independent-of_db_init_role (pull request #61)
DCD-797: Make restore work without requiring database_init role to be run * DCD-797: Make restore work without requiring database_init role to be run * DCD-797: Fixes error with yaml lint * DCD-797: Adds check before running restore database tasks * DCD-797: Restore a database when either db_creted.changed is true or when `atl_force_db_restore` variable is set to true * DCD-797: set default filter to return a default value when the argument is a python false-y value. Update readme to reflect name of extra var env variable Approved-by: Ben Partridge <bpartridge@atlassian.com> Approved-by: Steve Smith <ssmith@atlassian.com>
This commit is contained in:
@@ -85,6 +85,8 @@
|
||||
include_tasks: "{{ ansible_distribution|lower }}.yml"
|
||||
|
||||
|
||||
# Restores the application database. If a var with name `atl_force_db_restore` is set to true, the database will be restored even when the database has not been created in the same playbook run.
|
||||
# This is done to accommodate running the restore role independent of the database_init role.
|
||||
- name: Restore application database
|
||||
postgresql_db:
|
||||
login_host: "{{ atl_db_host }}"
|
||||
@@ -106,8 +108,8 @@
|
||||
failed_when:
|
||||
- result.rc != 0
|
||||
- '"COMMENT ON EXTENSION" not in result.msg'
|
||||
when: db_created.changed and atl_backup_db_dest is defined
|
||||
|
||||
# default('false', true) filter makes the default filter return the specified default value for python False-y values (like an empty string)
|
||||
when: atl_backup_db_dest is defined and (db_created.changed or (atl_force_db_restore | default('false', true) | bool))
|
||||
|
||||
- name: Restore shared home
|
||||
include_tasks: "home_restore.yml"
|
||||
|
||||
Reference in New Issue
Block a user