aboutsummaryrefslogblamecommitdiffhomepage
path: root/tasks/postgres-database-extensions.yml
blob: edc4e8d48a9190f0ee48fc78706b6d5727995d4b (plain) (tree)






















                                                                     
---
- 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