@ -4,10 +4,39 @@
# Generic tasks, no matter what kind of server we're using (internal/external)
# Generic tasks, no matter what kind of server we're using (internal/external)
#
#
- name : Determine existing Postgres version (check PG_VERSION file)
stat:
path : "{{ matrix_postgres_data_path }}/PG_VERSION"
register : result_pg_version_stat
- name : Determine existing Postgres version (read PG_VERSION file)
slurp:
src : "{{ matrix_postgres_data_path }}/PG_VERSION"
register : result_pg_version
when : "result_pg_version_stat.stat.exists"
- name : Determine existing Postgres version (default to empty)
set_fact:
pg_version : ""
- name : Determine existing Postgres version (make sense of PG_VERSION file)
set_fact:
pg_version : "{{ result_pg_version['content']|b64decode|replace('\n', '') }}"
when : "result_pg_version_stat.stat.exists"
- name : Determine Postgres version to use (default to latest)
set_fact:
docker_postgres_image_to_use : "{{ docker_postgres_image_latest }}"
- name : Determine Postgres version to use (use 9.x, if detected)
set_fact:
docker_postgres_image_to_use : "{{ docker_postgres_image_v9 }}"
when : "pg_version.startswith('9.')"
# Even if we don't run the internal server, we still need this for running the CLI
# Even if we don't run the internal server, we still need this for running the CLI
- name : Ensure postgres Docker image is pulled
- name : Ensure postgres Docker image is pulled
docker_image:
docker_image:
name : "{{ docker_postgres_image }}"
name : "{{ docker_postgres_image _to_use }}"
- name : Ensure Postgres environment variables file created
- name : Ensure Postgres environment variables file created
template:
template: