#!/usr/bin/env ansible-playbook
---

- name: PYTHON
  hosts: all
  gather_facts: false
  tasks:
    - name: ensure python3 is installed
      register: python_install
      changed_when: "'es_pyinstall' in python_install.stdout_lines"
      raw: command -v python3 || echo es_pyinstall && apt update && apt install -y python3-minimal python3-apt

- name: Converge
  hosts: postgres
  pre_tasks:
    - name: check running in a docker container
      register: check_if_docker
      stat:
        path: /.dockerenv
    - name: set docker flag variable
      set_fact:
        in_docker: "{{ check_if_docker.stat.exists | d(false) }}"
  roles:
    - base
    - postgres-ha
  post_tasks:
    - name: deploy letsencrypt certificate
      when: letsencrypt_enabled | d(false)
      include_role:
        name: letsencrypt
    - name: configure network
      when: network_apply | d(false)
      include_role:
        name: network
    - name: configure proxy
      when: proxy_apply | d(false)
      include_role:
        name: proxy

...
