aboutsummaryrefslogtreecommitdiffhomepage
path: root/tasks/postgres-pgupgrades.yml
diff options
context:
space:
mode:
authorPaul B <paul.bonaud@capitainetrain.com>2018-08-31 11:49:09 +0200
committerPaul B <paul.bonaud@capitainetrain.com>2018-08-31 12:00:24 +0200
commitd0bc90e08c29e881c388c6803ed9c49dff1f1776 (patch)
treee5f633a7461f3d339ef89758fc7bb3f1b91563d3 /tasks/postgres-pgupgrades.yml
downloadansible-postgresql-role-d0bc90e08c29e881c388c6803ed9c49dff1f1776.tar.gz
ansible-postgresql-role-d0bc90e08c29e881c388c6803ed9c49dff1f1776.tar.zst
ansible-postgresql-role-d0bc90e08c29e881c388c6803ed9c49dff1f1776.zip
Initial commit open sourcing Postgresql Ansible role1.0.0
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