aboutsummaryrefslogtreecommitdiffhomepage
path: root/tasks/postgres-database-extensions.yml
blob: 58585c028b11f95d51ca9589d81ef7d9bad5a9fb (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
---
- name: "Install required packages for 'postgres_ext' ansible module"
  apt:
    name:
      - libpq-dev
      - python-psycopg2

- name: Install system dependencies of extensions
  apt:
    name: "{{ postgres_extension.apt_deps | default([]) }}"
    cache_valid_time: 86400

- name: "CREATE EXTENSION on database {{ postgres_dbname }}"
  become: true
  become_user: postgres
  become_method: "{{ postgres_become_method }}"
  postgresql_ext:
    name: "{{ postgres_extension_name }}"
    db: "{{ postgres_dbname }}"
    port: "{{ postgres_port }}"
  loop: "{{ postgres_extension.names | default([]) }}"
  loop_control:
    loop_var: postgres_extension_name