|
|
|
@ -25,6 +25,21 @@
|
|
|
|
|
- "{{ matrix_prometheus_data_path }}"
|
|
|
|
|
when: matrix_prometheus_enabled|bool
|
|
|
|
|
|
|
|
|
|
- block:
|
|
|
|
|
# Well, this actually creates the network if it doesn't exist, but..
|
|
|
|
|
# The network should have been created by `matrix-base` already.
|
|
|
|
|
# We don't rely on that other call and its result, because it runs
|
|
|
|
|
# on `--tags=setup-all`, but will get skipped during `--tags=setup-prometheus`.
|
|
|
|
|
- name: Fetch Matrix Docker network details
|
|
|
|
|
docker_network:
|
|
|
|
|
name: "{{ matrix_docker_network }}"
|
|
|
|
|
driver: bridge
|
|
|
|
|
register: matrix_docker_network_info
|
|
|
|
|
|
|
|
|
|
- set_fact:
|
|
|
|
|
matrix_prometheus_endpoint_node_targets: ["{{ matrix_docker_network_info.network.IPAM.Config[0].Gateway }}:9100"]
|
|
|
|
|
when: "matrix_prometheus_enabled|bool and matrix_prometheus_node_exporter_enabled|bool and matrix_prometheus_endpoint_node_targets|length == 0"
|
|
|
|
|
|
|
|
|
|
- name: Ensure prometheus.yml installed
|
|
|
|
|
copy:
|
|
|
|
|
content: "{{ matrix_prometheus_configuration|to_nice_yaml }}"
|
|
|
|
|