Home

Awesome

Postgres Ansible role

⚠️ WARNING: this role is now maintained in mother-of-all-self-hosting/ansible-role-postgres.

This is an Ansible role which installs Postgres to run as a Docker container wrapped in a systemd service.

This role implicitly depends on:

Features

Usage

Example playbook:

- hosts: servers
  roles:
    - role: galaxy/com.devture.ansible.role.systemd_docker_base

    - role: galaxy/com.devture.ansible.role.postgres

    - role: another_role

Example playbook configuration (group_vars/servers or other):

devture_postgres_identifier: my-postgres

devture_postgres_base_path: "{{ my_base_path }}/postgres"

devture_postgres_container_network: "{{ my_container_container_network }}"

devture_postgres_uid: "{{ my_uid }}"
devture_postgres_gid: "{{ my_gid }}"

devture_postgres_vacuum_default_databases_list: ["mydb", "anotherdb"]

devture_postgres_systemd_services_to_stop_for_maintenance_list: |
  {{
    (['my-service.service'])
  }}

devture_postgres_managed_databases: |
  {{
    [{
      'name': my_database_name,
      'username': my_database_username,
      'password': my_database_password,
    }]
    +
    [{
      'name': another_database_name,
      'username': another_database_username,
      'password': another_database_password,
    }]
  }}