Simplify netdata network access

This commit is contained in:
Wojciech Kozlowski 2023-10-08 16:46:47 +02:00
parent 0f805168b6
commit 9b47271a10
4 changed files with 7 additions and 26 deletions

View File

@ -2,16 +2,13 @@
argument_specs: argument_specs:
main: main:
options: options:
system_extra_netdata_inet_address: system_extra_netdata_bind_socket_to:
type: "str" type: "str"
required: true required: true
system_extra_netdata_inet6_address: system_extra_netdata_stream_parent:
type: "str"
required: true
system_extra_netdata_registry_enabled:
type: "bool" type: "bool"
required: true required: true
system_extra_netdata_registry_url: system_extra_netdata_stream_dest_inet6:
type: "str" type: "str"
required: true required: true
system_extra_netdata_stream_api_key: system_extra_netdata_stream_api_key:

View File

@ -11,18 +11,6 @@
name: "netdata" name: "netdata"
enabled: true enabled: true
- name: "resolve netdata registry via hosts file (inet)"
ansible.builtin.lineinfile:
path: "/etc/hosts"
line: "{{ system_extra_netdata_registry_inet_address }} {{ system_extra_netdata_registry_url }}"
insertafter: "EOF"
- name: "resolve netdata registry via hosts file (inet6)"
ansible.builtin.lineinfile:
path: "/etc/hosts"
line: "{{ system_extra_netdata_registry_inet6_address }} {{ system_extra_netdata_registry_url }}"
insertafter: "EOF"
- name: "configure netdata" - name: "configure netdata"
ansible.builtin.template: ansible.builtin.template:
src: "./netdata.conf" src: "./netdata.conf"

View File

@ -16,8 +16,4 @@
web files group = root web files group = root
# Netdata is not designed to be exposed to potentially hostile # Netdata is not designed to be exposed to potentially hostile
# networks. See https://github.com/netdata/netdata/issues/164 # networks. See https://github.com/netdata/netdata/issues/164
bind socket to IP = {{ system_extra_netdata_inet_address }} {{ system_extra_netdata_inet6_address }} bind socket to IP = {{ system_extra_netdata_bind_socket_to }}
[registry]
enabled = {{ 'yes' if system_extra_netdata_registry_enabled else 'no' }}
registry to announce = {{ system_extra_netdata_registry_url }}:19999

View File

@ -5,7 +5,7 @@
# number of hosts. # number of hosts.
# #
# You can generate API keys, with the linux command: uuidgen # You can generate API keys, with the linux command: uuidgen
{% if not system_extra_netdata_registry_enabled %} {% if not system_extra_netdata_stream_parent %}
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
# 1. ON CHILD NETDATA - THE ONE THAT WILL BE SENDING METRICS # 1. ON CHILD NETDATA - THE ONE THAT WILL BE SENDING METRICS
@ -30,7 +30,7 @@
# the Netdata will encrypt the connection with the parent. # the Netdata will encrypt the connection with the parent.
# #
# This communication is not HTTP (it cannot be proxied by web proxies). # This communication is not HTTP (it cannot be proxied by web proxies).
destination = tcp:{{ system_extra_netdata_registry_url }}:19999 destination = tcp:[{{ system_extra_netdata_stream_dest_inet6 }}]:19999
# Skip Certificate verification? # Skip Certificate verification?
# The netdata child is configurated to avoid invalid SSL/TLS certificate, # The netdata child is configurated to avoid invalid SSL/TLS certificate,
@ -89,7 +89,7 @@
# It is ignored when replication is enabled # It is ignored when replication is enabled
initial clock resync iterations = 60 initial clock resync iterations = 60
{% endif %} {% endif %}
{% if system_extra_netdata_registry_enabled %} {% if system_extra_netdata_stream_parent %}
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
# 2. ON PARENT NETDATA - THE ONE THAT WILL BE RECEIVING METRICS # 2. ON PARENT NETDATA - THE ONE THAT WILL BE RECEIVING METRICS