Skip to content
Snippets Groups Projects
postgres-ha.yml 753 B
Newer Older
#!/usr/bin/env ansible-playbook
---

- name: POSTGRES HA
  hosts: postgres
  tags: postgres
  pre_tasks:
    - name: check that repmgr_node_id is set
      assert:
        that: repmgr_node_id != ""
        quiet: true
    - name: check that repmgr_primary_node is set
      assert:
        that: repmgr_primary_node != ""
        quiet: true
    - name: install psycopg2
      apt:
        force_apt_get: true
        install_recommends: false
        name: python3-psycopg2
  roles:
    - postgres-ha

- name: POSTGRES HA CLIENTS
  hosts:
    - mediaserver
    - mirismanager
  tags: postgres
  pre_tasks:
    - name: check that haproxy is configured
      assert:
        that: hap_config_listen != ""
        quiet: true
  roles:
    - haproxy

...