diff --git a/roles/sync/database_sync/database_sync-mysql/defaults/main.yml b/roles/sync/database_sync/database_sync-mysql/defaults/main.yml index 84f38e42..359f9e55 100644 --- a/roles/sync/database_sync/database_sync-mysql/defaults/main.yml +++ b/roles/sync/database_sync/database_sync-mysql/defaults/main.yml @@ -17,7 +17,6 @@ mysql_sync: # - dump: Use an existing dump. In that case, the "database" variable is the absolute file path. # This parameter is ignored if var 'path_on_deploy_server' is defined. type: fixed - #path_on_deploy_server: "" # full path to the compressed dump file on the deploy server, overrides "type" variable for source DB when defined. # For "rolling builds", so we can compute the database name. build_id: mybuildprod # Whether or not use to create a fresh database backup or use a nightly one. @@ -27,6 +26,9 @@ mysql_sync: dumps_directory: "/home/{{ deploy_user }}/shared/{{ project_name }}_{{ build_type }}/db_backups/mysql/regular" # If the source is on an ASG, provide the ASG name here. Otherwise, leave empty. asg: "" + # Uncomment and specify full path if you want to use your own dump file on the deploy server (gzip compressed). + # In this case it's the only variable you need in 'database.source'. + #path_on_deploy_server: "/home/{{ deploy_user }}/compressed_database_dump.gz" target: database: "{{ project_name }}_dev" credentials_file: "/home/{{ deploy_user }}/.mysql.creds" diff --git a/roles/sync/database_sync/database_sync-mysql/tasks/sync.yml b/roles/sync/database_sync/database_sync-mysql/tasks/sync.yml index 3904650a..0ae03be9 100644 --- a/roles/sync/database_sync/database_sync-mysql/tasks/sync.yml +++ b/roles/sync/database_sync/database_sync-mysql/tasks/sync.yml @@ -117,7 +117,7 @@ dest: "{{ _ce_deploy_build_tmp_dir }}/{{ database.target.database }}.sql.{{ archive_file_type }}" flat: true delegate_to: "{{ database.source.host }}" - when: + when: - database.source.path_on_deploy_server is not defined - name: Register tmp target dump name. @@ -156,14 +156,14 @@ ansible.builtin.copy: src: "{{ _ce_deploy_build_tmp_dir }}/{{ database.target.database }}.sql.{{ archive_file_type }}" dest: "{{ mysql_sync_target_dump_path }}" - when: + when: - database.source.path_on_deploy_server is not defined - name: Copy dump file from deploy server to destination. ansible.builtin.copy: src: "{{ database.source.path_on_deploy_server }}" dest: "{{ mysql_sync_target_dump_path }}" - when: + when: - database.source.path_on_deploy_server is defined - name: Unpack dump file. @@ -222,7 +222,7 @@ - database.source.asg | length > 0 - database.source.fresh_db is defined - database.source.fresh_db - when: + when: - database.source.path_on_deploy_server is not defined - name: Enable all autoscale processes on target ASG.