aboutsummaryrefslogtreecommitdiffhomepage
path: root/tasks/postgres-database-extensions.yml
blob: edc4e8d48a9190f0ee48fc78706b6d5727995d4b (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: su
  postgresql_ext:
    name: "{{ postgres_extension_name }}"
    db: "{{ postgres_dbname }}"
    port: "{{ postgres_port }}"
  loop: "{{ postgres_extension.names | default([]) }}"
  loop_control:
    loop_var: postgres_extension_name