aboutsummaryrefslogtreecommitdiffhomepage
path: root/tasks/postgres-pgupgrades.yml
diff options
context:
space:
mode:
Diffstat (limited to 'tasks/postgres-pgupgrades.yml')
-rw-r--r--tasks/postgres-pgupgrades.yml12
1 files changed, 12 insertions, 0 deletions
diff --git a/tasks/postgres-pgupgrades.yml b/tasks/postgres-pgupgrades.yml
new file mode 100644
index 0000000..a0b17b4
--- /dev/null
+++ b/tasks/postgres-pgupgrades.yml
@@ -0,0 +1,12 @@
1---
2- name: Find matching new cluster
3 set_fact:
4 postgres_new_cluster: "{{ postgres_clusters|selectattr('name','equalto',postgres_new_cluster_name)|selectattr('version','equalto',postgres_new_cluster_version|float)|list|first }}"
5
6- name: Extract database port of new matching cluster
7 set_fact:
8 postgres_new_cluster_port: "{{ (postgres_new_cluster|default({'port': 5432}))['port'] }}"
9
10- name: Upload pg_upgrade.sh script
11 template: src=pg_upgrade.sh.j2 dest=/var/lib/postgresql/pg_upgrade_{{ postgres_old_cluster_version }}_{{ postgres_new_cluster_version }}_{{ postgres_dbname }} owner=postgres group=postgres mode=0700
12 no_log: True