diff options
author | Paul B <paul@bonaud.fr> | 2019-01-07 18:01:00 +0100 |
---|---|---|
committer | Paul B <paul@bonaud.fr> | 2019-01-07 18:21:52 +0100 |
commit | f1a9ab46fed919f445e3b2eacb90a594eb095fd1 (patch) | |
tree | 5be007378ece2b320b541389377d429925644a20 /tasks/main.yml | |
parent | 758d478b83050f248f5df8177027e2870f4308c5 (diff) | |
download | ansible-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/main.yml')
-rw-r--r-- | tasks/main.yml | 27 |
1 files changed, 6 insertions, 21 deletions
diff --git a/tasks/main.yml b/tasks/main.yml index ad6b5bb..2fa7883 100644 --- a/tasks/main.yml +++ b/tasks/main.yml | |||
@@ -20,17 +20,9 @@ | |||
20 | when: (postgres_clusters is not defined) or (postgres_clusters|length == 0) | 20 | when: (postgres_clusters is not defined) or (postgres_clusters|length == 0) |
21 | 21 | ||
22 | - include: postgres-cluster.yml | 22 | - include: postgres-cluster.yml |
23 | postgres_version={{ item.version }} | 23 | loop: "{{ postgres_clusters }}" |
24 | postgres_cluster_name={{ item.name }} | 24 | loop_control: |
25 | postgres_port={{ item.port }} | 25 | loop_var: postgres_cluster |
26 | postgres_fsync_enabled={{ item.fsync_enabled }} | ||
27 | postgres_archive_enabled={{ item.archive_enabled }} | ||
28 | postgres_max_replication_slots={{ item.max_replication_slots | default(10) }} | ||
29 | postgres_extra_config={{ item.extra_config | default({}) }} | ||
30 | barman_directory={{ item.barman_directory | default(None) }} | ||
31 | postgres_primary={{ item.primary | default(None) }} | ||
32 | postgres_checksums={{ item.checksums | default(True) }} | ||
33 | with_items: "{{ postgres_clusters }}" | ||
34 | tags: | 26 | tags: |
35 | - postgres | 27 | - postgres |
36 | 28 | ||
@@ -64,16 +56,9 @@ | |||
64 | - postgres-databases | 56 | - postgres-databases |
65 | 57 | ||
66 | - include: postgres-pgupgrades.yml | 58 | - include: postgres-pgupgrades.yml |
67 | postgres_dbname={{ item.dbname }} | 59 | loop: "{{ postgres_pgupgrades }}" |
68 | postgres_pgbouncer_uri={{ item.pgbouncer_uri|default(None) }} | 60 | loop_control: |
69 | postgres_old_cluster_version={{ item.old_cluster_version }} | 61 | loop_var: postgres_pgupgrade |
70 | postgres_old_cluster_name={{ item.old_cluster_name }} | ||
71 | postgres_new_cluster_version={{ item.new_cluster_version }} | ||
72 | postgres_new_cluster_name={{ item.new_cluster_name }} | ||
73 | postgres_standby_server={{ item.standby_server }} | ||
74 | postgres_standby_old_cluster_name={{ item.standby_old_cluster_name|default(item.old_cluster_name) }} | ||
75 | postgres_standby_new_cluster_name={{ item.standby_new_cluster_name|default(item.new_cluster_name) }} | ||
76 | with_items: "{{ postgres_pgupgrades }}" | ||
77 | when: postgres_pgupgrades is defined | 62 | when: postgres_pgupgrades is defined |
78 | tags: | 63 | tags: |
79 | - postgres | 64 | - postgres |