diff --git a/config/crd/bases/awx.ansible.com_awxs.yaml b/config/crd/bases/awx.ansible.com_awxs.yaml index e7f4019b..ecba167f 100644 --- a/config/crd/bases/awx.ansible.com_awxs.yaml +++ b/config/crd/bases/awx.ansible.com_awxs.yaml @@ -73,6 +73,9 @@ spec: type: string maxLength: 255 pattern: '^[a-zA-Z0-9][-a-zA-Z0-9]{0,253}[a-zA-Z0-9]$' + pg_dump_suffix: + description: Additional parameters for the pg_dump command during a migration + type: string postgres_label_selector: description: Label selector used to identify postgres pod for data migration type: string diff --git a/config/manifests/bases/awx-operator.clusterserviceversion.yaml b/config/manifests/bases/awx-operator.clusterserviceversion.yaml index 1859423b..b4c002f1 100644 --- a/config/manifests/bases/awx-operator.clusterserviceversion.yaml +++ b/config/manifests/bases/awx-operator.clusterserviceversion.yaml @@ -319,6 +319,11 @@ spec: x-descriptors: - urn:alm:descriptor:com.tectonic.ui:advanced - urn:alm:descriptor:io.kubernetes:Secret + - description: PostgreSQL dump additional parameters to exclude tables during migration to openshift + displayname: PostgreSQL Extra Arguments for Migration to Openshift + path: pg_dump_suffix + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:hidden - description: Name of the k8s secret the symmetric encryption key is stored in. displayName: Secret Key diff --git a/docs/migration/migration.md b/docs/migration/migration.md index 7c569e76..875dc4f2 100644 --- a/docs/migration/migration.md +++ b/docs/migration/migration.md @@ -65,6 +65,13 @@ spec: secret_key_secret: -secret-key ... ``` +### Exclude postgreSQL tables during migration (optional) + +Use the `pg_dump_suffix` parameter under `AWX.spec` to customize the pg_dump command that will execute during migration. This variable will append your provided pg_dump parameters to the end of the 'standard' command. For example, to exclude the data from 'main_jobevent' and 'main_job' to decrease the size of the backup use: + +``` +pg_dump_suffix: "--exclude-table-data 'main_jobevent*' --exclude-table-data 'main_job'" +``` ## Important Note diff --git a/roles/installer/defaults/main.yml b/roles/installer/defaults/main.yml index eecdb368..a7f563f1 100644 --- a/roles/installer/defaults/main.yml +++ b/roles/installer/defaults/main.yml @@ -241,6 +241,9 @@ postgres_configuration_secret: '' old_postgres_configuration_secret: '' +# Allow additional parameters to be added to the pg_dump backup command during AAP VMs to OCP migration +pg_dump_suffix: '' + # Secret to lookup that provides default execution environment pull credentials # ee_pull_credentials_secret: '' diff --git a/roles/installer/tasks/migrate_data.yml b/roles/installer/tasks/migrate_data.yml index 3954d48c..0970e4ee 100644 --- a/roles/installer/tasks/migrate_data.yml +++ b/roles/installer/tasks/migrate_data.yml @@ -44,6 +44,7 @@ -d {{ awx_old_postgres_database }} -p {{ awx_old_postgres_port }} -F custom + {{ pg_dump_suffix }} no_log: "{{ no_log }}" - name: Set pg_restore command