├── host_vars └── centos7 ├── roles ├── claim │ ├── tests │ │ ├── inventory │ │ └── test.yml │ ├── defaults │ │ └── main.yml │ ├── vars │ │ ├── Centos7.yml │ │ ├── Debian11.yml │ │ ├── Fedora35.yml │ │ ├── Rocky8.yml │ │ ├── OracleLinux8.yml │ │ └── main.yml │ ├── handlers │ │ └── main.yml │ ├── tasks │ │ └── main.yml │ ├── meta │ │ └── main.yml │ └── README.md ├── install_netdata_agent │ ├── tasks │ │ ├── Alpine3.yml │ │ ├── Ubuntu18.yml │ │ ├── Ubuntu20.yml │ │ ├── Ubuntu22.yml │ │ ├── main.yml │ │ ├── Debian11.yml │ │ ├── debian12.yml │ │ ├── Debian10.yml │ │ ├── Fedora35.yml │ │ ├── Rocky8.yml │ │ ├── OracleLinux8.yml │ │ └── Centos7.yml │ ├── tests │ │ ├── inventory │ │ └── test.yml │ ├── vars │ │ ├── Alpine3.yml │ │ ├── aarch64.yml │ │ ├── x86_64.yml │ │ ├── main.yml │ │ ├── Centos7.yml │ │ ├── Fedora35.yml │ │ ├── Rocky8.yml │ │ ├── Ubuntu18.yml │ │ ├── Ubuntu20.yml │ │ ├── Ubuntu22.yml │ │ ├── OracleLinux8.yml │ │ ├── Debian10.yml │ │ ├── Debian11.yml │ │ └── debian12.yml │ ├── handlers │ │ └── main.yml │ ├── defaults │ │ └── main.yml │ ├── templates │ │ └── netdata.conf.j2 │ ├── meta │ │ └── main.yml │ └── README.md ├── install_netdata_repository │ ├── vars │ │ ├── CentOS7.yml │ │ ├── Fedora35.yml │ │ ├── Rocky8.yml │ │ ├── OracleLinux8.yml │ │ ├── main.yml │ │ ├── Debian10.yml │ │ ├── Ubuntu18.yml │ │ ├── Ubuntu20.yml │ │ ├── Ubuntu22.yml │ │ ├── Debian11.yml │ │ └── debian12.yml │ ├── tests │ │ ├── inventory │ │ └── test.yml │ ├── handlers │ │ └── main.yml │ ├── tasks │ │ ├── Debian11.yml │ │ ├── debian12.yml │ │ ├── Ubuntu20.yml │ │ ├── Ubuntu22.yml │ │ ├── main.yml │ │ ├── Debian10.yml │ │ ├── Ubuntu18.yml │ │ ├── CentOS7.yml │ │ ├── Rocky8.yml │ │ ├── OracleLinux8.yml │ │ └── Fedora35.yml │ ├── defaults │ │ └── main.yml │ ├── README.md │ └── meta │ │ └── main.yml ├── purge_netdata_agent │ ├── vars │ │ ├── Debian10.yml │ │ ├── Debian11.yml │ │ ├── Ubuntu18.yml │ │ ├── Ubuntu20.yml │ │ ├── Ubuntu22.yml │ │ ├── debian12.yml │ │ ├── main.yml │ │ ├── Centos7.yml │ │ ├── Fedora35.yml │ │ ├── Rocky8.yml │ │ └── OracleLinux8.yml │ ├── tests │ │ ├── inventory │ │ └── test.yml │ ├── defaults │ │ └── main.yml │ ├── handlers │ │ └── main.yml │ ├── tasks │ │ ├── Debian10.yml │ │ ├── Debian11.yml │ │ ├── debian12.yml │ │ ├── Ubuntu18.yml │ │ ├── Ubuntu20.yml │ │ ├── Ubuntu22.yml │ │ ├── main.yml │ │ ├── Centos7.yml │ │ ├── Fedora35.yml │ │ ├── Rocky8.yml │ │ └── OracleLinux8.yml │ ├── .travis.yml │ ├── meta │ │ └── main.yml │ └── README.md └── purge_netdata_repository │ ├── tests │ ├── inventory │ └── test.yml │ ├── vars │ ├── main.yml │ ├── Centos7.yml │ ├── Debian10.yml │ ├── Debian11.yml │ ├── Ubuntu18.yml │ ├── Ubuntu20.yml │ ├── Ubuntu22.yml │ ├── debian12.yml │ ├── Fedora35.yml │ ├── Rocky8.yml │ └── OracleLinux8.yml │ ├── defaults │ └── main.yml │ ├── tasks │ ├── Centos7.yml │ ├── main.yml │ ├── Rocky8.yml │ ├── Fedora35.yml │ ├── OracleLinux8.yml │ ├── Ubuntu18.yml │ ├── Ubuntu20.yml │ ├── Ubuntu22.yml │ ├── Debian10.yml │ ├── Debian11.yml │ └── debian12.yml │ ├── handlers │ └── main.yml │ ├── .travis.yml │ ├── meta │ └── main.yml │ └── README.md ├── .gitignore ├── .github └── CODEOWNERS ├── group_vars └── all ├── .ansible-lint ├── molecule ├── common │ ├── Dockerfile_debian10.j2 │ ├── Dockerfile_debian11.j2 │ ├── Dockerfile_ubuntu1804.j2 │ ├── Dockerfile_ubuntu2004.j2 │ └── Dockerfile_ubuntu2204.j2 ├── default │ ├── converge.yml │ ├── verify.yml │ └── molecule.yml └── README.md ├── claim.yml ├── purge.yml ├── netdata-agent.yml └── README.md /host_vars/centos7: -------------------------------------------------------------------------------- 1 | --- 2 | oom_score: 1100 3 | -------------------------------------------------------------------------------- /roles/claim/tests/inventory: -------------------------------------------------------------------------------- 1 | localhost 2 | 3 | -------------------------------------------------------------------------------- /roles/install_netdata_agent/tasks/Alpine3.yml: -------------------------------------------------------------------------------- 1 | --- 2 | -------------------------------------------------------------------------------- /roles/install_netdata_agent/tests/inventory: -------------------------------------------------------------------------------- 1 | localhost -------------------------------------------------------------------------------- /roles/install_netdata_agent/vars/Alpine3.yml: -------------------------------------------------------------------------------- 1 | --- 2 | -------------------------------------------------------------------------------- /roles/install_netdata_repository/vars/CentOS7.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /roles/purge_netdata_agent/vars/Debian10.yml: -------------------------------------------------------------------------------- 1 | --- 2 | -------------------------------------------------------------------------------- /roles/purge_netdata_agent/vars/Debian11.yml: -------------------------------------------------------------------------------- 1 | --- 2 | -------------------------------------------------------------------------------- /roles/purge_netdata_agent/vars/Ubuntu18.yml: -------------------------------------------------------------------------------- 1 | --- 2 | -------------------------------------------------------------------------------- /roles/purge_netdata_agent/vars/Ubuntu20.yml: -------------------------------------------------------------------------------- 1 | --- 2 | -------------------------------------------------------------------------------- /roles/purge_netdata_agent/vars/Ubuntu22.yml: -------------------------------------------------------------------------------- 1 | --- 2 | -------------------------------------------------------------------------------- /roles/purge_netdata_agent/vars/debian12.yml: -------------------------------------------------------------------------------- 1 | --- 2 | -------------------------------------------------------------------------------- /roles/install_netdata_repository/vars/Fedora35.yml: -------------------------------------------------------------------------------- 1 | --- 2 | -------------------------------------------------------------------------------- /roles/install_netdata_repository/vars/Rocky8.yml: -------------------------------------------------------------------------------- 1 | --- 2 | -------------------------------------------------------------------------------- /roles/install_netdata_repository/vars/OracleLinux8.yml: -------------------------------------------------------------------------------- 1 | --- 2 | -------------------------------------------------------------------------------- /roles/purge_netdata_agent/tests/inventory: -------------------------------------------------------------------------------- 1 | localhost 2 | 3 | -------------------------------------------------------------------------------- /roles/install_netdata_repository/tests/inventory: -------------------------------------------------------------------------------- 1 | localhost 2 | 3 | -------------------------------------------------------------------------------- /roles/purge_netdata_repository/tests/inventory: -------------------------------------------------------------------------------- 1 | localhost 2 | 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | hosts 2 | ansible.cfg 3 | test.yml 4 | .vscode 5 | .swp 6 | -------------------------------------------------------------------------------- /roles/claim/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # defaults file for roles/claim 3 | -------------------------------------------------------------------------------- /roles/install_netdata_agent/vars/aarch64.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | suffix: aarch64 4 | -------------------------------------------------------------------------------- /roles/install_netdata_agent/vars/x86_64.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | suffix: amd64 4 | -------------------------------------------------------------------------------- /roles/claim/vars/Centos7.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | claiming_script: "/usr/sbin/netdata-claim.sh" 4 | -------------------------------------------------------------------------------- /roles/claim/vars/Debian11.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | claiming_script: "/usr/sbin/netdata-claim.sh" 4 | -------------------------------------------------------------------------------- /roles/claim/vars/Fedora35.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | claiming_script: "/usr/sbin/netdata-claim.sh" 4 | -------------------------------------------------------------------------------- /roles/claim/vars/Rocky8.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | claiming_script: "/usr/sbin/netdata-claim.sh" 4 | -------------------------------------------------------------------------------- /roles/purge_netdata_agent/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # vars file for roles/purge_netdata_agent 3 | -------------------------------------------------------------------------------- /roles/claim/vars/OracleLinux8.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | claiming_script: "/usr/sbin/netdata-claim.sh" 4 | -------------------------------------------------------------------------------- /roles/install_netdata_agent/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # vars file for roles/install_netdata_agent 3 | -------------------------------------------------------------------------------- /roles/install_netdata_repository/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # vars file for roles/netdata-repository 3 | -------------------------------------------------------------------------------- /roles/purge_netdata_agent/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # defaults file for roles/purge_netdata_agent 3 | -------------------------------------------------------------------------------- /roles/purge_netdata_agent/handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # handlers file for roles/purge_netdata_agent 3 | -------------------------------------------------------------------------------- /roles/purge_netdata_repository/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # vars file for roles/purge_netdata_repository 3 | -------------------------------------------------------------------------------- /roles/install_netdata_repository/handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # handlers file for roles/netdata-repository 3 | -------------------------------------------------------------------------------- /roles/purge_netdata_repository/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # defaults file for roles/purge_netdata_repository 3 | -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | # For the time being, @Ferroin is responsible for everything here. 2 | * @netdata/agent-sre 3 | -------------------------------------------------------------------------------- /group_vars/all: -------------------------------------------------------------------------------- 1 | distro: edge 2 | become: yes 3 | claim_token: 4 | claim_rooms: 5 | claim_url: https://app.netdata.cloud 6 | -------------------------------------------------------------------------------- /.ansible-lint: -------------------------------------------------------------------------------- 1 | --- 2 | # exclude_paths: 3 | # - 'roles/*/tests' 4 | parseable: true 5 | skip_list: 6 | - role-name[path] 7 | -------------------------------------------------------------------------------- /roles/install_netdata_agent/vars/Centos7.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | netdata_agent_package: netdata 4 | netdata_agent_service: netdata 5 | -------------------------------------------------------------------------------- /roles/install_netdata_agent/vars/Fedora35.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | netdata_agent_package: netdata 4 | netdata_agent_service: netdata 5 | -------------------------------------------------------------------------------- /roles/install_netdata_agent/vars/Rocky8.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | netdata_agent_package: netdata 4 | netdata_agent_service: netdata 5 | -------------------------------------------------------------------------------- /roles/install_netdata_agent/vars/Ubuntu18.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | netdata_agent_package: netdata 4 | netdata_agent_service: netdata 5 | -------------------------------------------------------------------------------- /roles/install_netdata_agent/vars/Ubuntu20.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | netdata_agent_package: netdata 4 | netdata_agent_service: netdata 5 | -------------------------------------------------------------------------------- /roles/install_netdata_agent/vars/Ubuntu22.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | netdata_agent_package: netdata 4 | netdata_agent_service: netdata 5 | -------------------------------------------------------------------------------- /roles/install_netdata_agent/vars/OracleLinux8.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | netdata_agent_package: netdata 4 | netdata_agent_service: netdata 5 | -------------------------------------------------------------------------------- /roles/claim/tests/test.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Test for claim role 3 | hosts: localhost 4 | remote_user: root 5 | roles: 6 | - roles/claim 7 | -------------------------------------------------------------------------------- /roles/purge_netdata_repository/vars/Centos7.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | netdata_repo_package: "{{ 'netdata-repo' if distro == 'stable' else 'netdata-repo-edge' }}" 4 | -------------------------------------------------------------------------------- /molecule/common/Dockerfile_debian10.j2: -------------------------------------------------------------------------------- 1 | FROM {{ item.image | lower }} 2 | 3 | RUN apt update && \ 4 | apt install -y nano curl gpg-agent python3 ca-certificates -------------------------------------------------------------------------------- /molecule/common/Dockerfile_debian11.j2: -------------------------------------------------------------------------------- 1 | FROM {{ item.image | lower }} 2 | 3 | RUN apt update && \ 4 | apt install -y nano curl gpg-agent python3 ca-certificates 5 | -------------------------------------------------------------------------------- /claim.yml: -------------------------------------------------------------------------------- 1 | - name: Claim netdata node 2 | hosts: all 3 | remote_user: "{{ansible_user}}" 4 | gather_facts: true 5 | become: true 6 | 7 | roles: 8 | - role: claim 9 | -------------------------------------------------------------------------------- /roles/purge_netdata_repository/vars/Debian10.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | dir_list: 4 | - /var/log/netdata 5 | - /var/lib/netdata 6 | - /var/cache/netdata 7 | - /usr/libexec/netdata 8 | -------------------------------------------------------------------------------- /roles/purge_netdata_repository/vars/Debian11.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | dir_list: 4 | - /var/log/netdata 5 | - /var/lib/netdata 6 | - /var/cache/netdata 7 | - /usr/libexec/netdata 8 | -------------------------------------------------------------------------------- /roles/purge_netdata_repository/vars/Ubuntu18.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | dir_list: 4 | - /var/log/netdata 5 | - /var/lib/netdata 6 | - /var/cache/netdata 7 | - /usr/libexec/netdata 8 | -------------------------------------------------------------------------------- /roles/purge_netdata_repository/vars/Ubuntu20.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | dir_list: 4 | - /var/log/netdata 5 | - /var/lib/netdata 6 | - /var/cache/netdata 7 | - /usr/libexec/netdata 8 | -------------------------------------------------------------------------------- /roles/purge_netdata_repository/vars/Ubuntu22.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | dir_list: 4 | - /var/log/netdata 5 | - /var/lib/netdata 6 | - /var/cache/netdata 7 | - /usr/libexec/netdata 8 | -------------------------------------------------------------------------------- /roles/purge_netdata_repository/vars/debian12.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | dir_list: 4 | - /var/log/netdata 5 | - /var/lib/netdata 6 | - /var/cache/netdata 7 | - /usr/libexec/netdata 8 | -------------------------------------------------------------------------------- /roles/purge_netdata_agent/tasks/Debian10.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: Remove Netdata packages 4 | ansible.builtin.apt: 5 | state: absent 6 | name: netdata 7 | purge: true 8 | -------------------------------------------------------------------------------- /roles/purge_netdata_agent/tasks/Debian11.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: Remove Netdata packages 4 | ansible.builtin.apt: 5 | state: absent 6 | name: netdata 7 | purge: true 8 | -------------------------------------------------------------------------------- /roles/purge_netdata_agent/tasks/debian12.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: Remove Netdata packages 4 | ansible.builtin.apt: 5 | state: absent 6 | name: netdata 7 | purge: true 8 | -------------------------------------------------------------------------------- /roles/install_netdata_agent/tests/test.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Test role install_netdata_agent 3 | hosts: localhost 4 | remote_user: root 5 | roles: 6 | - roles/install_netdata_agent 7 | -------------------------------------------------------------------------------- /roles/claim/handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # handlers file for roles/claim 3 | 4 | - name: Restart netdata agent 5 | ansible.builtin.systemd: 6 | name: netdata.service 7 | state: restarted 8 | -------------------------------------------------------------------------------- /roles/purge_netdata_agent/tests/test.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: "Test role: purge_netdata_agent" 4 | hosts: localhost 5 | remote_user: root 6 | roles: 7 | - roles/purge_netdata_agent 8 | -------------------------------------------------------------------------------- /roles/install_netdata_repository/tests/test.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Test for role install_netdata_repository 3 | hosts: localhost 4 | remote_user: root 5 | roles: 6 | - roles/install_netdata_repository 7 | -------------------------------------------------------------------------------- /roles/purge_netdata_agent/tasks/Ubuntu18.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: Remove Netdata packages 4 | ansible.builtin.apt: 5 | state: absent 6 | name: "netdata*" 7 | purge: true 8 | autoremove: true 9 | -------------------------------------------------------------------------------- /roles/purge_netdata_agent/tasks/Ubuntu20.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: Remove Netdata packages 4 | ansible.builtin.apt: 5 | state: absent 6 | name: "netdata*" 7 | purge: true 8 | autoremove: true 9 | -------------------------------------------------------------------------------- /roles/purge_netdata_agent/tasks/Ubuntu22.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: Remove Netdata packages 4 | ansible.builtin.apt: 5 | state: absent 6 | name: "netdata*" 7 | purge: true 8 | autoremove: true 9 | -------------------------------------------------------------------------------- /roles/purge_netdata_repository/tests/test.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: "Test for role: purge_netdata_repository" 4 | hosts: localhost 5 | remote_user: root 6 | roles: 7 | - roles/purge_netdata_repository 8 | -------------------------------------------------------------------------------- /roles/purge_netdata_agent/vars/Centos7.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | netdata_repo_package: "{{ 'netdata-repo' if distro == 'stable' else 'netdata-repo-edge' }}" 4 | 5 | netdata_agent_package: netdata 6 | netdata_agent_service: netdata 7 | -------------------------------------------------------------------------------- /roles/purge_netdata_agent/vars/Fedora35.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | netdata_repo_package: "{{ 'netdata-repo' if distro == 'stable' else 'netdata-repo-edge' }}" 4 | 5 | netdata_agent_package: netdata 6 | netdata_agent_service: netdata 7 | -------------------------------------------------------------------------------- /roles/purge_netdata_agent/vars/Rocky8.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | netdata_repo_package: "{{ 'netdata-repo' if distro == 'stable' else 'netdata-repo-edge' }}" 4 | 5 | netdata_agent_package: netdata 6 | netdata_agent_service: netdata 7 | -------------------------------------------------------------------------------- /roles/purge_netdata_repository/vars/Fedora35.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | netdata_repo_package: "{{ 'netdata-repo' if distro == 'stable' else 'netdata-repo-edge' }}" 4 | netdata_agent_package: netdata 5 | netdata_agent_service: netdata 6 | -------------------------------------------------------------------------------- /roles/purge_netdata_repository/vars/Rocky8.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | netdata_repo_package: "{{ 'netdata-repo' if distro == 'stable' else 'netdata-repo-edge' }}" 4 | netdata_agent_package: netdata 5 | netdata_agent_service: netdata 6 | -------------------------------------------------------------------------------- /molecule/default/converge.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Converge 3 | hosts: all 4 | tasks: 5 | - name: "Include install-netdata-repository" 6 | ansible.builtin.include_role: 7 | name: roles/install_netdata_repository 8 | -------------------------------------------------------------------------------- /roles/install_netdata_agent/handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # handlers file for roles/install_netdata_agent 3 | 4 | - name: Restart netdata agent 5 | ansible.builtin.systemd: 6 | name: netdata.service 7 | state: restarted 8 | -------------------------------------------------------------------------------- /roles/purge_netdata_agent/vars/OracleLinux8.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | netdata_agent_package: netdata 4 | netdata_agent_service: netdata 5 | 6 | netdata_repo_package: "{{ 'netdata-repo' if distro == 'stable' else 'netdata-repo-edge' }}" 7 | -------------------------------------------------------------------------------- /roles/purge_netdata_repository/vars/OracleLinux8.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | netdata_repo_package: "{{ 'netdata-repo' if distro == 'stable' else 'netdata-repo-edge' }}" 4 | netdata_agent_package: netdata 5 | netdata_agent_service: netdata 6 | -------------------------------------------------------------------------------- /purge.yml: -------------------------------------------------------------------------------- 1 | - name: Purge netdata agent and netdata agent repository 2 | hosts: all 3 | gather_facts: true 4 | become: true 5 | 6 | roles: 7 | - { role: purge_netdata_agent, become: true } 8 | - { role: purge_netdata_repository, become: true } 9 | -------------------------------------------------------------------------------- /molecule/default/verify.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # This is an example playbook to execute Ansible tests. 3 | 4 | - name: Verify 5 | hosts: all 6 | gather_facts: false 7 | tasks: 8 | - name: Example assertion 9 | ansible.builtin.assert: 10 | that: true 11 | -------------------------------------------------------------------------------- /roles/purge_netdata_repository/tasks/Centos7.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: Remove Netdata configuration package 4 | ansible.builtin.yum: 5 | name: 6 | - netdata 7 | - netdata-repo 8 | - netdata-repo-edge 9 | state: absent 10 | notify: yum-clean-metadata 11 | -------------------------------------------------------------------------------- /roles/claim/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # vars file for roles/claim 3 | 4 | claim_token: 4p_pe4EUMJ7hyO_DkTicKBRj_jfQXMbRQNaH39dz0YbXOHHrK_5jF9-Sjc5l4DbZMuXVtxE2kVMkP6YXmrYaBRcyg59qVGa0SMx6QhxIGVMMcpzuvom2IFSSaTpBEfBAw-nbcgQ 5 | claim_rooms: 4d9094b6-810e-458c-a9a0-acf3372e08e5 6 | claim_url: https://app.netdata.cloud 7 | -------------------------------------------------------------------------------- /roles/install_netdata_repository/tasks/Debian11.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: Install Netdata repo key. 4 | ansible.builtin.apt_key: 5 | url: https://packagecloud.io/netdata/netdata/gpgkey 6 | state: present 7 | 8 | - name: Install netdata repo 9 | ansible.builtin.apt: 10 | deb: "{{ repo_uri }}" 11 | -------------------------------------------------------------------------------- /roles/install_netdata_repository/tasks/debian12.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: Install Netdata repo key. 4 | ansible.builtin.apt_key: 5 | url: https://packagecloud.io/netdata/netdata/gpgkey 6 | state: present 7 | 8 | - name: Install netdata repo 9 | ansible.builtin.apt: 10 | deb: "{{ repo_uri }}" 11 | -------------------------------------------------------------------------------- /roles/install_netdata_repository/vars/Debian10.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | repo_uri: "{{ 'https://packagecloud.io/netdata/netdata/packages/debian/buster/netdata-repo_1-1_all.deb/download.deb' if distro == 'stable' else 'https://packagecloud.io/netdata/netdata/packages/debian/buster/netdata-repo-edge_1-1_all.deb/download.deb' }}" 4 | -------------------------------------------------------------------------------- /roles/install_netdata_repository/vars/Ubuntu18.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | repo_uri: "{{ 'https://packagecloud.io/netdata/netdata/packages/ubuntu/bionic/netdata-repo_1-1_all.deb/download.deb' if distro == 'stable' else 'https://packagecloud.io/netdata/netdata/packages/ubuntu/bionic/netdata-repo-edge_1-1_all.deb/download.deb' }}" 4 | -------------------------------------------------------------------------------- /roles/install_netdata_repository/vars/Ubuntu20.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | repo_uri: "{{ 'https://packagecloud.io/netdata/netdata/packages/ubuntu/focal/netdata-repo_1-1_all.deb/download.deb' if distro == 'stable' else 'https://packagecloud.io/netdata/netdata/packages/ubuntu/focal/netdata-repo-edge_1-1_all.deb/download.deb' }}" 4 | -------------------------------------------------------------------------------- /roles/install_netdata_repository/vars/Ubuntu22.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | repo_uri: "{{ 'https://packagecloud.io/netdata/netdata/packages/ubuntu/jammy/netdata-repo_1-1_all.deb/download.deb' if distro == 'stable' else 'https://packagecloud.io/netdata/netdata/packages/ubuntu/jammy/netdata-repo-edge_1-1_all.deb/download.deb' }}" 4 | -------------------------------------------------------------------------------- /roles/install_netdata_repository/vars/Debian11.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | repo_uri: "{{ 'https://packagecloud.io/netdata/netdata/packages/debian/bullseye/netdata-repo_1-1_all.deb/download.deb' if distro == 'stable' else 'https://packagecloud.io/netdata/netdata/packages/debian/bullseye/netdata-repo-edge_1-1_all.deb/download.deb' }}" 4 | -------------------------------------------------------------------------------- /roles/install_netdata_repository/vars/debian12.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | repo_uri: "{{ 'https://packagecloud.io/netdata/netdata/packages/debian/bullseye/netdata-repo_1-1_all.deb/download.deb' if distro == 'stable' else 'https://packagecloud.io/netdata/netdata/packages/debian/bullseye/netdata-repo-edge_1-1_all.deb/download.deb' }}" 4 | -------------------------------------------------------------------------------- /roles/install_netdata_repository/tasks/Ubuntu20.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: Install Netdata repo key. 4 | ansible.builtin.apt_key: 5 | url: https://packagecloud.io/netdata/netdata/gpgkey 6 | state: present 7 | 8 | - name: Install Netdata repository package 9 | ansible.builtin.apt: 10 | deb: "{{ repo_uri }}" 11 | -------------------------------------------------------------------------------- /roles/install_netdata_repository/tasks/Ubuntu22.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: Install Netdata repo key. 4 | ansible.builtin.apt_key: 5 | url: https://packagecloud.io/netdata/netdata/gpgkey 6 | state: present 7 | 8 | - name: Install Netdata repository package 9 | ansible.builtin.apt: 10 | deb: "{{ repo_uri }}" 11 | -------------------------------------------------------------------------------- /roles/install_netdata_agent/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # defaults file for roles/install_netdata_agent 3 | # Global 4 | agent_user: netdata 5 | agent_history: 3600 6 | # Agent process scheduling policy 7 | agent_policy: idle 8 | # Agent OOM score 9 | oom_score: 1000 10 | 11 | # Web 12 | owner: root 13 | group: netdata 14 | bind_to: localhost 15 | -------------------------------------------------------------------------------- /roles/purge_netdata_repository/handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # handlers file for roles/purge_netdata_repository 3 | 4 | - name: Yum clean metadata 5 | ansible.builtin.command: yum clean metadata 6 | args: 7 | warn: no 8 | 9 | - name: Dnf clean metadata 10 | ansible.builtin.command: dnf clean metadata 11 | args: 12 | warn: no 13 | -------------------------------------------------------------------------------- /roles/install_netdata_repository/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # tasks file for roles/netdata-repository 3 | - name: Include OS specific vars 4 | ansible.builtin.include_vars: "{{ ansible_distribution | lower }}{{ ansible_distribution_major_version }}.yml" 5 | 6 | - name: Include OS specific tasks 7 | ansible.builtin.include_tasks: "{{ ansible_distribution | lower }}{{ ansible_distribution_major_version }}.yml" 8 | -------------------------------------------------------------------------------- /roles/purge_netdata_agent/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # tasks file for roles/purge_netdata_agent 3 | 4 | - name: Include OS specific vars 5 | ansible.builtin.include_vars: "{{ ansible_distribution | lower }}{{ ansible_distribution_major_version }}.yml" 6 | 7 | - name: Include OS specific install 8 | ansible.builtin.include_tasks: "{{ ansible_distribution | lower }}{{ ansible_distribution_major_version }}.yml" 9 | -------------------------------------------------------------------------------- /roles/install_netdata_agent/tasks/Ubuntu18.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: Install the netdata agent package 4 | ansible.builtin.package: 5 | name: "{{ netdata_agent_package }}" 6 | update_cache: true 7 | state: latest 8 | 9 | - name: Start service "{{ netdata_agent_service }}" 10 | ansible.builtin.systemd: 11 | name: "{{ netdata_agent_service }}" 12 | state: started 13 | enabled: true 14 | -------------------------------------------------------------------------------- /roles/install_netdata_agent/tasks/Ubuntu20.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: Install the netdata agent package 4 | ansible.builtin.package: 5 | name: "{{ netdata_agent_package }}" 6 | update_cache: true 7 | state: latest 8 | 9 | - name: Start service "{{ netdata_agent_service }}" 10 | ansible.builtin.systemd: 11 | name: "{{ netdata_agent_service }}" 12 | state: started 13 | enabled: true 14 | -------------------------------------------------------------------------------- /roles/install_netdata_agent/tasks/Ubuntu22.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: Install the netdata agent package 4 | ansible.builtin.package: 5 | name: "{{ netdata_agent_package }}" 6 | update_cache: true 7 | state: latest 8 | 9 | - name: Start service "{{ netdata_agent_service }}" 10 | ansible.builtin.systemd: 11 | name: "{{ netdata_agent_service }}" 12 | state: started 13 | enabled: true 14 | -------------------------------------------------------------------------------- /roles/install_netdata_agent/vars/Debian10.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | netdata_agent_package: netdata 4 | netdata_agent_service: netdata 5 | 6 | package_uri: "{{ 'https://packagecloud.io/netdata/netdata/packages/debian/buster/' if distro == 'stable' else 'https://packagecloud.io/netdata/netdata-edge/packages/debian/buster/' }}" 7 | # package_name: "{{ 'netdata_1.33.1_' if distro == 'stable' else 'netdata_1.33.1-195-nightly_' }}" 8 | -------------------------------------------------------------------------------- /roles/install_netdata_agent/vars/Debian11.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | netdata_agent_package: netdata 4 | netdata_agent_service: netdata 5 | 6 | package_uri: "{{ 'https://packagecloud.io/netdata/netdata/packages/debian/bullseye/' if distro == 'stable' else 'https://packagecloud.io/netdata/netdata-edge/packages/debian/bullseye/' }}" 7 | # package_name: "{{ 'netdata_1.33.1_' if distro == 'stable' else 'netdata_1.33.1-195-nightly_' }}" 8 | -------------------------------------------------------------------------------- /roles/install_netdata_agent/vars/debian12.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | netdata_agent_package: netdata 4 | netdata_agent_service: netdata 5 | 6 | package_uri: "{{ 'https://packagecloud.io/netdata/netdata/packages/debian/bullseye/' if distro == 'stable' else 'https://packagecloud.io/netdata/netdata-edge/packages/debian/bullseye/' }}" 7 | # package_name: "{{ 'netdata_1.33.1_' if distro == 'stable' else 'netdata_1.33.1-195-nightly_' }}" 8 | -------------------------------------------------------------------------------- /roles/purge_netdata_repository/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | # tasks file for roles/purge_netdata_repository 4 | 5 | - name: Include OS specific vars 6 | ansible.builtin.include_vars: "{{ ansible_distribution | lower }}{{ ansible_distribution_major_version }}.yml" 7 | 8 | - name: Include OS specific tasks 9 | ansible.builtin.include_tasks: "{{ ansible_distribution | lower }}{{ ansible_distribution_major_version }}.yml" 10 | -------------------------------------------------------------------------------- /roles/purge_netdata_agent/tasks/Centos7.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: Remove Netdata packages 4 | ansible.builtin.yum: 5 | state: absent 6 | name: netdata 7 | 8 | - name: Remove the remains 9 | ansible.builtin.file: 10 | path: "{{ item }}" 11 | state: absent 12 | with_items: 13 | - /etc/netdata 14 | - /var/log/netdata 15 | - /var/lib/netdata 16 | - /var/cache/netdata 17 | - /usr/libexec/netdata 18 | -------------------------------------------------------------------------------- /roles/purge_netdata_agent/tasks/Fedora35.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: Remove Netdata packages 4 | ansible.builtin.dnf: 5 | state: absent 6 | name: 7 | - "{{ netdata_repo_package }}" 8 | - "{{ netdata_agent_package }}" 9 | 10 | - name: Remove the remains 11 | ansible.builtin.file: 12 | path: "{{ item }}" 13 | state: absent 14 | with_items: 15 | - /etc/netdata 16 | - /var/log/netdata 17 | - /var/lib/netdata 18 | - /var/cache/netdata 19 | - /usr/libexec/netdata 20 | -------------------------------------------------------------------------------- /roles/purge_netdata_agent/tasks/Rocky8.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: Remove Netdata packages 4 | ansible.builtin.dnf: 5 | state: absent 6 | name: 7 | - "{{ netdata_repo_package }}" 8 | - "{{ netdata_agent_package }}" 9 | 10 | - name: Remove the remains 11 | ansible.builtin.file: 12 | path: "{{ item }}" 13 | state: absent 14 | with_items: 15 | - /etc/netdata 16 | - /var/log/netdata 17 | - /var/lib/netdata 18 | - /var/cache/netdata 19 | - /usr/libexec/netdata 20 | -------------------------------------------------------------------------------- /roles/install_netdata_agent/templates/netdata.conf.j2: -------------------------------------------------------------------------------- 1 | [global] 2 | run as user = {{agent_user}} 3 | 4 | # the default database size - 1 hour 5 | history = {{agent_history}} 6 | 7 | # some defaults to run netdata with least priority 8 | process scheduling policy = {{agent_policy}} 9 | OOM score = {{oom_score}} 10 | 11 | [web] 12 | web files owner = {{owner}} 13 | web files group = {{group}} 14 | 15 | # by default do not expose the netdata port 16 | bind to = {{bind_to}} 17 | -------------------------------------------------------------------------------- /roles/purge_netdata_agent/tasks/OracleLinux8.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: Remove Netdata packages 4 | ansible.builtin.dnf: 5 | state: absent 6 | name: 7 | - "{{ netdata_repo_package }}" 8 | - "{{ netdata_agent_package }}" 9 | 10 | - name: Remove the remains 11 | ansible.builtin.file: 12 | path: "{{ item }}" 13 | state: absent 14 | with_items: 15 | - /etc/netdata 16 | - /var/log/netdata 17 | - /var/lib/netdata 18 | - /var/cache/netdata 19 | - /usr/libexec/netdata 20 | -------------------------------------------------------------------------------- /roles/purge_netdata_repository/tasks/Rocky8.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: Remove Netdata packages 4 | ansible.builtin.dnf: 5 | state: absent 6 | name: 7 | - netdata 8 | - netdata-repo 9 | - netdata-repo-edge 10 | notify: dnf-clean-metadata 11 | 12 | - name: Remove the remains 13 | ansible.builtin.file: 14 | path: "{{ item }}" 15 | state: absent 16 | with_items: 17 | - /var/log/netdata 18 | - /var/lib/netdata 19 | - /var/cache/netdata 20 | - /usr/libexec/netdata 21 | -------------------------------------------------------------------------------- /roles/purge_netdata_repository/tasks/Fedora35.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: Remove Netdata packages 4 | ansible.builtin.dnf: 5 | state: absent 6 | name: 7 | - netdata 8 | - netdata-repo 9 | - netdata-repo-edge 10 | notify: dnf-clean-metadata 11 | 12 | - name: Remove the remains 13 | ansible.builtin.file: 14 | path: "{{ item }}" 15 | state: absent 16 | with_items: 17 | - /var/log/netdata 18 | - /var/lib/netdata 19 | - /var/cache/netdata 20 | - /usr/libexec/netdata 21 | -------------------------------------------------------------------------------- /roles/purge_netdata_repository/tasks/OracleLinux8.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: Remove Netdata packages 4 | ansible.builtin.dnf: 5 | state: absent 6 | name: 7 | - "{{ netdata_repo_package }}" 8 | - "{{ netdata_agent_package }}" 9 | notify: dnf-clean-metadata 10 | 11 | - name: Remove the remains 12 | ansible.builtin.file: 13 | path: "{{ item }}" 14 | state: absent 15 | with_items: 16 | - /var/log/netdata 17 | - /var/lib/netdata 18 | - /var/cache/netdata 19 | - /usr/libexec/netdata 20 | -------------------------------------------------------------------------------- /roles/install_netdata_agent/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # tasks file for roles/install_netdata_agent 3 | 4 | - name: Include architecture specific vars 5 | ansible.builtin.include_vars: "{{ ansible_architecture | lower }}.yml" 6 | 7 | - name: Include OS specific vars 8 | ansible.builtin.include_vars: "{{ ansible_distribution | lower }}{{ ansible_distribution_major_version }}.yml" 9 | 10 | - name: Include OS specific tasks 11 | ansible.builtin.include_tasks: "{{ ansible_distribution | lower }}{{ ansible_distribution_major_version }}.yml" 12 | -------------------------------------------------------------------------------- /roles/install_netdata_repository/tasks/Debian10.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: Install some essential packages 4 | ansible.builtin.apt: 5 | name: "{{ item }}" 6 | update_cache: true 7 | loop: 8 | - gpg 9 | - debian-archive-keyring 10 | - apt-transport-https 11 | 12 | - name: Install Netdata repo key 13 | ansible.builtin.apt_key: 14 | url: https://packagecloud.io/netdata/netdata-repoconfig/gpgkey 15 | state: present 16 | 17 | - name: Install netdata repo 18 | ansible.builtin.apt: 19 | deb: "{{ repo_uri }}" 20 | -------------------------------------------------------------------------------- /roles/install_netdata_agent/tasks/Debian11.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install uuid-runtime 3 | ansible.builtin.package: 4 | name: uuid-runtime 5 | state: present 6 | 7 | - name: Install the netdata agent package 8 | ansible.builtin.apt: 9 | name: netdata 10 | update_cache: true 11 | state: latest 12 | # default_release: 13 | 14 | - name: Start service "{{ netdata_agent_service }}" 15 | ansible.builtin.systemd: 16 | name: "{{ netdata_agent_service }}" 17 | state: started 18 | enabled: true 19 | masked: false 20 | -------------------------------------------------------------------------------- /roles/install_netdata_agent/tasks/debian12.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install uuid-runtime 3 | ansible.builtin.package: 4 | name: uuid-runtime 5 | state: present 6 | 7 | - name: Install the netdata agent package 8 | ansible.builtin.apt: 9 | name: netdata 10 | update_cache: true 11 | state: latest 12 | # default_release: 13 | 14 | - name: Start service "{{ netdata_agent_service }}" 15 | ansible.builtin.systemd: 16 | name: "{{ netdata_agent_service }}" 17 | state: started 18 | enabled: true 19 | masked: false 20 | -------------------------------------------------------------------------------- /roles/install_netdata_repository/tasks/Ubuntu18.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: Install some essential packages 4 | ansible.builtin.apt: 5 | name: "{{ item }}" 6 | update_cache: true 7 | loop: 8 | - gpg 9 | - debian-archive-keyring 10 | - apt-transport-https 11 | 12 | - name: Install Netdata repo key. 13 | ansible.builtin.apt_key: 14 | url: https://packagecloud.io/netdata/netdata/gpgkey 15 | state: present 16 | 17 | - name: Install Netdata repository package 18 | ansible.builtin.apt: 19 | deb: "{{ repo_uri }}" 20 | -------------------------------------------------------------------------------- /roles/install_netdata_agent/tasks/Debian10.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: Install uuid-runtime 4 | ansible.builtin.package: 5 | name: uuid-runtime 6 | state: present 7 | 8 | - name: Install the netdata agent package 9 | ansible.builtin.apt: 10 | name: netdata 11 | update_cache: true 12 | state: latest 13 | # default_release: 14 | 15 | - name: Start service "{{ netdata_agent_service }}" 16 | ansible.builtin.systemd: 17 | name: "{{ netdata_agent_service }}" 18 | state: started 19 | enabled: true 20 | masked: false 21 | -------------------------------------------------------------------------------- /molecule/common/Dockerfile_ubuntu1804.j2: -------------------------------------------------------------------------------- 1 | FROM {{ item.image | lower }} 2 | 3 | ARG DEBIAN_FRONTEND=noninteractive 4 | 5 | RUN apt-get update && apt-get install -y --no-install-recommends \ 6 | apt-utils \ 7 | curl \ 8 | debian-archive-keyring \ 9 | gpg-agent \ 10 | gnupg \ 11 | nano \ 12 | python3 \ 13 | software-properties-common \ 14 | && apt-get clean \ 15 | && rm -Rf /var/lib/apt/lists/* \ 16 | && rm -Rf /usr/share/doc \ 17 | && rm -Rf /usr/share/man 18 | -------------------------------------------------------------------------------- /molecule/common/Dockerfile_ubuntu2004.j2: -------------------------------------------------------------------------------- 1 | FROM {{ item.image | lower }} 2 | 3 | ARG DEBIAN_FRONTEND=noninteractive 4 | 5 | RUN apt-get update && apt-get install -y --no-install-recommends \ 6 | apt-utils \ 7 | curl \ 8 | debian-archive-keyring \ 9 | gpg-agent \ 10 | gnupg \ 11 | nano \ 12 | python3 \ 13 | software-properties-common \ 14 | && apt-get clean \ 15 | && rm -Rf /var/lib/apt/lists/* \ 16 | && rm -Rf /usr/share/doc \ 17 | && rm -Rf /usr/share/man 18 | -------------------------------------------------------------------------------- /roles/purge_netdata_repository/tasks/Ubuntu18.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: Remove Netdata repo key. 4 | ansible.builtin.apt_key: 5 | url: https://packagecloud.io/netdata/netdata-repoconfig/gpgkey 6 | state: absent 7 | 8 | - name: Remove Netdata packages 9 | ansible.builtin.apt: 10 | state: absent 11 | purge: true 12 | name: 13 | - netdata 14 | - netdata-repo-edge 15 | 16 | - name: Remove the remains 17 | ansible.builtin.file: 18 | path: "{{ item }}" 19 | state: absent 20 | with_items: 21 | - /var/log/netdata 22 | - /var/lib/netdata 23 | - /var/cache/netdata 24 | - /usr/libexec/netdata 25 | -------------------------------------------------------------------------------- /roles/purge_netdata_repository/tasks/Ubuntu20.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: Remove Netdata repo key. 4 | ansible.builtin.apt_key: 5 | url: https://packagecloud.io/netdata/netdata-repoconfig/gpgkey 6 | state: absent 7 | 8 | - name: Remove Netdata packages 9 | ansible.builtin.apt: 10 | state: absent 11 | purge: true 12 | name: 13 | - netdata 14 | - netdata-repo-edge 15 | 16 | - name: Remove the remains 17 | ansible.builtin.file: 18 | path: "{{ item }}" 19 | state: absent 20 | with_items: 21 | - /var/log/netdata 22 | - /var/lib/netdata 23 | - /var/cache/netdata 24 | - /usr/libexec/netdata 25 | -------------------------------------------------------------------------------- /roles/purge_netdata_repository/tasks/Ubuntu22.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: Remove Netdata repo key. 4 | ansible.builtin.apt_key: 5 | url: https://packagecloud.io/netdata/netdata-repoconfig/gpgkey 6 | state: absent 7 | 8 | - name: Remove Netdata packages 9 | ansible.builtin.apt: 10 | state: absent 11 | purge: true 12 | name: 13 | - netdata 14 | - netdata-repo-edge 15 | 16 | - name: Remove the remains 17 | ansible.builtin.file: 18 | path: "{{ item }}" 19 | state: absent 20 | with_items: 21 | - /var/log/netdata 22 | - /var/lib/netdata 23 | - /var/cache/netdata 24 | - /usr/libexec/netdata 25 | -------------------------------------------------------------------------------- /molecule/common/Dockerfile_ubuntu2204.j2: -------------------------------------------------------------------------------- 1 | FROM {{ item.image | lower }} 2 | 3 | ARG DEBIAN_FRONTEND=noninteractive 4 | 5 | 6 | RUN apt-get update && apt-get install -y --no-install-recommends \ 7 | apt-utils \ 8 | curl \ 9 | debian-archive-keyring \ 10 | gpg-agent \ 11 | gnupg \ 12 | nano \ 13 | python3 \ 14 | software-properties-common \ 15 | && apt-get clean \ 16 | && rm -Rf /var/lib/apt/lists/* \ 17 | && rm -Rf /usr/share/doc \ 18 | && rm -Rf /usr/share/man 19 | -------------------------------------------------------------------------------- /roles/purge_netdata_repository/tasks/Debian10.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: Remove Netdata repo key. 4 | ansible.builtin.apt_key: 5 | url: https://packagecloud.io/netdata/netdata-repoconfig/gpgkey 6 | state: absent 7 | 8 | - name: Remove Netdata packages 9 | ansible.builtin.apt: 10 | state: absent 11 | purge: true 12 | name: 13 | - netdata 14 | - netdata-repo 15 | - netdata-repo-edge 16 | 17 | - name: Remove the remains 18 | ansible.builtin.file: 19 | path: "{{ item }}" 20 | state: absent 21 | with_items: 22 | - /var/log/netdata 23 | - /var/lib/netdata 24 | - /var/cache/netdata 25 | - /usr/libexec/netdata 26 | -------------------------------------------------------------------------------- /roles/purge_netdata_repository/tasks/Debian11.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: Remove Netdata repo key. 4 | ansible.builtin.apt_key: 5 | url: https://packagecloud.io/netdata/netdata-repoconfig/gpgkey 6 | state: absent 7 | 8 | - name: Remove Netdata packages 9 | ansible.builtin.apt: 10 | state: absent 11 | purge: true 12 | name: 13 | - netdata 14 | - netdata-repo 15 | - netdata-repo-edge 16 | 17 | - name: Remove the remains 18 | ansible.builtin.file: 19 | path: "{{ item }}" 20 | state: absent 21 | with_items: 22 | - /var/log/netdata 23 | - /var/lib/netdata 24 | - /var/cache/netdata 25 | - /usr/libexec/netdata 26 | -------------------------------------------------------------------------------- /roles/purge_netdata_repository/tasks/debian12.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: Remove Netdata repo key. 4 | ansible.builtin.apt_key: 5 | url: https://packagecloud.io/netdata/netdata-repoconfig/gpgkey 6 | state: absent 7 | 8 | - name: Remove Netdata packages 9 | ansible.builtin.apt: 10 | state: absent 11 | purge: true 12 | name: 13 | - netdata 14 | - netdata-repo 15 | - netdata-repo-edge 16 | 17 | - name: Remove the remains 18 | ansible.builtin.file: 19 | path: "{{ item }}" 20 | state: absent 21 | with_items: 22 | - /var/log/netdata 23 | - /var/lib/netdata 24 | - /var/cache/netdata 25 | - /usr/libexec/netdata 26 | -------------------------------------------------------------------------------- /roles/purge_netdata_agent/.travis.yml: -------------------------------------------------------------------------------- 1 | --- 2 | language: python 3 | python: "2.7" 4 | 5 | # Use the new container infrastructure 6 | sudo: false 7 | 8 | # Install ansible 9 | addons: 10 | apt: 11 | packages: 12 | - python-pip 13 | 14 | install: 15 | # Install ansible 16 | - pip install ansible 17 | 18 | # Check ansible version 19 | - ansible --version 20 | 21 | # Create ansible.cfg with correct roles_path 22 | - printf '[defaults]\nroles_path=../' >ansible.cfg 23 | 24 | script: 25 | # Basic role syntax check 26 | - ansible-playbook tests/test.yml -i tests/inventory --syntax-check 27 | 28 | notifications: 29 | webhooks: https://galaxy.ansible.com/api/v1/notifications/ 30 | -------------------------------------------------------------------------------- /roles/purge_netdata_repository/.travis.yml: -------------------------------------------------------------------------------- 1 | --- 2 | language: python 3 | python: "2.7" 4 | 5 | # Use the new container infrastructure 6 | sudo: false 7 | 8 | # Install ansible 9 | addons: 10 | apt: 11 | packages: 12 | - python-pip 13 | 14 | install: 15 | # Install ansible 16 | - pip install ansible 17 | 18 | # Check ansible version 19 | - ansible --version 20 | 21 | # Create ansible.cfg with correct roles_path 22 | - printf '[defaults]\nroles_path=../' >ansible.cfg 23 | 24 | script: 25 | # Basic role syntax check 26 | - ansible-playbook tests/test.yml -i tests/inventory --syntax-check 27 | 28 | notifications: 29 | webhooks: https://galaxy.ansible.com/api/v1/notifications/ 30 | -------------------------------------------------------------------------------- /roles/install_netdata_agent/tasks/Fedora35.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: Install Netdata agent package 4 | ansible.builtin.package: 5 | name: "{{ netdata_agent_package }}" 6 | state: latest 7 | update_cache: true 8 | disable_gpg_check: true 9 | # disablerepo: "epel" # Not needed for Fedora 10 | 11 | 12 | - name: Writing configuration to /etc/netdata/netdata.conf 13 | ansible.builtin.template: 14 | src: netdata.conf.j2 15 | dest: /etc/netdata/netdata.conf 16 | owner: root 17 | group: root 18 | mode: '0644' 19 | notify: restart netdata agent 20 | 21 | - name: Start service "{{ netdata_agent_service }}" 22 | ansible.builtin.systemd: 23 | name: "{{ netdata_agent_service }}" 24 | state: started 25 | enabled: true 26 | -------------------------------------------------------------------------------- /roles/install_netdata_repository/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # defaults file for roles/netdata-repository 3 | repository_version: 1.1 4 | 5 | # Packagecloud repository PGP key 6 | pc_repo_key: https://packagecloud.io/netdata/netdata/gpgkey 7 | 8 | # distribution, stable or edge 9 | distro: stable 10 | 11 | # Debian 11 repo: 12 | debian11_repo: https://packagecloud.io/netdata/netdata/packages/debian/bullseye/netdata-repo_1-1_all.deb/download.deb 13 | # Centos 7 stable repo: 14 | centos7_stable_repo: https://packagecloud.io/netdata/netdata-repoconfig/packages/el/7/netdata-repo-1-1.noarch.rpm/download.rpm 15 | # Rocky Linux 8 stable repo: 16 | rocky8_stable_repo: https://packagecloud.io/netdata/netdata-repoconfig/packages/el/8/netdata-repo-1-1.noarch.rpm/download.rpm 17 | -------------------------------------------------------------------------------- /netdata-agent.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: Install Netdata agent 4 | hosts: all 5 | remote_user: "{{ansible_user}}" 6 | gather_facts: true 7 | become: true 8 | 9 | pre_tasks: 10 | 11 | - name: Add EPEL repository for Centos/Rocky 12 | ansible.builtin.package: 13 | name: epel-release 14 | state: latest 15 | # when: ansible_facts['os_family'] == 'RedHat' 16 | when: 17 | ansible_distribution in ['RedHat', 'CentOS', 'ScientificLinux'] and 18 | (ansible_distribution_version is version_compare('7', '<') or 19 | ansible_distribution_version is version_compare('8', '>=')) 20 | 21 | roles: 22 | - { role: install_netdata_repository, become: true } 23 | - { role: install_netdata_agent, become: true } 24 | -------------------------------------------------------------------------------- /roles/install_netdata_repository/tasks/CentOS7.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: Install Netdata stable repository configuration 4 | ansible.builtin.yum: 5 | name: https://packagecloud.io/netdata/netdata-repoconfig/packages/el/7/netdata-repo-1-1.noarch.rpm/download.rpm 6 | state: present 7 | when: distro == 'stable' 8 | 9 | - name: Import a stable repository PGP key from a url 10 | ansible.builtin.rpm_key: 11 | state: present 12 | key: https://packagecloud.io/netdata/netdata/gpgkey 13 | 14 | - name: Install Netdata nightly repository configuration 15 | ansible.builtin.yum: 16 | name: https://packagecloud.io/netdata/netdata-repoconfig/packages/el/7/netdata-repo-edge-1-1.noarch.rpm/download.rpm 17 | state: present 18 | when: distro == 'edge' 19 | 20 | - name: Import an edge repository PGP key from a url 21 | ansible.builtin.rpm_key: 22 | state: present 23 | key: https://packagecloud.io/netdata/netdata-edge/gpgkey 24 | -------------------------------------------------------------------------------- /roles/install_netdata_repository/tasks/Rocky8.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: Import a key from a url 4 | ansible.builtin.rpm_key: 5 | state: present 6 | key: https://packagecloud.io/netdata/netdata/gpgkey 7 | 8 | - name: Import a key from a url 9 | ansible.builtin.rpm_key: 10 | state: present 11 | key: https://packagecloud.io/netdata/netdata-edge/gpgkey 12 | 13 | - name: Install Netdata stable repository configuration 14 | ansible.builtin.dnf: 15 | name: https://packagecloud.io/netdata/netdata-repoconfig/packages/el/8/netdata-repo-1-1.noarch.rpm/download.rpm 16 | state: present 17 | disable_gpg_check: true 18 | when: distro == 'stable' 19 | 20 | - name: Install Netdata nightly repository configuration 21 | ansible.builtin.dnf: 22 | name: https://packagecloud.io/netdata/netdata-repoconfig/packages/el/8/netdata-repo-edge-1-1.noarch.rpm/download.rpm 23 | state: present 24 | disable_gpg_check: true 25 | when: distro == 'edge' 26 | -------------------------------------------------------------------------------- /roles/install_netdata_repository/tasks/OracleLinux8.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: Import a key from a url 4 | ansible.builtin.rpm_key: 5 | state: present 6 | key: https://packagecloud.io/netdata/netdata/gpgkey 7 | 8 | - name: Import a key from a url 9 | ansible.builtin.rpm_key: 10 | state: present 11 | key: https://packagecloud.io/netdata/netdata-edge/gpgkey 12 | 13 | - name: Install Netdata stable repository configuration 14 | ansible.builtin.dnf: 15 | name: https://packagecloud.io/netdata/netdata-repoconfig/packages/ol/8/netdata-repo-1-1.noarch.rpm/download.rpm 16 | state: present 17 | disable_gpg_check: true 18 | when: distro == 'stable' 19 | 20 | - name: Install Netdata nightly repository configuration 21 | ansible.builtin.dnf: 22 | name: https://packagecloud.io/netdata/netdata-repoconfig/packages/ol/8/netdata-repo-edge-1-1.noarch.rpm/download.rpm 23 | state: present 24 | disable_gpg_check: true 25 | when: distro == 'edge' 26 | -------------------------------------------------------------------------------- /roles/install_netdata_repository/tasks/Fedora35.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: Import a key from a url 4 | ansible.builtin.rpm_key: 5 | state: present 6 | key: https://packagecloud.io/netdata/netdata/gpgkey 7 | 8 | - name: Import a key from a url 9 | ansible.builtin.rpm_key: 10 | state: present 11 | key: https://packagecloud.io/netdata/netdata-edge/gpgkey 12 | 13 | - name: Install Netdata stable repository configuration 14 | ansible.builtin.dnf: 15 | name: https://packagecloud.io/netdata/netdata-repoconfig/packages/fedora/35/netdata-repo-1-1.noarch.rpm/download.rpm 16 | state: present 17 | disable_gpg_check: true 18 | when: distro == 'stable' 19 | 20 | - name: Install Netdata nightly repository configuration 21 | ansible.builtin.dnf: 22 | name: https://packagecloud.io/netdata/netdata-repoconfig/packages/fedora/35/netdata-repo-edge-1-1.noarch.rpm/download.rpm 23 | state: present 24 | disable_gpg_check: true 25 | when: distro == 'edge' 26 | -------------------------------------------------------------------------------- /roles/install_netdata_agent/tasks/Rocky8.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: Dependencies first 4 | ansible.builtin.dnf: 5 | name: "{{ item }}" 6 | state: present 7 | update_cache: true 8 | loop: 9 | - Judy 10 | - brotli 11 | - libuv 12 | - netcat 13 | - nodejs 14 | - openssl 15 | 16 | - name: Install the netdata agent package 17 | ansible.builtin.package: 18 | name: "{{ netdata_agent_package }}" 19 | state: latest 20 | update_cache: true 21 | disable_gpg_check: true 22 | disablerepo: "epel" 23 | 24 | - name: Writing configuration to /etc/netdata/netdata.conf 25 | ansible.builtin.template: 26 | src: netdata.conf.j2 27 | dest: /etc/netdata/netdata.conf 28 | owner: root 29 | group: root 30 | mode: '0644' 31 | notify: restart netdata agent 32 | 33 | - name: Start service "{{ netdata_agent_service }}" 34 | ansible.builtin.systemd: 35 | name: "{{ netdata_agent_service }}" 36 | state: started 37 | enabled: true 38 | -------------------------------------------------------------------------------- /roles/install_netdata_agent/tasks/OracleLinux8.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: Dependencies first 4 | ansible.builtin.dnf: 5 | name: "{{ item }}" 6 | state: present 7 | update_cache: true 8 | loop: 9 | - Judy 10 | - brotli 11 | - libuv 12 | - netcat 13 | - nodejs 14 | - openssl 15 | 16 | - name: Install the netdata agent package 17 | ansible.builtin.package: 18 | name: "{{ netdata_agent_package }}" 19 | state: latest 20 | update_cache: true 21 | disable_gpg_check: true 22 | disablerepo: "epel" 23 | 24 | 25 | - name: Writing configuration to /etc/netdata/netdata.conf 26 | ansible.builtin.template: 27 | src: netdata.conf.j2 28 | dest: /etc/netdata/netdata.conf 29 | owner: root 30 | group: root 31 | mode: '0644' 32 | notify: restart netdata agent 33 | 34 | - name: Start service "{{ netdata_agent_service }}" 35 | ansible.builtin.systemd: 36 | name: "{{ netdata_agent_service }}" 37 | state: started 38 | enabled: true 39 | -------------------------------------------------------------------------------- /roles/claim/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # tasks file for roles/claim 3 | 4 | - name: Get information about running agent 5 | ansible.builtin.command: netdatacli aclk-state json 6 | register: agent_info 7 | 8 | # - set_fact: 9 | # is_online: "{{ agent_info.stdout | from_json | json_query('online') }}" 10 | 11 | - name: Set fact for is_claimed 12 | ansible.builtin.set_fact: 13 | is_claimed: "{{ agent_info.stdout | from_json | json_query('\"agent-claimed\"') }}" 14 | 15 | - name: Claim the new node if is not claimed yet 16 | block: 17 | - name: Generate UUID 18 | ansible.builtin.command: uuidgen 19 | register: uuid 20 | 21 | - name: Set fact new_uuid 22 | ansible.builtin.set_fact: 23 | new_uuid: "{{ uuid.stdout }}" 24 | 25 | - name: Claim the node 26 | ansible.builtin.command: netdata-claim.sh -token="{{ claim_token }}" -rooms="{{ claim_rooms }}" -url="{{ claim_url }}" -id="{{ new_uuid }}" 27 | notify: restart netdata agent 28 | 29 | when: not is_claimed 30 | -------------------------------------------------------------------------------- /roles/install_netdata_agent/tasks/Centos7.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | # We have to install the dependencies from EPEL because we have to disable it when installing netdata agent. 4 | 5 | - name: Dependencies first 6 | ansible.builtin.yum: 7 | name: "{{ item }}" 8 | state: present 9 | update_cache: true 10 | loop: 11 | - Judy 12 | - brotli 13 | - libuv 14 | - netcat 15 | - nodejs 16 | - nodejs-libs 17 | - openssl11 18 | - yum-plugin-priorities 19 | 20 | # We disabled EPEL for netdata agent installation to exclude the possibility of installing EPEL package 21 | - name: Install netdata agent package 22 | ansible.builtin.package: 23 | name: "{{ netdata_agent_package }}" 24 | state: latest 25 | update_cache: true 26 | disable_gpg_check: true 27 | disablerepo: "epel" 28 | 29 | - name: Writing configuration to /etc/netdata/netdata.conf 30 | ansible.builtin.template: 31 | src: netdata.conf.j2 32 | dest: /etc/netdata/netdata.conf 33 | owner: root 34 | group: root 35 | mode: '0644' 36 | notify: restart netdata agent 37 | 38 | - name: Start service "{{ netdata_agent_service }}" 39 | ansible.builtin.systemd: 40 | name: "{{ netdata_agent_service }}" 41 | state: started 42 | enabled: true 43 | -------------------------------------------------------------------------------- /molecule/default/molecule.yml: -------------------------------------------------------------------------------- 1 | --- 2 | dependency: 3 | name: galaxy 4 | 5 | driver: 6 | name: docker 7 | 8 | platforms: 9 | 10 | - name: centos7 11 | image: quay.io/centos/centos:7 12 | pre_build_image: true 13 | 14 | - name: Debian10 15 | image: debian:10 16 | pre_build_image: false 17 | dockerfile: ../common/Dockerfile_debian10.j2 18 | 19 | - name: debian11 20 | image: debian:11 21 | pre_build_image: false 22 | dockerfile: ../common/Dockerfile_debian11.j2 23 | 24 | - name: fedora35 25 | image: fedora:35 26 | pre_build_image: true 27 | 28 | - name: oraclelinux8 29 | image: oraclelinux:8 30 | pre_build_image: true 31 | 32 | - name: rockylinux8 33 | image: rockylinux:8 34 | pre_build_image: true 35 | 36 | - name: ubuntu1804 37 | image: ubuntu:18.04 38 | dockerfile: ../common/Dockerfile_ubuntu1804.j2 39 | entrypoint: "/usr/bin/bash" 40 | pre_build_image: false 41 | 42 | - name: ubuntu2004 43 | image: ubuntu:20.04 44 | dockerfile: ../common/Dockerfile_ubuntu2004.j2 45 | entrypoint: "/usr/bin/bash" 46 | pre_build_image: false 47 | 48 | - name: ubuntu2204 49 | image: ubuntu:22.04 50 | dockerfile: ../common/Dockerfile_ubuntu2204.j2 51 | entrypoint: "/usr/bin/bash" 52 | pre_build_image: false 53 | 54 | 55 | provisioner: 56 | name: ansible 57 | env: 58 | MOLECULE_NO_LOG: false 59 | 60 | verifier: 61 | name: ansible 62 | -------------------------------------------------------------------------------- /roles/claim/meta/main.yml: -------------------------------------------------------------------------------- 1 | galaxy_info: 2 | author: Netdata packaging team 3 | description: real-time charts for system monitoring (https://netdata.cloud/) 4 | company: Netdata Inc. 5 | 6 | license: GPL-3.0-or-later 7 | 8 | min_ansible_version: "2.1" 9 | 10 | # If this a Container Enabled role, provide the minimum Ansible Container version. 11 | # min_ansible_container_version: 12 | 13 | # 14 | # Provide a list of supported platforms, and for each platform a list of versions. 15 | # If you don't wish to enumerate all versions for a particular platform, use 'all'. 16 | # To view available platforms and versions (or releases), visit: 17 | # https://galaxy.ansible.com/api/v1/platforms/ 18 | # 19 | # platforms: 20 | # - name: Fedora 21 | # versions: 22 | # - all 23 | # - 25 24 | # - name: SomePlatform 25 | # versions: 26 | # - all 27 | # - 1.0 28 | # - 7 29 | # - 99.99 30 | 31 | galaxy_tags: [] 32 | # List tags for your role here, one per line. A tag is a keyword that describes 33 | # and categorizes the role. Users find roles by searching for tags. Be sure to 34 | # remove the '[]' above, if you add tags to this list. 35 | # 36 | # NOTE: A tag is limited to a single word comprised of alphanumeric characters. 37 | # Maximum 20 tags per role. 38 | 39 | dependencies: [] 40 | # List your role dependencies here, one per line. Be sure to remove the '[]' above, 41 | # if you add dependencies to this list. 42 | -------------------------------------------------------------------------------- /roles/claim/README.md: -------------------------------------------------------------------------------- 1 | Role Name 2 | ========= 3 | 4 | A brief description of the role goes here. 5 | 6 | Requirements 7 | ------------ 8 | 9 | Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required. 10 | 11 | Role Variables 12 | -------------- 13 | 14 | A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well. 15 | 16 | Dependencies 17 | ------------ 18 | 19 | A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles. 20 | 21 | Example Playbook 22 | ---------------- 23 | 24 | Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: 25 | 26 | - hosts: servers 27 | roles: 28 | - { role: username.rolename, x: 42 } 29 | 30 | License 31 | ------- 32 | 33 | BSD 34 | 35 | Author Information 36 | ------------------ 37 | 38 | An optional section for the role authors to include contact information, or a website (HTML is not allowed). 39 | -------------------------------------------------------------------------------- /roles/install_netdata_agent/meta/main.yml: -------------------------------------------------------------------------------- 1 | galaxy_info: 2 | author: Netdata packaging team 3 | description: real-time charts for system monitoring (https://netdata.cloud/) 4 | company: Netdata Inc. 5 | 6 | license: GPL-3.0-or-later 7 | 8 | min_ansible_version: "2.1" 9 | 10 | # If this a Container Enabled role, provide the minimum Ansible Container version. 11 | # min_ansible_container_version: 12 | 13 | # 14 | # Provide a list of supported platforms, and for each platform a list of versions. 15 | # If you don't wish to enumerate all versions for a particular platform, use 'all'. 16 | # To view available platforms and versions (or releases), visit: 17 | # https://galaxy.ansible.com/api/v1/platforms/ 18 | # 19 | # platforms: 20 | # - name: Fedora 21 | # versions: 22 | # - all 23 | # - 25 24 | # - name: SomePlatform 25 | # versions: 26 | # - all 27 | # - 1.0 28 | # - 7 29 | # - 99.99 30 | 31 | galaxy_tags: [] 32 | # List tags for your role here, one per line. A tag is a keyword that describes 33 | # and categorizes the role. Users find roles by searching for tags. Be sure to 34 | # remove the '[]' above, if you add tags to this list. 35 | # 36 | # NOTE: A tag is limited to a single word comprised of alphanumeric characters. 37 | # Maximum 20 tags per role. 38 | 39 | dependencies: [] 40 | # List your role dependencies here, one per line. Be sure to remove the '[]' above, 41 | # if you add dependencies to this list. 42 | -------------------------------------------------------------------------------- /roles/purge_netdata_agent/meta/main.yml: -------------------------------------------------------------------------------- 1 | galaxy_info: 2 | author: Netdata packaging team 3 | description: real-time charts for system monitoring (https://netdata.cloud/) 4 | company: Netdata Inc. 5 | 6 | license: GPL-3.0-or-later 7 | 8 | min_ansible_version: "2.1" 9 | 10 | # If this a Container Enabled role, provide the minimum Ansible Container version. 11 | # min_ansible_container_version: 12 | 13 | # 14 | # Provide a list of supported platforms, and for each platform a list of versions. 15 | # If you don't wish to enumerate all versions for a particular platform, use 'all'. 16 | # To view available platforms and versions (or releases), visit: 17 | # https://galaxy.ansible.com/api/v1/platforms/ 18 | # 19 | # platforms: 20 | # - name: Fedora 21 | # versions: 22 | # - all 23 | # - 25 24 | # - name: SomePlatform 25 | # versions: 26 | # - all 27 | # - 1.0 28 | # - 7 29 | # - 99.99 30 | 31 | galaxy_tags: [] 32 | # List tags for your role here, one per line. A tag is a keyword that describes 33 | # and categorizes the role. Users find roles by searching for tags. Be sure to 34 | # remove the '[]' above, if you add tags to this list. 35 | # 36 | # NOTE: A tag is limited to a single word comprised of alphanumeric characters. 37 | # Maximum 20 tags per role. 38 | 39 | dependencies: [] 40 | # List your role dependencies here, one per line. Be sure to remove the '[]' above, 41 | # if you add dependencies to this list. 42 | -------------------------------------------------------------------------------- /roles/install_netdata_agent/README.md: -------------------------------------------------------------------------------- 1 | Role Name 2 | ========= 3 | 4 | A brief description of the role goes here. 5 | 6 | Requirements 7 | ------------ 8 | 9 | Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required. 10 | 11 | Role Variables 12 | -------------- 13 | 14 | A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well. 15 | 16 | Dependencies 17 | ------------ 18 | 19 | A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles. 20 | 21 | Example Playbook 22 | ---------------- 23 | 24 | Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: 25 | 26 | - hosts: servers 27 | roles: 28 | - { role: username.rolename, x: 42 } 29 | 30 | License 31 | ------- 32 | 33 | BSD 34 | 35 | Author Information 36 | ------------------ 37 | 38 | An optional section for the role authors to include contact information, or a website (HTML is not allowed). 39 | -------------------------------------------------------------------------------- /roles/purge_netdata_agent/README.md: -------------------------------------------------------------------------------- 1 | Role Name 2 | ========= 3 | 4 | A brief description of the role goes here. 5 | 6 | Requirements 7 | ------------ 8 | 9 | Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required. 10 | 11 | Role Variables 12 | -------------- 13 | 14 | A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well. 15 | 16 | Dependencies 17 | ------------ 18 | 19 | A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles. 20 | 21 | Example Playbook 22 | ---------------- 23 | 24 | Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: 25 | 26 | - hosts: servers 27 | roles: 28 | - { role: username.rolename, x: 42 } 29 | 30 | License 31 | ------- 32 | 33 | BSD 34 | 35 | Author Information 36 | ------------------ 37 | 38 | An optional section for the role authors to include contact information, or a website (HTML is not allowed). 39 | -------------------------------------------------------------------------------- /roles/purge_netdata_repository/meta/main.yml: -------------------------------------------------------------------------------- 1 | galaxy_info: 2 | author: Netdata packaging team 3 | description: real-time charts for system monitoring (https://netdata.cloud/) 4 | company: Netdata Inc. 5 | 6 | license: GPL-3.0-or-later 7 | 8 | min_ansible_version: "2.1" 9 | 10 | # If this a Container Enabled role, provide the minimum Ansible Container version. 11 | # min_ansible_container_version: 12 | 13 | # 14 | # Provide a list of supported platforms, and for each platform a list of versions. 15 | # If you don't wish to enumerate all versions for a particular platform, use 'all'. 16 | # To view available platforms and versions (or releases), visit: 17 | # https://galaxy.ansible.com/api/v1/platforms/ 18 | # 19 | # platforms: 20 | # - name: Fedora 21 | # versions: 22 | # - all 23 | # - 25 24 | # - name: SomePlatform 25 | # versions: 26 | # - all 27 | # - 1.0 28 | # - 7 29 | # - 99.99 30 | 31 | galaxy_tags: [] 32 | # List tags for your role here, one per line. A tag is a keyword that describes 33 | # and categorizes the role. Users find roles by searching for tags. Be sure to 34 | # remove the '[]' above, if you add tags to this list. 35 | # 36 | # NOTE: A tag is limited to a single word comprised of alphanumeric characters. 37 | # Maximum 20 tags per role. 38 | 39 | dependencies: [] 40 | # List your role dependencies here, one per line. Be sure to remove the '[]' above, 41 | # if you add dependencies to this list. 42 | -------------------------------------------------------------------------------- /roles/install_netdata_repository/README.md: -------------------------------------------------------------------------------- 1 | Role Name 2 | ========= 3 | 4 | A brief description of the role goes here. 5 | 6 | Requirements 7 | ------------ 8 | 9 | Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required. 10 | 11 | Role Variables 12 | -------------- 13 | 14 | A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well. 15 | 16 | Dependencies 17 | ------------ 18 | 19 | A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles. 20 | 21 | Example Playbook 22 | ---------------- 23 | 24 | Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: 25 | 26 | - hosts: servers 27 | roles: 28 | - { role: username.rolename, x: 42 } 29 | 30 | License 31 | ------- 32 | 33 | BSD 34 | 35 | Author Information 36 | ------------------ 37 | 38 | An optional section for the role authors to include contact information, or a website (HTML is not allowed). 39 | -------------------------------------------------------------------------------- /roles/purge_netdata_repository/README.md: -------------------------------------------------------------------------------- 1 | Role Name 2 | ========= 3 | 4 | A brief description of the role goes here. 5 | 6 | Requirements 7 | ------------ 8 | 9 | Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required. 10 | 11 | Role Variables 12 | -------------- 13 | 14 | A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well. 15 | 16 | Dependencies 17 | ------------ 18 | 19 | A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles. 20 | 21 | Example Playbook 22 | ---------------- 23 | 24 | Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: 25 | 26 | - hosts: servers 27 | roles: 28 | - { role: username.rolename, x: 42 } 29 | 30 | License 31 | ------- 32 | 33 | BSD 34 | 35 | Author Information 36 | ------------------ 37 | 38 | An optional section for the role authors to include contact information, or a website (HTML is not allowed). 39 | -------------------------------------------------------------------------------- /roles/install_netdata_repository/meta/main.yml: -------------------------------------------------------------------------------- 1 | galaxy_info: 2 | author: Netdata packaging team 3 | description: real-time charts for system monitoring (https://netdata.cloud/) 4 | company: Netdata Inc. 5 | role_name: install_netdata_repository 6 | namespace: netdata 7 | 8 | license: GPL-3.0-or-later 9 | 10 | min_ansible_version: "2.1" 11 | 12 | # If this a Container Enabled role, provide the minimum Ansible Container version. 13 | # min_ansible_container_version: 14 | 15 | # 16 | # Provide a list of supported platforms, and for each platform a list of versions. 17 | # If you don't wish to enumerate all versions for a particular platform, use 'all'. 18 | # To view available platforms and versions (or releases), visit: 19 | # https://galaxy.ansible.com/api/v1/platforms/ 20 | # 21 | # platforms: 22 | # - name: Fedora 23 | # versions: 24 | # - all 25 | # - 25 26 | # - name: SomePlatform 27 | # versions: 28 | # - all 29 | # - 1.0 30 | # - 7 31 | # - 99.99 32 | 33 | galaxy_tags: [] 34 | # List tags for your role here, one per line. A tag is a keyword that describes 35 | # and categorizes the role. Users find roles by searching for tags. Be sure to 36 | # remove the '[]' above, if you add tags to this list. 37 | # 38 | # NOTE: A tag is limited to a single word comprised of alphanumeric characters. 39 | # Maximum 20 tags per role. 40 | 41 | dependencies: [] 42 | # List your role dependencies here, one per line. Be sure to remove the '[]' above, 43 | # if you add dependencies to this list. 44 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Example of basic Netdata agent management using Ansible 2 | 3 | ## Prerequisites 4 | 5 | Tested with Ansible v. 2.12.1; should work with any Ansible version since 2.9 6 | 7 | You have to edit the inventory file `hosts` and, perhaps, `ansible.cfg`. 8 | It is likely that you will also want to edit netdata agent configuration file(s). 9 | 10 | Requires jmespath installed on the host system 11 | 12 | ## Tested on 13 | 14 | `Centos 7, Rocky 8, Oracle Linux 8, Fedora 35` 15 | 16 | `Debian 10, Debian 11, Ubuntu 18, Ubuntu 20, Ubuntu22` 17 | 18 | ## Playbook components, a short description 19 | 20 | > netdata-agent.yml: 21 | 22 | Installs Netdata Packagecloud repository whenever possible. 23 | Installs Netdata agent latest available version, trying to avoid installation from other repositories. By default, the 'edge' is used. You can change the default in group_vars/all or set it in the command line using external variable: 24 | 25 | `ansible-playbook -e "distro=stable" netdata-agent.yml` 26 | 27 | Or you can set in on per host basis, using inventory file or hosts_var/hostname. 28 | 29 | > purge.yml: 30 | 31 | Removes both installed repository and the package, making efforts to remove all possible remains like the log or configuration files. 32 | 33 | > claim.yml: 34 | 35 | Claims the agent against Netdata Cloud 36 | 37 | ## Parameters 38 | 39 | Playbooks behavior is parameterized to some extent. You may add or change the global settings in `group_vars/all` file or on per host basis in corresponding files in `host_vars/` 40 | You might also want to set some parameters in inventory file, of course. Or directly in the command line. Examples: 41 | 42 | `ansible-playbook --limit=debian10,ubuntu20 netdata-agent.yml` 43 | 44 | `ansible-playbook -u toor --limit=rocky8 -e "distro=edge" purge.yml` 45 | 46 | *Warning.* 47 | 48 | You cannot just switch from stable to edge repos (nor visa versa). You have to purge existing installation first. 49 | 50 | ## To do 51 | 52 | - The only agent configuration file used for the time being is `netdata.conf`. Perhaps, other configuration files handling should be added. 53 | -------------------------------------------------------------------------------- /molecule/README.md: -------------------------------------------------------------------------------- 1 | # RedHat Ansible Molecule test framework 2 | 3 | ## Summary 4 | 5 | This is a framework for the automated testing of Ansible roles against multiple platforms. 6 | 7 | If you just want to use Ansible to deploy netdata then you do not need to use this. Instead, use the Ansible roles in the parent directory of the repository. 8 | 9 | 10 | ## Prerequisites 11 | 12 | Requires: 13 | - Ansible 14 | - Docker 15 | - Molecule (see [Molecule documentation](https://ansible.readthedocs.io/projects/molecule/installation/) for full requirements) 16 | 17 | Tested with Ansible v2.15.1 and Docker v24.0.4. 18 | 19 | # Ansible roles tested 20 | 21 | - `install_netdata_repository` 22 | 23 | # Tested on 24 | `Centos 7, Rocky 8, Oracle Linux 8, Fedora 35` 25 | 26 | `Debian 10, Debian 11, Ubuntu 18, Ubuntu 20, Ubuntu22` 27 | 28 | ## Usage 29 | > molecule test 30 | 31 | Will do the following: 32 | 33 | - Creates virtual environments. (equivalent to running just: `molecule create`) 34 | - Runs Ansible Playbooks against environments. (equivalent to running just: `molecule converge`) 35 | - Destroys virtual environments. (equivalent to running just: `molecule destroy`) 36 | 37 | Run all Molecule commands from the root directory of the repository and not from the `molecule` folder or within the `Roles` folder.* 38 | 39 | If you are new to Molecule, or even if you have some new untested changes to test, it's strongly recommended to run only part of the test cycle by first invoking: 40 | > molecule create 41 | 42 | and then 43 | 44 | > molecule converge 45 | 46 | That way, if anything fails you can adjust your Ansible code and then simply re-run molecule converge. 47 | 48 | ## Molecule implementation structure 49 | 50 | The Molecule directory has the structure as follows: 51 | 52 | ```bash 53 | . 54 | ├── common 55 | │ ├── Dockerfile_debian10.j2 56 | │ ├── Dockerfile_debian11.j2 57 | │ ├── Dockerfile_ubuntu1804.j2 58 | │ ├── Dockerfile_ubuntu2004.j2 59 | │ └── Dockerfile_ubuntu2204.j2 60 | ├── default 61 | │ ├── converge.yml 62 | │ ├── molecule.yml 63 | │ └── verify.yml 64 | └── README.md 65 | 66 | ``` 67 | 68 | # Dockerfiles 69 | These are custom Dockerfiles which contain the required tools for deploying the Ansible roles you want to test. 70 | 71 | # Default > converge 72 | This file imports the Ansible roles that you wish to test. 73 | 74 | # Default > molecule 75 | This file contains a list of platforms/images to be tested against along with other settings such as which driver to use. 76 | 77 | 78 | # Notes 79 | 80 | 1. If you run Molecule from the wrong directory you will get an error such as: 81 | > CRITICAL 'molecule/default/molecule.yml' glob failed. Exiting. 82 | 2. Linting Molecule can be a little tricky and so it's recommended to exclude the `molecule` folder from your main Ansible linting. 83 | * You can add your Molecule specific lint-settings via the `molecule.yml` file's `verifier` section, etc. 84 | 3. It is expected that the custom Dockerfiles will be deprecated in the very near future in favour of images built to the same recipe but generated by the Netdata build-system and made available in Github, etc. 85 | 86 | 87 | 88 | ## To do 89 | 90 | Currently, this Molecule framework has only been fully tested against the role `install_netdata_repository`. 91 | 92 | Additonal roles will be tested in short-order. 93 | --------------------------------------------------------------------------------