blob: 034ff9c977947d6ff36530c3643dacec88298602 (
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
27
28
29
30
31
32
33
34
|
- name: Install postgres packages
apt:
name:
- python3-psycopg2
- postgresql-{{ postgres_version }}
- postgresql-contrib-{{ postgres_version }}
- libpq-dev
state: present
tags:
- role::postgres
- name: Check postgres is started and enabled on boot
service:
name: '{{ postgres_daemon }}'
state: started
enabled: true
tags:
- role::postgres
- name: Add postgres users
community.postgresql.postgresql_user: "{{ item }}"
with_items: "{{ postgres_users }}"
become: true
become_user: "{{ postgres_user }}"
tags:
- role::postgres
- name: Add postgres databases
community.postgresql.postgresql_db: "{{ item }}"
with_items: "{{ postgres_databases }}"
become: true
become_user: "{{ postgres_user }}"
tags:
- role::postgres
|