From 6fb27a3b00371be335eeb02016f074fa452c7001 Mon Sep 17 00:00:00 2001 From: Samuel Clay Date: Tue, 13 Apr 2021 15:06:07 -0400 Subject: [PATCH] Switching to netdata config template. --- .gitignore | 1 + ansible/roles/netdata/tasks/main.yml | 16 +++++----------- .../{netdata.conf => netdata.conf.j2} | 2 +- 3 files changed, 7 insertions(+), 12 deletions(-) rename docker/netdata/netdataconfig/{netdata.conf => netdata.conf.j2} (99%) diff --git a/.gitignore b/.gitignore index eba773182..264c7e7fe 100644 --- a/.gitignore +++ b/.gitignore @@ -44,6 +44,7 @@ venv* # Docker Jinja templates docker/haproxy/haproxy.consul.cfg +docker/netdata/netdataconfig/netdata.conf # docker/haproxy/haproxy.staging.cfg # Staging doesn't use jinja templates, so no need to ignore docker/nginx/nginx.consul.conf diff --git a/ansible/roles/netdata/tasks/main.yml b/ansible/roles/netdata/tasks/main.yml index 662478129..69845e620 100644 --- a/ansible/roles/netdata/tasks/main.yml +++ b/ansible/roles/netdata/tasks/main.yml @@ -1,15 +1,9 @@ --- -- name: Enable python.d - become: yes - copy: - dest: /etc/netdata/conf.d/netdata.conf - content: | - [plugins] - go.d = no - python.d = yes - [web] - mode = none - register: netdata_conf +- name: Copy netdata.conf template + template: + src: /srv/newsblur/docker/netdata/netdataconfig/netdata.conf.j2 + dest: /srv/newsblur/docker/netdata/netdataconfig/netdata.conf + notify: restart netdata - name: Setup Netdata docker container become: yes diff --git a/docker/netdata/netdataconfig/netdata.conf b/docker/netdata/netdataconfig/netdata.conf.j2 similarity index 99% rename from docker/netdata/netdataconfig/netdata.conf rename to docker/netdata/netdataconfig/netdata.conf.j2 index aa7491b79..f7dddb90a 100644 --- a/docker/netdata/netdataconfig/netdata.conf +++ b/docker/netdata/netdataconfig/netdata.conf.j2 @@ -16,7 +16,7 @@ # run as user = netdata # host access prefix = /host # glibc malloc arena max for plugins = 1 - hostname = netdata-docker + hostname = {{ ansible_hostname }} # history = 3996 # update every = 1 # config directory = /etc/netdata