forked from minhlh/Ansible-Fabric-Starter
-
Notifications
You must be signed in to change notification settings - Fork 1
/
start-monitoring.yml
34 lines (28 loc) · 1.14 KB
/
start-monitoring.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
---
- hosts: nodes
tasks:
- name: Deploy Hyperledger Monitoring
block:
- name: Clean all previous monitoring dockers, if any
raw: "docker rm -f $(docker ps -a | grep -E 'grafana|prometheus' | awk '{print $1};')"
ignore_errors: true
- name: Clean all docker volumes
raw: "docker volume rm $(docker volume ls -qf dangling=true)"
ignore_errors: true
- name: Clean all monitoring images
raw: "docker image rm $(docker image ls | grep -E 'grafana|prometheus' | awk '{print $1};')"
ignore_errors: true
- name: Ensure all folders exist
file:
dest: "{{ item }}"
state: directory
loop: "{{ fabric_artifacts_folders }}"
- name: Template SDK network-config
template:
src: "{{ item.from }}"
dest: "{{ item.to }}"
loop: "{{ files_hl_monitoring }}"
- name: Launch Hyperledger monitoring
raw: 'docker-compose --file {{ monitoring_artifacts }}/docker-compose-monitoring.yml up -d 2>&1'
when: "'monitoring' in node_roles"
tags: [ 'monitoring']