aboutsummaryrefslogtreecommitdiffhomepage
path: root/tasks/postgres-pgupgrades.yml
diff options
context:
space:
mode:
authorPaul B <paul@bonaud.fr>2019-01-07 18:01:00 +0100
committerPaul B <paul@bonaud.fr>2019-01-07 18:21:52 +0100
commitf1a9ab46fed919f445e3b2eacb90a594eb095fd1 (patch)
tree5be007378ece2b320b541389377d429925644a20 /tasks/postgres-pgupgrades.yml
parent758d478b83050f248f5df8177027e2870f4308c5 (diff)
downloadansible-postgresql-role-f1a9ab46fed919f445e3b2eacb90a594eb095fd1.tar.gz
ansible-postgresql-role-f1a9ab46fed919f445e3b2eacb90a594eb095fd1.tar.zst
ansible-postgresql-role-f1a9ab46fed919f445e3b2eacb90a594eb095fd1.zip
improvement: remove 'with_items' loop and use modern ansible loops
Ansible > 2.5 needed
Diffstat (limited to 'tasks/postgres-pgupgrades.yml')
-rw-r--r--tasks/postgres-pgupgrades.yml13
1 files changed, 12 insertions, 1 deletions
diff --git a/tasks/postgres-pgupgrades.yml b/tasks/postgres-pgupgrades.yml
index a0b17b4..6eb9cb7 100644
--- a/tasks/postgres-pgupgrades.yml
+++ b/tasks/postgres-pgupgrades.yml
@@ -1,7 +1,18 @@
1--- 1---
2- set_fact:
3 postgres_dbname: "{{ postgres_pgupgrade.dbname }}"
4 postgres_pgbouncer_uri: "{{ postgres_pgupgrade.pgbouncer_uri|default(None) }}"
5 postgres_old_cluster_version: "{{ postgres_pgupgrade.old_cluster_version }}"
6 postgres_old_cluster_name: "{{ postgres_pgupgrade.old_cluster_name }}"
7 postgres_new_cluster_version: "{{ postgres_pgupgrade.new_cluster_version }}"
8 postgres_new_cluster_name: "{{ postgres_pgupgrade.new_cluster_name }}"
9 postgres_standby_server: "{{ postgres_pgupgrade.standby_server }}"
10 postgres_standby_old_cluster_name: "{{ postgres_pgupgrade.standby_old_cluster_name|default(postgres_pgupgrade.old_cluster_name) }}"
11 postgres_standby_new_cluster_name: "{{ postgres_pgupgrade.standby_new_cluster_name|default(postgres_pgupgrade.new_cluster_name) }}"
12
2- name: Find matching new cluster 13- name: Find matching new cluster
3 set_fact: 14 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 }}" 15 postgres_new_cluster: "{{ postgres_clusters|selectattr('name','equalto',postgres_new_cluster_name)|selectattr('version','equalto', postgres_new_cluster_version|float)|list|first }}"
5 16
6- name: Extract database port of new matching cluster 17- name: Extract database port of new matching cluster
7 set_fact: 18 set_fact: