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:
main:
options:
system_extra_netdata_inet_address:
system_extra_netdata_bind_socket_to:
type: "str"
required: true
system_extra_netdata_inet6_address:
type: "str"
required: true
system_extra_netdata_registry_enabled:
system_extra_netdata_stream_parent:
type: "bool"
required: true
system_extra_netdata_registry_url:
system_extra_netdata_stream_dest_inet6:
type: "str"
required: true
system_extra_netdata_stream_api_key:

View File

@ -11,18 +11,6 @@
name: "netdata"
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"
ansible.builtin.template:
src: "./netdata.conf"

View File

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

View File

@ -5,7 +5,7 @@
# number of hosts.
#
# 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
@ -30,7 +30,7 @@
# the Netdata will encrypt the connection with the parent.
#
# 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?
# The netdata child is configurated to avoid invalid SSL/TLS certificate,
@ -89,7 +89,7 @@
# It is ignored when replication is enabled
initial clock resync iterations = 60
{% endif %}
{% if system_extra_netdata_registry_enabled %}
{% if system_extra_netdata_stream_parent %}
# -----------------------------------------------------------------------------
# 2. ON PARENT NETDATA - THE ONE THAT WILL BE RECEIVING METRICS