From c85806e3289b5e207d51d382f8dc75edad04404d Mon Sep 17 00:00:00 2001 From: Kumar Damani Date: Tue, 23 Aug 2022 12:02:28 -0400 Subject: switched to alpine initial commit --- roles/monitoring/tasks/prometheus.yaml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 roles/monitoring/tasks/prometheus.yaml (limited to 'roles/monitoring/tasks/prometheus.yaml') diff --git a/roles/monitoring/tasks/prometheus.yaml b/roles/monitoring/tasks/prometheus.yaml new file mode 100644 index 0000000..0fbfd89 --- /dev/null +++ b/roles/monitoring/tasks/prometheus.yaml @@ -0,0 +1,23 @@ +--- + +# Install Prometheus as TSDB for monitoring metrics +- name: 'Copy the prometheus.yml config file to conf dir' + template: + src: 'prometheus.yml.j2' + dest: '{{ monitoring_root_dir }}/prometheus.yml' + mode: '0644' + +- name: 'Make sure prometheus container is created and running' + docker_container: + name: 'prometheus' + image: 'prom/prometheus:v2.37.0' + pull: true + state: 'started' + recreate: true + command: '--config.file=/etc/prometheus/prometheus.yml --storage.tsdb.path=/data/prometheus' + user: 'root' + volumes: + - "{{ monitoring_root_dir }}/prometheus.yml:/etc/prometheus/prometheus.yml" + - "{{ monitoring_root_dir }}/prom_data:/data/prometheus" + network_mode: 'host' + restart_policy: unless-stopped -- cgit v1.2.3