I have the script that installs Netdata etc, I am in the process of automating the installation via bash, I have been successful in passing on the y/yes but the last input needed is “press return/enter”.
I am wondering what everyone here has done via bash?
Hey everyone, I just published a sample application for dynamic configuration management using Cosul, in the netdata-community repository.
If you want to discuss about the consul sample-app, please do so in the community forum topic I created specifically for this reason!
Please do PR your suggestions for ansible in the same repo, as per the instructions. Let’s create a rich Community Repository full of examples and sample applications, curated by our awesome community!
Thanks @cjcox, @jurgenhaas for the suggestions. I intend to create a public repository so that we may store these sample-apps and grow a cookbook of community-curated recipes!
---
# Note: this probably is just for "8" and not other versions.
#
- hosts: g_netdata
tasks:
- name: Check if a netdata is installed.
shell:
cmd: "netdata -V"
failed_when: False
changed_when: False
register: netdata_version
#
# Install netdata via curl
# (note: not a lot of error handling here)
#
- name: Install netdata
shell:
cmd: "bash <(curl -Ss https://my-netdata.io/kickstart.sh) --non-interactive"
executable: "/usr/bin/bash"
when: netdata_version.rc != 0
@jurgenhaas thanks for that - am looking to learn ansible myself at some stage so this should be a useful place for me to start with a side project for myself, cheers!
With Ansible, a fully automatic and dynamic deployment and configuration is no problem at all. As Ansible knows everything about each host already, the full configuration of Netdata with templates is just the obvious solution. It just requires writing all the templates, but you have to define your required configuration somewhere, don’t you.
We have developed an Ansible role at LakeDrops which may give you some idea on how this can be done. I’m using it for years on dozens of hosts and deployment/configuration is always hazzle-free.
@Dongdong-Zheng we’re very careful to ensure we maintain backwards compatibility. All netdata 1.x versions will be backwards compatible. You will know something major will change when we go to 2.x
@Christopher_Akritidis, I did think of the same idea of copying customized config files into respective folders to achieve easy setup after each netdata agent installation. But I wonder how this approach would age as Netdata evolves at current rapid speed.
So a playbook that massively overwrites the config in the user config directory and restarts netdata. That should be trivial too, right? The main thing to figure out would be how to get those config files transferred to each machine. Perhaps if the configuration is identical on each node, a better solution would be to have the user config directory point to a mounted shared drive? Just brainstorming here.
With ansible it would be pretty rudimentary to deploy Netdata. The interesting part is when we want to have dynamic configuration management, meaning that we want to change a specific configuration over a large number of nodes, without having to redeploy the nodes with the playbook.
kickstart has the “–dont-start-it” option. I would have a pre-made directory with the config files I want, install netdata with this option, copy over to the user config directory my files and then start it. I don’t know anything about ansible, but I expect it will be quite doable.
Chiming in here as i’m kinda curious about this too. If I google “ansible netdata” I get some stuff back but all a bit ad-hoc, random and maybe outdated. I wonder if some example ansible playbooks or something from netdata could be something the community might find useful. A bit out of my wheelhouse here though tbh as not sure what best practices are here (hence my curiosity)
Well, the Netdata Agent can auto-detect all the collectors, given that they have been setup with default or industry-standard settings. (e.g redis database exists at localhost). What you suggest perhaps is a scheme where we can pre-configure Netdata so that it can detect any number of sources based on the use-case of each user. That could be done perhaps with something like Ansinble or using Consul as a central configuration management key-value store.
The latter has been in my mind for quite some time. What do you thing?