Skip to content

Commit

Permalink
Pleasure the style dictator (#291)
Browse files Browse the repository at this point in the history
Fix warnings with argsplat in postgres role
  • Loading branch information
jchristgit authored May 14, 2024
1 parent 0bc31eb commit b3a642d
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 16 deletions.
19 changes: 14 additions & 5 deletions ansible/roles/postgres/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
22 changes: 11 additions & 11 deletions ansible/roles/postgres/vars/main/db_passwords.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit b3a642d

Please sign in to comment.