]> git.immae.eu Git - github/fretlink/ansible-postgresql-role.git/blame - tasks/main.yml
Merge pull request #6 from paulRbr/pg-extensions
[github/fretlink/ansible-postgresql-role.git] / tasks / main.yml
CommitLineData
d0bc90e0
P
1---
2- include: postgres-common-preinstall.yml
3 tags:
4 - postgres
5
6- include: postgres-log-directory.yml
7 tags:
8 - postgres
9 when:
10 - postgres_log_dir is defined and postgres_log_dir
11
12- include: postgres-data-directory.yml
13 tags:
14 - postgres
15 when: postgres_data_dir is defined and postgres_data_dir
16
17- name: fail if no clusters are defined
18 fail:
19 msg: "You probably forgot to define a PostgreSQL cluster on your host (`postgres_clusters` variable). Stopping run of the PostgreSQL role."
20 when: (postgres_clusters is not defined) or (postgres_clusters|length == 0)
21
22- include: postgres-cluster.yml
f1a9ab46
P
23 loop: "{{ postgres_clusters }}"
24 loop_control:
25 loop_var: postgres_cluster
d0bc90e0
P
26 tags:
27 - postgres
28
29- include: postgres-common-postinstall.yml
30 tags:
31 - postgres
32
33- include: postgres-user.yml
34 postgres_username={{ item.1.username }}
35 postgres_password={{ item.1.password }}
36 postgres_port={{ item.0.port }}
37 postgres_permissions={{ item.1.permissions | default('') }}
38 with_subelements:
39 - "{{ postgres_clusters }}"
40 - users
41 - skip_missing: true
42 tags:
43 - postgres
44 - postgres-users
45
46- include: postgres-database.yml
47 postgres_dbname={{ item.1.dbname }}
48 postgres_owner={{ item.1.owner }}
4d626d5a 49 postgres_extensions={{ item.1.extensions|default([]) }}
d0bc90e0
P
50 postgres_port={{ item.0.port }}
51 with_subelements:
52 - "{{ postgres_clusters }}"
53 - databases
54 - skip_missing: true
55 tags:
56 - postgres
57 - postgres-databases
58
59- include: postgres-pgupgrades.yml
f1a9ab46
P
60 loop: "{{ postgres_pgupgrades }}"
61 loop_control:
62 loop_var: postgres_pgupgrade
d0bc90e0
P
63 when: postgres_pgupgrades is defined
64 tags:
65 - postgres
66 - postgres-pgupgrades