diff options
author | Paul B <paul.bonaud@capitainetrain.com> | 2018-08-31 11:49:09 +0200 |
---|---|---|
committer | Paul B <paul.bonaud@capitainetrain.com> | 2018-08-31 12:00:24 +0200 |
commit | d0bc90e08c29e881c388c6803ed9c49dff1f1776 (patch) | |
tree | e5f633a7461f3d339ef89758fc7bb3f1b91563d3 /tasks/postgres-pgupgrades.yml | |
download | ansible-postgresql-role-1.0.0.tar.gz ansible-postgresql-role-1.0.0.tar.zst ansible-postgresql-role-1.0.0.zip |
Initial commit open sourcing Postgresql Ansible role1.0.0
Diffstat (limited to 'tasks/postgres-pgupgrades.yml')
-rw-r--r-- | tasks/postgres-pgupgrades.yml | 12 |
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 | ||