Ansiblesation des VMs de BDD #32
2 changed files with 18 additions and 0 deletions
4
roles/postgresql_server/defaults/main.yml
Normal file
4
roles/postgresql_server/defaults/main.yml
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
---
|
||||||
|
postgresql_db: []
|
||||||
|
postgresql_users: []
|
||||||
|
...
|
|
@ -37,3 +37,17 @@
|
||||||
- postgresql.conf
|
- postgresql.conf
|
||||||
notify:
|
notify:
|
||||||
- restart postgresql
|
- restart postgresql
|
||||||
|
|
||||||
|
- name: Create databases
|
||||||
|
postgresql_db:
|
||||||
|
name: "{{ item.name }}"
|
||||||
|
loop: "{{ postgresql_databases }}"
|
||||||
|
|
||||||
|
- name: Create users
|
||||||
|
postgresql_user:
|
||||||
|
db: "{{ item.database }}"
|
||||||
|
name: "{{ item.name }}"
|
||||||
|
password: "{{ item.password }}"
|
||||||
|
priv: "{{ item.priv }}"
|
||||||
|
loop: "{{ postgresql_users }}"
|
||||||
|
...
|
||||||
|
|
Loading…
Reference in a new issue