blob: f947d2e70958ea2ef2fcf3237a2fec8f85e908a9 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
- name: Install postgres packages.
apt:
name:
- python3-psycopg2
- postgresql-{{ postgresql_version }}
- postgresql-contrib-{{ postgresql_version }}
- libpq-dev
state: present
- name: Check postgres is started and enabled on boot.
service:
name: '{{ postgresql_daemon }}'
state: started
enabled: true
- name: Add postgres users.
community.postgresql.postgresql_user: "{{ item }}"
with_items: "{{ postgresql_users }}"
become: true
become_user: "{{ postgresql_user }}"
- name: Add postgres databases.
community.postgresql.postgresql_db: "{{ item }}"
with_items: "{{ postgresql_databases }}"
become: true
become_user: "{{ postgresql_user }}"
|