diff --git a/roles/installer/tasks/migrate_schema.yml b/roles/installer/tasks/migrate_schema.yml index ef41e182..77ffc6fc 100644 --- a/roles/installer/tasks/migrate_schema.yml +++ b/roles/installer/tasks/migrate_schema.yml @@ -22,9 +22,9 @@ changed_when: false register: version_check - - name: Update instance version + - name: Sanitize instance version set_fact: - version: "{{ version_check.stdout | trim }}" + version: "{{ version_check.stdout.split('+')[0] | trim }}" # It is possible to do a wait on this task to create the job and wait # until it completes. Unfortunately, if the job doesn't wait finish within diff --git a/roles/installer/templates/deployments/task.yaml.j2 b/roles/installer/templates/deployments/task.yaml.j2 index a8f1dda7..29da6f51 100644 --- a/roles/installer/templates/deployments/task.yaml.j2 +++ b/roles/installer/templates/deployments/task.yaml.j2 @@ -95,6 +95,10 @@ spec: mountPath: "/etc/tower/settings.py" subPath: settings.py readOnly: true +{% if development_mode | bool %} + - name: awx-devel + mountPath: "/awx_devel" +{% endif %} - name: init-receptor image: '{{ _init_container_image }}' imagePullPolicy: '{{ image_pull_policy }}' diff --git a/roles/installer/templates/jobs/migration.yaml.j2 b/roles/installer/templates/jobs/migration.yaml.j2 index e306784c..98b9f7cb 100644 --- a/roles/installer/templates/jobs/migration.yaml.j2 +++ b/roles/installer/templates/jobs/migration.yaml.j2 @@ -13,7 +13,7 @@ spec: - name: "migration-job" image: '{{ _image }}' command: - - /usr/bin/awx-manage + - awx-manage - migrate - --noinput volumeMounts: @@ -29,6 +29,10 @@ spec: mountPath: "/etc/tower/settings.py" subPath: settings.py readOnly: true +{% if development_mode | bool %} + - name: awx-devel + mountPath: "/awx_devel" +{% endif %} volumes: - name: "{{ ansible_operator_meta.name }}-application-credentials" secret: @@ -52,6 +56,11 @@ spec: items: - key: settings path: settings.py +{% if development_mode | bool %} + - name: awx-devel + hostPath: + path: /awx_devel +{% endif %} dnsPolicy: ClusterFirst restartPolicy: Never terminationGracePeriodSeconds: 30