aboutsummaryrefslogtreecommitdiffhomepage
path: root/tasks/postgres-database-extensions.yml
diff options
context:
space:
mode:
Diffstat (limited to 'tasks/postgres-database-extensions.yml')
-rw-r--r--tasks/postgres-database-extensions.yml23
1 files changed, 23 insertions, 0 deletions
diff --git a/tasks/postgres-database-extensions.yml b/tasks/postgres-database-extensions.yml
new file mode 100644
index 0000000..edc4e8d
--- /dev/null
+++ b/tasks/postgres-database-extensions.yml
@@ -0,0 +1,23 @@
1---
2- name: "Install required packages for 'postgres_ext' ansible module"
3 apt:
4 name:
5 - libpq-dev
6 - python-psycopg2
7
8- name: Install system dependencies of extensions
9 apt:
10 name: "{{ postgres_extension.apt_deps | default([]) }}"
11 cache_valid_time: 86400
12
13- name: "CREATE EXTENSION on database {{ postgres_dbname }}"
14 become: true
15 become_user: postgres
16 become_method: su
17 postgresql_ext:
18 name: "{{ postgres_extension_name }}"
19 db: "{{ postgres_dbname }}"
20 port: "{{ postgres_port }}"
21 loop: "{{ postgres_extension.names | default([]) }}"
22 loop_control:
23 loop_var: postgres_extension_name