Merge pull request #1006 from thedanbob/fix-prometheus-network

Fix prometheus network for ansible < 2.8
This commit is contained in:
Slavi Pantaleev 2021-04-18 09:09:37 +03:00 committed by GitHub
commit ac8a835fd2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -30,8 +30,10 @@
driver: bridge
register: matrix_docker_network_info
# The `matrix_docker_network_info.ansible_facts.docker_network` workaround is for Ansible < 2.8.
# See: https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/907
- set_fact:
matrix_prometheus_scraper_node_targets: ["{{ matrix_docker_network_info.network.IPAM.Config[0].Gateway }}:9100"]
matrix_prometheus_scraper_node_targets: ["{{ (matrix_docker_network_info.network|default(matrix_docker_network_info.ansible_facts.docker_network)).IPAM.Config[0].Gateway }}:9100"]
when: "matrix_prometheus_scraper_node_enabled|bool and matrix_prometheus_scraper_node_targets|length == 0"