Merge pull request #18 from TouchInstinct/feature/monitoring.nginx-exporter

nginx-exporter: initial commit
This commit is contained in:
TonCherAmi 2020-07-29 16:04:45 +03:00 committed by GitHub
commit 461b46aadc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 51 additions and 0 deletions

View File

@ -0,0 +1,3 @@
nginx_exporter__image_name: "nginx/nginx-prometheus-exporter"
nginx_exporter__image_tag: "0.8.0"
nginx_exporter__image: "{{ nginx_exporter__image_name }}:{{ nginx_exporter__image_tag }}"

View File

@ -0,0 +1,30 @@
---
- name: MONITORING.NGINX-EXPORTER | Prepare deployment
import_role:
name: docker.deployment.prepare
vars:
deployment_name: nginx
tags:
- nginx-exporter
- name: MONITORING.NGINX-EXPORTER | Copy templates
template:
src: templates/{{ item }}.j2
dest: "{{ docker_deployment__deploy_path }}/{{ item }}"
loop:
- docker-compose.yml
become_user: "{{ docker_deployment__deploy_user_name }}"
become: yes
tags:
- files
- nginx-exporter
- name: MONITORING.NGINX-EXPORTER | Run deployment
docker_service:
restarted: "yes"
project_src: "{{ docker_deployment__deploy_path }}"
become: yes
become_user: "{{ docker_deployment__deploy_user_name }}"
tags:
- run
- nginx-exporter

View File

@ -0,0 +1,18 @@
version: "3.7"
services:
nginx-exporter:
container_name: nginx-exporter
image: "{{ nginx_exporter__image }}"
restart: unless-stopped
ports:
- "{{ nginx_exporter__port }}:9113"
{% if nginx_exporter is defined and nginx_exporter.docker is defined %}
extra_hosts: {{ nginx_exporter.docker.extra_hosts | default([]) | to_json }}
environment: {{ nginx_exporter.docker.environment | default([]) | to_json }}
{% endif %}
logging:
driver: json-file
options:
max-file: "1"
max-size: "50m"