mirror of
https://github.com/ansible/awx-operator.git
synced 2026-03-26 21:33:14 +00:00
Change default value for postgres_data_path (#1766)
* Change default value for postgres_data_path /var/lib/postgresql/data/pgdata to /var/lib/pgsql/data/pgdata postgres 15 uses a different location for postgres data directory. Fixes issue were database was not being written to the mounted in volume, and if the postgres container restarted, data would be lost. Signed-off-by: Seth Foster <fosterbseth@gmail.com> --------- Signed-off-by: Seth Foster <fosterbseth@gmail.com> Co-authored-by: Hao Liu <44379968+TheRealHaoLiu@users.noreply.github.com>
This commit is contained in:
@@ -401,7 +401,7 @@ postgres_init_container_resource_requirements:
|
||||
memory: 64Mi
|
||||
# Assign a preexisting priority class to the postgres pod
|
||||
postgres_priority_class: ''
|
||||
postgres_data_path: '/var/lib/postgresql/data/pgdata'
|
||||
postgres_data_path: '/var/lib/pgsql/data/pgdata'
|
||||
|
||||
# Persistence to the AWX project data folder
|
||||
# Whether or not the /var/lib/projects directory will be persistent
|
||||
|
||||
@@ -156,17 +156,17 @@
|
||||
|
||||
- name: Check if postgres pod is running an older version
|
||||
block:
|
||||
- name: Set path to PG_VERSION file for given container image
|
||||
set_fact:
|
||||
path_to_pg_version: '{{ postgres_data_path }}/PG_VERSION'
|
||||
|
||||
- name: Get old PostgreSQL version
|
||||
k8s_exec:
|
||||
namespace: "{{ ansible_operator_meta.namespace }}"
|
||||
pod: "{{ old_postgres_pod['metadata']['name'] }}"
|
||||
command: |
|
||||
bash -c """
|
||||
cat {{ path_to_pg_version }}
|
||||
if [ -f "{{ postgres_data_path }}/PG_VERSION" ]; then
|
||||
cat "{{ postgres_data_path }}/PG_VERSION"
|
||||
elif [ -f '/var/lib/postgresql/data/pgdata/PG_VERSION' ]; then
|
||||
cat '/var/lib/postgresql/data/pgdata/PG_VERSION'
|
||||
fi
|
||||
"""
|
||||
register: _old_pg_version
|
||||
|
||||
|
||||
Reference in New Issue
Block a user