Skip to content

Commit

Permalink
Merge pull request #192 from metal-stack/sonic-exporter
Browse files Browse the repository at this point in the history
adding sonic-exporter
  • Loading branch information
robertvolkmann authored Jul 24, 2023
2 parents a4ec99d + 8cb1aee commit e771efe
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
6 changes: 6 additions & 0 deletions partition/roles/monitoring/sonic-exporter/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
sonic_exporter_image_name: "stordis/sonic-exporter"
sonic_exporter_image_tag: "latest"
sonic_exporter_address: "0.0.0.0"
node_exporter_dir: /sonic_exporter
sonic_exporter_port: 9101
40 changes: 40 additions & 0 deletions partition/roles/monitoring/sonic-exporter/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
- name: create sonic_exporter directories
file:
path: "{{ sonic_exporter_dir }}/host"
state: directory
owner: "root"
group: "root"
mode: "0755"

- name: deploy sonic_exporter service
include_role:
name: ansible-common/roles/systemd-docker-service
vars:
systemd_service_name: sonic_exporter
systemd_docker_image_name: "{{ sonic_exporter_image_name }}"
systemd_docker_image_tag: "{{ sonic_exporter_image_tag }}"
systemd_service_after: docker.service
systemd_docker_network: host
systemd_service_requires: docker.service
systemd_docker_ports:
- host_port: "{{ sonic_exporter_port }}"
target_port: "{{ sonic_exporter_port }}"
systemd_docker_volumes:
- "/:/host:ro,rslave"
- "/var/run/redis:/var/run/redis"
- "/usr/bin/vtysh:/usr/bin/vtysh"
- "/usr/bin/docker:/usr/bin/docker"
- "/var/run/docker.sock:/var/run/docker.sock"
- "/usr/bin/ntpq:/usr/bin/ntpq"
systemd_docker_command:
- --path.rootfs=/host
- --path.procfs=/host/proc
- --path.sysfs=/host/sys
- --log-opt mode=non-blocking
- --log-opt max-buffer-size=4m
- --log-driver json-file
- --log-opt max-size=10m
- --log-opt max-file=3
- --log-opt compress=true

0 comments on commit e771efe

Please sign in to comment.