From ed31f63e408a0b3fe4f1dfea48063694e5c1abc3 Mon Sep 17 00:00:00 2001 From: Rawiri Blundell Date: Thu, 23 Jul 2026 23:17:24 +1200 Subject: [PATCH 1/7] tasks/install-redhat.yml: Initial commit --- tasks/install-redhat.yml | 68 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 tasks/install-redhat.yml diff --git a/tasks/install-redhat.yml b/tasks/install-redhat.yml new file mode 100644 index 0000000..32ff58d --- /dev/null +++ b/tasks/install-redhat.yml @@ -0,0 +1,68 @@ +--- +# Set the EL prefix, used for repo baseurls e.g. +# https://repository.netdata.cloud/repos/stable/el/9/$basearch +# ^^----- This bit right here +- name: "Set netdata_el_repo_distro (Enterprise Linux)" + ansible.builtin.set_fact: + netdata_el_repo_distro: el + +- name: "Set netdata_el_repo_distro (Oracle Linux)" + ansible.builtin.set_fact: + netdata_el_repo_distro: ol + when: ansible_facts['distribution'] == "OracleLinux" + +- name: "Set netdata_el_repo_distro (Fedora)" + ansible.builtin.set_fact: + netdata_el_repo_distro: fedora + when: ansible_facts['distribution'] == "Fedora" + +- name: "Set netdata_el_repo_distro (Amazon Linux)" + ansible.builtin.set_fact: + netdata_el_repo_distro: amazonlinux + when: ansible_facts['distribution'] == "Amazon" + +- name: "Ensure netdata repo keys are present" + ansible.builtin.rpm_key: + state: present + key: "{{ item }}" + loop: + - "{{ netdata_repository_key_url }}" + - "{{ netdata_repository_old_key_url }}" + notify: + - "Update dnf cache" + +- name: "Ensure netdata repository is configured: {{ netdata_release_channel_normalized }}" + ansible.builtin.yum_repository: + baseurl: "{{ netdata_repository_url }}{{ netdata_release_channel_normalized }}/{{ netdata_el_repo_distro }}/{{ ansible_distribution_major_version }}/{{ ansible_architecture }}/" + description: Netdata {{ netdata_release_channel_normalized }} + state: present + enabled: true + file: netdata-{{ netdata_release_channel_normalized }} + gpgcheck: true + gpgkey: + - "{{ netdata_repository_key_url }}" + - "{{ netdata_repository_old_key_url }}" + name: netdata-{{ netdata_release_channel_normalized }} + priority: 50 + repo_gpgcheck: true + sslcacert: /etc/pki/tls/certs/ca-bundle.crt + sslverify: true + notify: + - "Update dnf cache" + +- name: "Ensure netdata is installed" + ansible.builtin.dnf: + name: + - util-linux + - openssl + - netdata + state: present + update_cache: true + +- name: Install chart support if enabled + ansible.builtin.dnf: + name: "netdata-plugin-chartsd" + state: present + notify: Restart Netdata + when: netdata_manage_charts +... \ No newline at end of file From 91997116611856847c50f74a4c646ab8a1ceb55e Mon Sep 17 00:00:00 2001 From: Rawiri Blundell Date: Thu, 23 Jul 2026 23:17:52 +1200 Subject: [PATCH 2/7] NOTICE: Add to ensure correct attribution for derived MIT code in install-redhat.yml --- NOTICE | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 NOTICE diff --git a/NOTICE b/NOTICE new file mode 100644 index 0000000..f343f36 --- /dev/null +++ b/NOTICE @@ -0,0 +1,66 @@ +# Notices for Netdata + +This project is produced and maintained by the Netdata authors. This software incorporates material from third parties. + +## Copyright + +All content is the property of the respective authors or their employers. Every attempt will be made in good faith to track third party code and licences in the Attributions section of this document. + +The software directly provided by this project is released under the Apache License 2.0, which has a Redistribution clause that protects third party code. + +Copies of the licenses that cover all of the included source code are at the bottom of this document for reference. + +If you find code in this repository that you feel violates copyright, be it your copyright or anybody elses, please notify the authors in the first instance, preferably in a non-confrontational way. Like you would communicate with a friend or colleague. We respect the copyrights of others and their license choices, and if we're in error in any way, we want to rectify that immediately. + +## Cryptography + +Content may contain encryption software. The country in which you are currently +may have restrictions on the import, possession, and use, and/or re-export to +another country, of encryption software. BEFORE using any encryption software, +please check the country's laws, regulations and policies concerning the import, +possession, or use, and re-export of encryption software, to see if this is +permitted. + +## Attributions + +### ansible-role-netdata (Daniel Gibbs) + +Portions of this role are derived from +[dgibbs64/ansible-role-netdata](https://github.com/dgibbs64/ansible-role-netdata), +used under the MIT License. + +- Source: https://github.com/dgibbs64/ansible-role-netdata +- License: MIT (full text under "Third-party licenses" below) +- Copyright (c) 2026 Daniel Gibbs + +Derived material: + +- `tasks/install-redhat.yml` — RedHat-family repository and package setup + +Other files may contain patterns adapted from the same source. This list is +maintained in good faith; if you identify further derived material, please +raise it so it can be credited. + +## Third-party licenses + +### The MIT License (MIT) — dgibbs64/ansible-role-netdata + +Copyright (c) 2026 Daniel Gibbs + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file From d8d6315e2d4bbc43abd05ab5ed63c6f1d2cc8ea5 Mon Sep 17 00:00:00 2001 From: Rawiri Blundell Date: Thu, 23 Jul 2026 23:19:20 +1200 Subject: [PATCH 3/7] defaults/main.yml: Switch repo url's to https, add supported distro list for fail-fast assert check --- defaults/main.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 0f66404..d8c4ed1 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -34,9 +34,16 @@ netdata_claim_token: "" netdata_claim_rooms: "" # Define the Netdata repository URLs and associated key files -netdata_repository_url: "http://repo.netdata.cloud/repos/" -netdata_repoconfig_url: "http://repo.netdata.cloud/repoconfig/" +netdata_repository_url: "https://repo.netdata.cloud/repos/" +netdata_repoconfig_url: "https://repo.netdata.cloud/repoconfig/" netdata_repository_key_url: "https://repo.netdata.cloud/netdatabot.gpg.key" +netdata_repository_old_key_url: "https://repo.netdata.cloud/netdatabot.old.gpg.key" + +# OS families this role installs on +netdata_linux_os_families: + - Debian + - RedHat + - Suse # Define config for enabled Go integrations netdata_go_collector_plugins: [] From 712f0db23c1db739fdd9bcdb90497d145c2c1baa Mon Sep 17 00:00:00 2001 From: Rawiri Blundell Date: Thu, 23 Jul 2026 23:19:48 +1200 Subject: [PATCH 4/7] handlers/main.yml: Add dnf cache handler --- handlers/main.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/handlers/main.yml b/handlers/main.yml index 52fdf94..85f1307 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -11,3 +11,9 @@ ansible.builtin.command: netdatacli reload-claiming-state changed_when: true failed_when: false + +- name: "Update dnf cache" + become: true + ansible.builtin.dnf: + update_cache: true +... From d886690c1fa8dcc2ec0f31eed84dd45c2615b061 Mon Sep 17 00:00:00 2001 From: Rawiri Blundell Date: Thu, 23 Jul 2026 23:20:59 +1200 Subject: [PATCH 5/7] tasks/main.yml: Add fail-fast assert check, plumb-in install-redhat.yml, switch to ansible_os_family when condition --- tasks/main.yml | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index 6ab1e07..688a29f 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,8 +1,13 @@ --- - - name: Gather facts ansible.builtin.setup: +- name: "Assert the platform is supported" + ansible.builtin.assert: + that: ansible_os_family in netdata_linux_os_families + fail_msg: "netdata: unsupported os_family '{{ ansible_os_family }}'" + quiet: true + - name: Normalize release channel (nightly -> edge) ansible.builtin.set_fact: netdata_release_channel_normalized: >- @@ -11,13 +16,18 @@ - name: Install the Netdata Linux agent on Debian/Ubuntu ansible.builtin.include_tasks: install-debian.yml - when: >- - ('debian' in ansible_facts.distribution | lower) or - ('ubuntu' in ansible_facts.distribution | lower) + when: + - ansible_os_family == 'Debian' - name: Install the Netdata Linux agent on OpenSUSE ansible.builtin.include_tasks: install-opensuse.yml - when: "'opensuse' in ansible_facts.distribution | lower" + when: + - "'opensuse' in ansible_facts.distribution | lower" + +- name: Install the Netdata Linux agent on RedHat family distros + ansible.builtin.include_tasks: install-redhat.yml + when: + - ansible_os_family == 'RedHat' - name: Configure the Netdata Linux agent ansible.builtin.include_tasks: configure-linux.yml @@ -29,3 +39,4 @@ - name: Claim node if claim_token ansible.builtin.include_tasks: node_claim.yml when: netdata_claim +... From 94633123ae65fc9d1dc13e8b548579b08f68cf86 Mon Sep 17 00:00:00 2001 From: Rawiri Blundell Date: Thu, 23 Jul 2026 23:21:30 +1200 Subject: [PATCH 6/7] meta/main.yml: Add EL 9/10, add galaxy_tags --- meta/main.yml | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/meta/main.yml b/meta/main.yml index 581d311..1223853 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -23,15 +23,17 @@ galaxy_info: - name: opensuse versions: - all + - name: EL + versions: + - 9 + - 10 - galaxy_tags: [] - # List tags for your role here, one per line. A tag is a keyword that describes - # and categorizes the role. Users find roles by searching for tags. Be sure to - # remove the '[]' above, if you add tags to this list. - # - # NOTE: A tag is limited to a single word comprised of alphanumeric characters. - # Maximum 20 tags per role. + galaxy_tags: + - monitoring + - netdata + - metrics + - observability + - system +# No role dependencies. dependencies: [] - # List your role dependencies here, one per line. Be sure to remove the '[]' above, - # if you add dependencies to this list. From d470cc5ff4b1a0b7e25a5aa46db88866d7c7aadc Mon Sep 17 00:00:00 2001 From: Rawiri Blundell Date: Fri, 24 Jul 2026 00:10:29 +1200 Subject: [PATCH 7/7] meta/main.yml, tasks/install-redhat.yml: Apply fixes to satisfy Ansible Lint check --- meta/main.yml | 3 +-- tasks/install-redhat.yml | 10 ++++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/meta/main.yml b/meta/main.yml index 1223853..c8d24ab 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -25,8 +25,7 @@ galaxy_info: - all - name: EL versions: - - 9 - - 10 + - all galaxy_tags: - monitoring diff --git a/tasks/install-redhat.yml b/tasks/install-redhat.yml index 32ff58d..1e8d79b 100644 --- a/tasks/install-redhat.yml +++ b/tasks/install-redhat.yml @@ -33,7 +33,9 @@ - name: "Ensure netdata repository is configured: {{ netdata_release_channel_normalized }}" ansible.builtin.yum_repository: - baseurl: "{{ netdata_repository_url }}{{ netdata_release_channel_normalized }}/{{ netdata_el_repo_distro }}/{{ ansible_distribution_major_version }}/{{ ansible_architecture }}/" + baseurl: "{{ netdata_repository_url }}{{ netdata_release_channel_normalized }}/\ + {{ netdata_el_repo_distro }}/\ + {{ ansible_distribution_major_version }}/{{ ansible_architecture }}/" description: Netdata {{ netdata_release_channel_normalized }} state: present enabled: true @@ -59,10 +61,10 @@ state: present update_cache: true -- name: Install chart support if enabled +- name: "Install chart support if enabled" ansible.builtin.dnf: name: "netdata-plugin-chartsd" state: present - notify: Restart Netdata + notify: "Restart Netdata" when: netdata_manage_charts -... \ No newline at end of file +...