--- - name: Run postgresql exporter become: true community.docker.docker_container: name: postgresql-exporter image: quay.io/prometheuscommunity/postgres-exporter:v0.15.0 networks: - name: monitoring - name: postgresql env: DATA_SOURCE_URI: postgresql:5432/exporter?sslmode=disable DATA_SOURCE_USER: exporter DATA_SOURCE_PASS: "{{ postgresql_exporter_password }}" restart_policy: unless-stopped