--- - name: "Send mattermost message" uri: url: "{{ mattermost_hook_smardigo }}" method: POST body: "{{ lookup('template','mattermost-deploy-start.json.j2') }}" body_format: json headers: Content-Type: "application/json" delegate_to: 127.0.0.1 become: false when: - send_status_messages - name: "Check if node-exporter/docker-compose.yml exists - TODO: remove after running setup.yml on all hosts .." stat: path: '{{ service_base_path }}/node-exporter/docker-compose.yml' register: check_docker_compose_file - name: "Stop node-exporter - TODO: remove after running setup.yml on all hosts .." shell: docker-compose down args: chdir: '{{ service_base_path }}/node-exporter' when: check_docker_compose_file.stat.exists ignore_errors: yes - name: "Remove node-exporter container fragments - TODO: remove after running setup.yml on all hosts .." file: state: absent path: '{{ service_base_path }}/node-exporter/' - name: Ensure prometheus-node-exporter ist installed apt: pkg: - prometheus-node-exporter - prometheus-node-exporter-collectors - name: Setup prometheus-node-exporter interface bind lineinfile: path: /etc/default/prometheus-node-exporter regex: "^ARGS=" line: "ARGS=\"--web.listen-address='{{ stage_private_server_ip }}:{{ monitor_port_system }}'\"" register: node_exporter - name: Restart prometheus if needed service: name: prometheus-node-exporter state: restarted - name: "Send mattermost messsge" uri: url: "{{ mattermost_hook_smardigo }}" method: POST body: "{{ lookup('template','mattermost-deploy-end.json.j2') }}" body_format: json headers: Content-Type: "application/json" delegate_to: 127.0.0.1 become: false when: - send_status_messages