Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .ansible/roles/netdata
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# For the time being, @Ferroin is responsible for everything here
# For the time being, @Ferroin is responsible for everything here.

* @netdata/agent-sre
4 changes: 0 additions & 4 deletions .gitignore

This file was deleted.

7 changes: 4 additions & 3 deletions defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
---
role_version: 1.0.0
role_version: 0.1.0

# Define the Netdata release version we install
netdata_release_version: "stable"
# Define the Netdata release channel we install
# Supported values: stable, edge, nightly (alias for edge)
netdata_release_channel: "stable"

# Define if we manage the Netdata configuration
netdata_manage_config: false
Expand Down
5 changes: 5 additions & 0 deletions handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,8 @@
daemon_reload: true
enabled: true
when: ansible_service_mgr == "systemd"

- name: Reload Netdata claiming state
ansible.builtin.command: netdatacli reload-claiming-state
changed_when: true
failed_when: false
12 changes: 1 addition & 11 deletions tasks/configure-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
owner: root
group: netdata
mode: '0644'
when:
when:
- netdata_manage_config
- netdata_custom_config_path != ""
notify: Restart Netdata
Expand All @@ -24,16 +24,6 @@
- netdata_go_collector_plugins is defined and netdata_go_collector_plugins|length > 0
notify: Restart Netdata

- name: Lay down charts.d.conf
ansible.builtin.copy:
content: 'enable_all_charts="yes"'
dest: "/etc/netdata/charts.d.conf"
owner: root
group: netdata
mode: '0644'
when: netdata_manage_charts
notify: Restart Netdata

- name: Process all Jinja2 chart templates
ansible.builtin.template:
src: "{{ item }}"
Expand Down
8 changes: 6 additions & 2 deletions tasks/install-debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@

# Debian

- name: Set repository URL
ansible.builtin.set_fact:
netdata_repo_url: "{{ netdata_repository_url }}{{ netdata_release_channel_normalized }}/{{ ansible_facts.distribution | lower }}/"

- name: Ensure gpg is installed.
ansible.builtin.apt:
name: gnupg
Expand All @@ -14,13 +18,13 @@
- name: Install Netdata repo key.
ansible.builtin.apt_key:
url: "{{ netdata_repository_key_url }}"
id: "9DD4A74CECFA8F4F"
state: present

- name: Add repository
ansible.builtin.apt_repository:
filename: "netdata"
repo: |
deb {{ netdata_repository_url }}{{ netdata_release_version }}/{{ ansible_facts.distribution | lower }}/ {{ ansible_distribution_release | lower }}/
repo: "deb {{ netdata_repo_url }} {{ ansible_distribution_release | lower }}/"
state: present

- name: Install package
Expand Down
4 changes: 2 additions & 2 deletions tasks/install-opensuse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@
- name: Add repository
community.general.zypper_repository:
name: "netdata"
repo: "{{ netdata_repository_url }}{{ netdata_release_version }}/opensuse/$releasever/$basearch"
repo: "{{ netdata_repository_url }}{{ netdata_release_channel_normalized }}/opensuse/$releasever/$basearch"
state: present
auto_import_keys: true

- name: Add repository configuration
community.general.zypper_repository:
name: "netdata-repoconfig"
repo: "{{ netdata_repository_url }}{{ netdata_release_version }}/opensuse/$releasever/$basearch"
repo: "{{ netdata_repository_url }}{{ netdata_release_channel_normalized }}/opensuse/$releasever/$basearch"
state: present
auto_import_keys: true

Expand Down
37 changes: 0 additions & 37 deletions tasks/install-ubuntu.yml

This file was deleted.

12 changes: 6 additions & 6 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
- name: Gather facts
ansible.builtin.setup:

- name: Install the Netdata Linux agent on Debian
ansible.builtin.include_tasks: install-debian.yml
when: "'debian' in ansible_facts.distribution | lower"
- name: Normalize release channel (nightly -> edge)
ansible.builtin.set_fact:
netdata_release_channel_normalized: "{{ 'edge' if netdata_release_channel == 'nightly' else netdata_release_channel }}"

- name: Install the Netdata Linux agent on Ubuntu
ansible.builtin.include_tasks: install-ubuntu.yml
when: "'ubuntu' in ansible_facts.distribution | lower"
- 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)"

- name: Install the Netdata Linux agent on OpenSUSE
ansible.builtin.include_tasks: install-opensuse.yml
Expand Down
2 changes: 1 addition & 1 deletion tasks/node_claim.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
owner: root
group: root
mode: '0644'
notify: Restart Netdata
notify: Reload Netdata claiming state
1 change: 0 additions & 1 deletion templates/claim.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@
{% if netdata_proxy %}
proxy = {{ netdata_proxy }}
{% endif %}
insecure = 'no'
2 changes: 0 additions & 2 deletions vars/main.yml

This file was deleted.