aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar jchristgit <[email protected]>2024-05-14 22:03:21 +0200
committerGravatar GitHub <[email protected]>2024-05-14 22:03:21 +0200
commitb3a642d5cda8b7bdbf91b60728a29aefbb755bf5 (patch)
tree5d06d3fccd461373b219d3d653eb8a8af83e4756
parentadd the task that configures host based authentication (diff)
Pleasure the style dictator (#291)
Fix warnings with argsplat in postgres role
-rw-r--r--ansible/roles/postgres/tasks/main.yml19
-rw-r--r--ansible/roles/postgres/vars/main/db_passwords.yml22
2 files changed, 25 insertions, 16 deletions
diff --git a/ansible/roles/postgres/tasks/main.yml b/ansible/roles/postgres/tasks/main.yml
index b605093..2824a12 100644
--- a/ansible/roles/postgres/tasks/main.yml
+++ b/ansible/roles/postgres/tasks/main.yml
@@ -18,22 +18,31 @@
- role::postgres
- name: Add postgres users
- community.postgresql.postgresql_user: "{{ item }}"
- with_items: "{{ postgres_users }}"
become: true
become_user: "{{ postgres_user }}"
+ community.postgresql.postgresql_user:
+ name: "{{ item.name }}"
+ password: "{{ item.password }}"
+ state: present
+ loop_control:
+ label: "{{ item.name }}"
+ loop: "{{ postgres_users }}"
+ environment:
+ PGOPTIONS: "-c password_encryption=scram-sha-256"
tags:
- role::postgres
- name: Add postgres databases
- community.postgresql.postgresql_db: "{{ item }}"
- with_items: "{{ postgres_databases }}"
become: true
become_user: "{{ postgres_user }}"
+ community.postgresql.postgresql_db:
+ name: "{{ item.name }}"
+ owner: "{{ item.owner }}"
+ state: present
+ loop: "{{ postgres_databases }}"
tags:
- role::postgres
-
- name: Set host based authentication rules for all postgres users at once
ansible.builtin.blockinfile:
path: /etc/postgresql/{{ postgres_version }}/main/pg_hba.conf
diff --git a/ansible/roles/postgres/vars/main/db_passwords.yml b/ansible/roles/postgres/vars/main/db_passwords.yml
index 3c24073..05470e6 100644
--- a/ansible/roles/postgres/vars/main/db_passwords.yml
+++ b/ansible/roles/postgres/vars/main/db_passwords.yml
@@ -1,12 +1,12 @@
$ANSIBLE_VAULT;1.1;AES256
-39333066353561633762383262376164306238626636643162643639383233353131663063343062
-3138303730363062326431626536663633663633616537320a306361356639323761666339373834
-64383531613838343931616139636233636466656436656630393634656165323630663930343537
-3437653633386335370a653965656231616632353966383562623261323839353134386562313233
-33353561373866376362356563643265663038303364663164643561313238633435373865373234
-32303439666665333038343236366139353031623934346663363162396330616234383666623938
-38313361613465363539313331306531353766386431373132373465656132613262386639356563
-65346535353734616665663037386363616233666437623466646137663634313666326130623031
-33323933323034396431373638363638663733393836396634393535326635646232396437663362
-36386335386162383866303763346331363737366331663133343164646639343764643033666132
-396532326162303564353831636336323061
+35383734613837346262376634346130336162323466346264616131666338313037323633323963
+3435333265323531373933636363303839653739363134640a663864633333663636623439393631
+63663162336164333430646239653963363461386633613934353031616230376464616262303930
+3365663532356637620a356538333032656334326338353536346330656364316430653231366438
+30336661313035383132646134393561333038343536393834306266376362313666343036623936
+38333135313136623232376565663235303734613436356565393066396661373765623836646437
+65333761633863636164353033306131303262383339353362313638353731353162643733653938
+64356132663066656538643561626635376265373735353934353433653762343465643762613732
+62333539333961366539326331383837396666643862643432303766363661303934363732663163
+38353131343531373361383136346563333861303266366363313461313135386335353535303564
+613834613162653031653832363431386364