Skip to content

Commit

Permalink
feat: make container configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
ntk148v committed Jul 10, 2024
1 parent 82eef65 commit d67400d
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 7 deletions.
3 changes: 2 additions & 1 deletion ansible/roles/alertmanager/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
alertmanager_version: "0.27.0"
alertmanager_port: 9093
alertmanager_container_name: "alertmanager"
alertmanager_docker_namespace: "{{ docker_namespace if docker_namespace else 'prom' }}"
alertmanager_config_dir: "{{ ansitheus_config_dir }}/alertmanager"
alertmanager_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ alertmanager_docker_namespace }}/alertmanager:v{{ alertmanager_version }}"
Expand Down Expand Up @@ -124,7 +125,7 @@ alertmanager_route:
# ----------------------
alertmanager_services:
alertmanager:
container_name: alertmanager
container_name: "{{ alertmanager_container_name }}"
group: alertmanager
enabled: "{{ enable_alertmanager }}"
image: "{{ alertmanager_image }}"
Expand Down
3 changes: 2 additions & 1 deletion ansible/roles/cadvisor/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
cadvisor_version: "0.49.1"
cadvisor_port: "8080"
cadvisor_container_name: "cadvisor"
cadvisor_docker_namespace: "{{ docker_namespace if docker_namespace else 'cadvisor' }}"
cadvisor_image: "{{ docker_registry ~ '/' if docker_registry else 'gcr.io/' }}{{ cadvisor_docker_namespace }}/cadvisor:v{{ cadvisor_version }}"
cadvisor_docker_log_driver: "{{ docker_log_driver }}"
Expand All @@ -23,7 +24,7 @@ cadvisor_housekeeping_interval: 30s
# ---------------------
cadvisor_services:
cadvisor:
container_name: "cadvisor"
container_name: "{{ cadvisor_container_name }}"
group: "cadvisor"
enabled: "{{ enable_cadvisor }}"
image: "{{ cadvisor_image }}"
Expand Down
3 changes: 2 additions & 1 deletion ansible/roles/grafana/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
grafana_version: "10.4.2"
grafana_container_name: "grafana"
grafana_docker_namespace: "{{ docker_namespace if docker_namespace else 'grafana' }}"
grafana_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ grafana_docker_namespace }}/grafana:{{ grafana_version }}"
grafana_data_volume: "grafana"
Expand Down Expand Up @@ -110,7 +111,7 @@ grafana_log:
# ----------------------
grafana_services:
grafana:
container_name: "grafana"
container_name: "{{ grafana_container_name }}"
group: "grafana"
enabled: "{{ enable_grafana | bool }}"
port: "{{ grafana_port }}"
Expand Down
3 changes: 2 additions & 1 deletion ansible/roles/haproxy/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
haproxy_version: "lts-alpine"
haproxy_container_name: "haproxy"
haproxy_docker_namespace: "{{ docker_namespace if docker_namespace else '' }}"
haproxy_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ haproxy_docker_namespace ~ '/' if haproxy_docker_namespace else '' }}haproxy:{{ haproxy_version }}"
haproxy_docker_log_driver: "{{ docker_log_driver }}"
Expand Down Expand Up @@ -31,7 +32,7 @@ prometheus_active_passive_mode: "no"
# ---------------------
haproxy_services:
haproxy:
container_name: "haproxy"
container_name: "{{ haproxy_container_name }}"
group: "haproxy"
enabled: "{{ enable_haproxy }}"
image: "{{ haproxy_image }}"
Expand Down
3 changes: 2 additions & 1 deletion ansible/roles/mysqld_exporter/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
mysqld_exporter_version: "0.15.1"
mysqld_exporter_port: 9104
mysqld_exporter_container_name: "mysqld_exporter"
mysqld_exporter_docker_namespace: "{{ docker_namespace if docker_namespace else 'prom' }}"
mysqld_exporter_docker_log_driver: "{{ docker_log_driver }}"
mysqld_exporter_docker_log_opts: "{{ docker_log_opts }}"
Expand Down Expand Up @@ -33,7 +34,7 @@ mysqld_exporter_disabled_collectors: []

mysqld_exporter_services:
mysqld_exporter:
container_name: "mysqld_exporter"
container_name: "{{ mysqld_exporter_container_name }}"
group: "mysqld_exporter"
enabled: "{{ enable_mysqld_exporter }}"
image: "{{ mysqld_exporter_image }}"
Expand Down
3 changes: 2 additions & 1 deletion ansible/roles/node_exporter/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
node_exporter_version: "1.8.0"
node_exporter_port: 9100
node_exporter_container_name: "node_exporter"
node_exporter_docker_namespace: "{{ docker_namespace if docker_namespace else 'prom' }}"
node_exporter_docker_log_driver: "{{ docker_log_driver }}"
node_exporter_docker_log_opts: "{{ docker_log_opts }}"
Expand Down Expand Up @@ -31,7 +32,7 @@ node_exporter_disabled_collectors: []

node_exporter_services:
node_exporter:
container_name: "node_exporter"
container_name: "{{ node_exporter_container_name }}"
group: "node_exporter"
enabled: "{{ enable_node_exporter }}"
image: "{{ node_exporter_image }}"
Expand Down
3 changes: 2 additions & 1 deletion ansible/roles/prometheus/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
prometheus_version: "2.52.0"
prometheus_docker_namespace: "{{ docker_namespace if docker_namespace else 'prom' }}"
prometheus_port: 9090
prometheus_container_name: "prometheus"
prometheus_config_dir: "{{ ansitheus_config_dir }}/prometheus"
prometheus_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ prometheus_docker_namespace }}/prometheus:v{{ prometheus_version }}"
prometheus_volume: "prometheus_data"
Expand Down Expand Up @@ -64,7 +65,7 @@ prometheus_external_labels:
# ---------------------
prometheus_services:
prometheus:
container_name: prometheus
container_name: "{{ prometheus_container_name }}"
group: prometheus
enabled: "{{ enable_prometheus }}"
image: "{{ prometheus_image }}"
Expand Down

0 comments on commit d67400d

Please sign in to comment.