diff --git a/.ansible-lint b/.ansible-lint deleted file mode 100644 index f9ff2ff..0000000 --- a/.ansible-lint +++ /dev/null @@ -1,6 +0,0 @@ ---- -# exclude_paths: -# - 'roles/*/tests' -parseable: true -skip_list: - - role-name[path] diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 48b00e2..4f00793 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,2 +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 diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml new file mode 100644 index 0000000..a14f057 --- /dev/null +++ b/.github/workflows/linting.yml @@ -0,0 +1,17 @@ +name: Linting + +on: + push: + pull_request: + + +jobs: + build: + name: Ansible Lint # Naming the build is important to use it as a status check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Run ansible-lint + uses: ansible/ansible-lint@main + with: + args: "--exclude tests/test.yml --skip-list=role-name" diff --git a/.github/workflows/linux-ci.yml b/.github/workflows/linux-ci.yml new file mode 100644 index 0000000..8ec5ee9 --- /dev/null +++ b/.github/workflows/linux-ci.yml @@ -0,0 +1,52 @@ +name: Integration Test + +on: + push: + pull_request: + +jobs: + + # Test installation against Debian Bookworm + debian-test-job: + runs-on: ubuntu-latest + container: + image: debian:bookworm + steps: + - name: Install dependencies + run: | + apt-get -y update; apt-get -y upgrade; apt-get -y install ansible + - name: Checkout code + uses: actions/checkout@v4 + - name: Test installation + run: | + ansible-playbook tests/test.yml + + # Test installation against OpenSUSE Leap 15 + opensuse-test-job: + runs-on: ubuntu-latest + container: + image: opensuse/leap:15 + steps: + - name: Install dependencies + run: | + zypper -n refresh; zypper -n update; zypper -n install ansible tar gzip + - name: Checkout code + uses: actions/checkout@v4 + - name: Test installation + run: | + ansible-playbook tests/test.yml + + # Test installation against Ubuntu 24.04 + ubuntu-test-job: + runs-on: ubuntu-latest + container: + image: ubuntu:24.04 + steps: + - name: Install dependencies + run: | + apt-get -y update; apt-get -y upgrade; apt-get -y install ansible + - name: Checkout code + uses: actions/checkout@v4 + - name: Test installation + run: | + ansible-playbook tests/test.yml diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..46364c1 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +.vscode +hosts +ansible.cfg +.swp diff --git a/README.md b/README.md index 0e75fbb..87a33cf 100644 --- a/README.md +++ b/README.md @@ -1,47 +1,42 @@ -# Example of basic Netdata agent management using Ansible -## Prerequisites -Tested with Ansible v. 2.12.1; should work with any Ansible version since 2.9 +# Netdata Ansible -You have to edit the inventory file `hosts` and, perhaps, `ansible.cfg`. -It is likely that you will also want to edit netdata agent configuration file(s). - -Requires jmespath installed on the host system ## Tested on -`Centos 7, Rocky 8, Oracle Linux 8, Fedora 35` - -`Debian 10, Debian 11, Ubuntu 18, Ubuntu 20, Ubuntu22` - -## Playbook components, a short description -> netdata-agent.yml: - -Installs Netdata Packagecloud repository whenever possible. -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: - -`ansible-playbook -e "distro=stable" netdata-agent.yml` - -Or you can set in on per host basis, using inventory file or hosts_var/hostname. - -> purge.yml: - -Removes both installed repository and the package, making efforts to remove all possible remains like the log or configuration files. - -> claim.yml: - -Claims the agent against Netdata Cloud - -## Parameters - -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/` -You might also want to set some parameters in inventory file, of course. Or directly in the command line. Examples: - -`ansible-playbook --limit=debian10,ubuntu20 netdata-agent.yml` - -`ansible-playbook -u toor --limit=rocky8 -e "distro=edge" purge.yml` - -*Warning.* - -You cannot just switch from stable to edge repos (nor visa versa). You have to purge existing installation first. - -## To do -- The only agent configuration file used for the time being is `netdata.conf`. Perhaps, other configuration files handling should be added. +- Debian 12 +- SUSE Linux Enterprise Server 15 + +## Utilization + +To install Netdata on a host, you can use the following playbook: + +```yaml +- hosts: all + roles: + - role: netdata +``` + +To install Netdata on a host and configure it to send metrics to a Netdata Cloud account, you can use the following playbook: + +```yaml +- hosts: all + roles: + - role: netdata + vars: + netdata_claim: true + netdata_claim_token: "YOUR_NETDATA_CLAIM_TOKEN" +``` + +To install Netdata on a host and enable custom configuration or charts, you can use the following playbook: + +```yaml +- hosts: all + roles: + - role: netdata + vars: + netdata_claim: true + netdata_claim_token: "YOUR_NETDATA_CLAIM_TOKEN" + netdata_manage_config: true + netdata_manage_charts: true + netdata_custom_config_path: "/path/to/custom/netdata.conf.j2" + netdata_custom_charts_path: "/path/to/custom/charts/" +``` diff --git a/ansible.cfg b/ansible.cfg deleted file mode 100644 index e31dbc4..0000000 --- a/ansible.cfg +++ /dev/null @@ -1,10 +0,0 @@ -[defaults] -inventory = ./hosts -gathering = smart -ansible_managed = Ansible managed: {file} modified on %Y-%m-%d %H:%M:%S by {uid} on {host} -display_skipped_hosts = False -fact_caching = yaml -fact_caching_timeout = 86400 -fact_caching_connection = /tmp/facts_cache -[ssh_connection] -ssh_args = -C -o ControlMaster=auto -o ControlPersist=60s diff --git a/claim.yml b/claim.yml deleted file mode 100644 index 2432356..0000000 --- a/claim.yml +++ /dev/null @@ -1,8 +0,0 @@ -- name: Claim netdata node - hosts: all - remote_user: "{{ansible_user}}" - gather_facts: true - become: true - - roles: - - role: claim diff --git a/defaults/main.yml b/defaults/main.yml new file mode 100644 index 0000000..d427f76 --- /dev/null +++ b/defaults/main.yml @@ -0,0 +1,43 @@ +--- +role_version: 1.0.0 + +# Define the Netdata release version we install +netdata_release_version: "stable" + +# Define if we manage the Netdata configuration +netdata_manage_config: false + +# Define if we install chart support +netdata_manage_charts: false + +# Define Netdata config file path +netdata_config_dir: "/etc/netdata" + +# Define the Netdata custom config directory +netdata_custom_config_path: "" + +# Define the Netdata chart directory +netdata_chart_dir: "/usr/libexec/netdata/charts.d" + +# Define the Netdata custom chart directory +netdata_custom_charts_path: "" + +# Allow for injecting a claim token if using Netdata Cloud +netdata_proxy: "" +netdata_claim: false +netdata_claim_url: "https://app.netdata.cloud" +netdata_claim_token: "" +netdata_claim_rooms: "" + +# Define the Netdata repository URLs and associated key files +netdata_repository_url: "http://repo.netdata.cloud/repos/" +netdata_repoconfig_url: "http://repo.netdata.cloud/repoconfig/" +netdata_repository_key_url: "https://repo.netdata.cloud/netdatabot.gpg.key" + +# Define config for enabled Go integrations +netdata_go_collector_plugins: [] + # - name: prometheus + # config: + # job: + # - name: local + # url: http://127.0.0.1:9090/metrics diff --git a/group_vars/all b/group_vars/all deleted file mode 100644 index 7a21451..0000000 --- a/group_vars/all +++ /dev/null @@ -1,5 +0,0 @@ -distro: edge -become: yes -claim_token: -claim_rooms: -claim_url: https://app.netdata.cloud diff --git a/handlers/main.yml b/handlers/main.yml new file mode 100644 index 0000000..9479aa5 --- /dev/null +++ b/handlers/main.yml @@ -0,0 +1,8 @@ +--- +- name: Restart Netdata + ansible.builtin.systemd: + name: netdata + state: restarted + daemon_reload: true + enabled: true + when: ansible_service_mgr == "systemd" diff --git a/host_vars/centos7 b/host_vars/centos7 deleted file mode 100644 index fc383c5..0000000 --- a/host_vars/centos7 +++ /dev/null @@ -1,2 +0,0 @@ ---- -oom_score: 1100 diff --git a/hosts b/hosts deleted file mode 100644 index cdcf45e..0000000 --- a/hosts +++ /dev/null @@ -1,26 +0,0 @@ ---- - -all: - hosts: - ubuntu18: - ansible_host: 192.168.10.120 - ubuntu20: - ansible_host: 192.168.10.7 - ubuntu22: - ansible_host: 192.168.10.118 - debian10: - ansible_host: 192.168.10.4 - debian11: - ansible_host: 192.168.10.5 - centos7: - ansible_host: 192.168.10.103 - rocky8: - ansible_host: 192.168.10.6 - alpine: - ansible_host: 192.168.10.8 - ol8: - ansible_host: 192.168.10.116 - fedora35: - ansible_host: 192.168.10.122 - vars: - ansible_user: ikarpov diff --git a/roles/purge_netdata_repository/meta/main.yml b/meta/main.yml similarity index 89% rename from roles/purge_netdata_repository/meta/main.yml rename to meta/main.yml index 2110721..ce82d51 100644 --- a/roles/purge_netdata_repository/meta/main.yml +++ b/meta/main.yml @@ -1,9 +1,10 @@ galaxy_info: - author: Netdata packaging team - description: real-time charts for system monitoring (https://netdata.cloud/) + author: Ralph Meijer + description: Deploys the NetData agent company: Netdata Inc. + role_name: netdata - license: GPL-3.0-or-later + license: Apache-2.0 min_ansible_version: "2.1" diff --git a/molecule/README.md b/molecule/README.md deleted file mode 100644 index 373b279..0000000 --- a/molecule/README.md +++ /dev/null @@ -1,92 +0,0 @@ -# RedHat Ansible Molecule test framework - -## Summary - -This is a framework for the automated testing of Ansible roles against multiple platforms. - -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. - - -## Prerequisites - -Requires: -- Ansible -- Docker -- Molecule (see [Molecule documentation](https://ansible.readthedocs.io/projects/molecule/installation/) for full requirements) - -Tested with Ansible v2.15.1 and Docker v24.0.4. - -# Ansible roles tested - -- `install_netdata_repository` - -# Tested on -`Centos 7, Rocky 8, Oracle Linux 8, Fedora 35` - -`Debian 10, Debian 11, Ubuntu 18, Ubuntu 20, Ubuntu22` - -## Usage -> molecule test - -Will do the following: - -- Creates virtual environments. (equivalent to running just: `molecule create`) -- Runs Ansible Playbooks against environments. (equivalent to running just: `molecule converge`) -- Destroys virtual environments. (equivalent to running just: `molecule destroy`) - -Run all Molecule commands from the root directory of the repository and not from the `molecule` folder or within the `Roles` folder.* - -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: -> molecule create - -and then - -> molecule converge - -That way, if anything fails you can adjust your Ansible code and then simply re-run molecule converge. - -## Molecule implementation structure - -The Molecule directory has the structure as follows: - -```bash -. -├── common -│ ├── Dockerfile_debian10.j2 -│ ├── Dockerfile_debian11.j2 -│ ├── Dockerfile_ubuntu1804.j2 -│ ├── Dockerfile_ubuntu2004.j2 -│ └── Dockerfile_ubuntu2204.j2 -├── default -│ ├── converge.yml -│ ├── molecule.yml -│ └── verify.yml -└── README.md - -``` - -# Dockerfiles -These are custom Dockerfiles which contain the required tools for deploying the Ansible roles you want to test. - -# Default > converge -This file imports the Ansible roles that you wish to test. - -# Default > molecule -This file contains a list of platforms/images to be tested against along with other settings such as which driver to use. - - -# Notes - -1. If you run Molecule from the wrong directory you will get an error such as: -> CRITICAL 'molecule/default/molecule.yml' glob failed. Exiting. -2. Linting Molecule can be a little tricky and so it's recommended to exclude the `molecule` folder from your main Ansible linting. - * You can add your Molecule specific lint-settings via the `molecule.yml` file's `verifier` section, etc. -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. - - - -## To do - -Currently, this Molecule framework has only been fully tested against the role `install_netdata_repository`. - -Additonal roles will be tested in short-order. diff --git a/molecule/common/Dockerfile_debian10.j2 b/molecule/common/Dockerfile_debian10.j2 deleted file mode 100644 index 69923bf..0000000 --- a/molecule/common/Dockerfile_debian10.j2 +++ /dev/null @@ -1,4 +0,0 @@ -FROM {{ item.image | lower }} - -RUN apt update && \ - apt install -y nano curl gpg-agent python3 ca-certificates \ No newline at end of file diff --git a/molecule/common/Dockerfile_debian11.j2 b/molecule/common/Dockerfile_debian11.j2 deleted file mode 100644 index d95f599..0000000 --- a/molecule/common/Dockerfile_debian11.j2 +++ /dev/null @@ -1,4 +0,0 @@ -FROM {{ item.image | lower }} - -RUN apt update && \ - apt install -y nano curl gpg-agent python3 ca-certificates diff --git a/molecule/common/Dockerfile_ubuntu1804.j2 b/molecule/common/Dockerfile_ubuntu1804.j2 deleted file mode 100644 index 9a201b2..0000000 --- a/molecule/common/Dockerfile_ubuntu1804.j2 +++ /dev/null @@ -1,17 +0,0 @@ -FROM {{ item.image | lower }} - -ARG DEBIAN_FRONTEND=noninteractive - -RUN apt-get update && apt-get install -y --no-install-recommends \ - apt-utils \ - curl \ - debian-archive-keyring \ - gpg-agent \ - gnupg \ - nano \ - python3 \ - software-properties-common \ - && apt-get clean \ - && rm -Rf /var/lib/apt/lists/* \ - && rm -Rf /usr/share/doc \ - && rm -Rf /usr/share/man diff --git a/molecule/common/Dockerfile_ubuntu2004.j2 b/molecule/common/Dockerfile_ubuntu2004.j2 deleted file mode 100644 index 9a201b2..0000000 --- a/molecule/common/Dockerfile_ubuntu2004.j2 +++ /dev/null @@ -1,17 +0,0 @@ -FROM {{ item.image | lower }} - -ARG DEBIAN_FRONTEND=noninteractive - -RUN apt-get update && apt-get install -y --no-install-recommends \ - apt-utils \ - curl \ - debian-archive-keyring \ - gpg-agent \ - gnupg \ - nano \ - python3 \ - software-properties-common \ - && apt-get clean \ - && rm -Rf /var/lib/apt/lists/* \ - && rm -Rf /usr/share/doc \ - && rm -Rf /usr/share/man diff --git a/molecule/common/Dockerfile_ubuntu2204.j2 b/molecule/common/Dockerfile_ubuntu2204.j2 deleted file mode 100644 index 9ebcb17..0000000 --- a/molecule/common/Dockerfile_ubuntu2204.j2 +++ /dev/null @@ -1,18 +0,0 @@ -FROM {{ item.image | lower }} - -ARG DEBIAN_FRONTEND=noninteractive - - -RUN apt-get update && apt-get install -y --no-install-recommends \ - apt-utils \ - curl \ - debian-archive-keyring \ - gpg-agent \ - gnupg \ - nano \ - python3 \ - software-properties-common \ - && apt-get clean \ - && rm -Rf /var/lib/apt/lists/* \ - && rm -Rf /usr/share/doc \ - && rm -Rf /usr/share/man diff --git a/molecule/default/converge.yml b/molecule/default/converge.yml deleted file mode 100644 index e4b4c15..0000000 --- a/molecule/default/converge.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- -- name: Converge - hosts: all - tasks: - - name: "Include install-netdata-repository" - ansible.builtin.include_role: - name: roles/install_netdata_repository diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml deleted file mode 100644 index 1aaaca2..0000000 --- a/molecule/default/molecule.yml +++ /dev/null @@ -1,61 +0,0 @@ ---- -dependency: - name: galaxy - -driver: - name: docker - -platforms: - - - name: centos7 - image: quay.io/centos/centos:7 - pre_build_image: true - - - name: Debian10 - image: debian:10 - pre_build_image: false - dockerfile: ../common/Dockerfile_debian10.j2 - - - name: debian11 - image: debian:11 - pre_build_image: false - dockerfile: ../common/Dockerfile_debian11.j2 - - - name: fedora35 - image: fedora:35 - pre_build_image: true - - - name: oraclelinux8 - image: oraclelinux:8 - pre_build_image: true - - - name: rockylinux8 - image: rockylinux:8 - pre_build_image: true - - - name: ubuntu1804 - image: ubuntu:18.04 - dockerfile: ../common/Dockerfile_ubuntu1804.j2 - entrypoint: "/usr/bin/bash" - pre_build_image: false - - - name: ubuntu2004 - image: ubuntu:20.04 - dockerfile: ../common/Dockerfile_ubuntu2004.j2 - entrypoint: "/usr/bin/bash" - pre_build_image: false - - - name: ubuntu2204 - image: ubuntu:22.04 - dockerfile: ../common/Dockerfile_ubuntu2204.j2 - entrypoint: "/usr/bin/bash" - pre_build_image: false - - -provisioner: - name: ansible - env: - MOLECULE_NO_LOG: false - -verifier: - name: ansible diff --git a/molecule/default/verify.yml b/molecule/default/verify.yml deleted file mode 100644 index a5cfa75..0000000 --- a/molecule/default/verify.yml +++ /dev/null @@ -1,10 +0,0 @@ ---- -# This is an example playbook to execute Ansible tests. - -- name: Verify - hosts: all - gather_facts: false - tasks: - - name: Example assertion - ansible.builtin.assert: - that: true diff --git a/netdata-agent.yml b/netdata-agent.yml deleted file mode 100644 index a22c78e..0000000 --- a/netdata-agent.yml +++ /dev/null @@ -1,23 +0,0 @@ ---- - -- name: Install Netdata agent - hosts: all - remote_user: "{{ansible_user}}" - gather_facts: true - become: true - - pre_tasks: - - - name: Add EPEL repository for Centos/Rocky - ansible.builtin.package: - name: epel-release - state: latest - # when: ansible_facts['os_family'] == 'RedHat' - when: - ansible_distribution in ['RedHat', 'CentOS', 'ScientificLinux'] and - (ansible_distribution_version is version_compare('7', '<') or - ansible_distribution_version is version_compare('8', '>=')) - - roles: - - { role: install_netdata_repository, become: true } - - { role: install_netdata_agent, become: true } diff --git a/purge.yml b/purge.yml deleted file mode 100644 index 1dd303a..0000000 --- a/purge.yml +++ /dev/null @@ -1,8 +0,0 @@ -- name: Purge netdata agent and netdata agent repository - hosts: all - gather_facts: true - become: true - - roles: - - { role: purge_netdata_agent, become: true } - - { role: purge_netdata_repository, become: true } diff --git a/roles/claim/README.md b/roles/claim/README.md deleted file mode 100644 index 225dd44..0000000 --- a/roles/claim/README.md +++ /dev/null @@ -1,38 +0,0 @@ -Role Name -========= - -A brief description of the role goes here. - -Requirements ------------- - -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. - -Role Variables --------------- - -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. - -Dependencies ------------- - -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. - -Example Playbook ----------------- - -Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: - - - hosts: servers - roles: - - { role: username.rolename, x: 42 } - -License -------- - -BSD - -Author Information ------------------- - -An optional section for the role authors to include contact information, or a website (HTML is not allowed). diff --git a/roles/claim/defaults/main.yml b/roles/claim/defaults/main.yml deleted file mode 100644 index 072f500..0000000 --- a/roles/claim/defaults/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# defaults file for roles/claim diff --git a/roles/claim/handlers/main.yml b/roles/claim/handlers/main.yml deleted file mode 100644 index 341efcd..0000000 --- a/roles/claim/handlers/main.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- -# handlers file for roles/claim - -- name: Restart netdata agent - ansible.builtin.systemd: - name: netdata.service - state: restarted diff --git a/roles/claim/meta/main.yml b/roles/claim/meta/main.yml deleted file mode 100644 index 2110721..0000000 --- a/roles/claim/meta/main.yml +++ /dev/null @@ -1,41 +0,0 @@ -galaxy_info: - author: Netdata packaging team - description: real-time charts for system monitoring (https://netdata.cloud/) - company: Netdata Inc. - - license: GPL-3.0-or-later - - min_ansible_version: "2.1" - - # If this a Container Enabled role, provide the minimum Ansible Container version. - # min_ansible_container_version: - - # - # Provide a list of supported platforms, and for each platform a list of versions. - # If you don't wish to enumerate all versions for a particular platform, use 'all'. - # To view available platforms and versions (or releases), visit: - # https://galaxy.ansible.com/api/v1/platforms/ - # - # platforms: - # - name: Fedora - # versions: - # - all - # - 25 - # - name: SomePlatform - # versions: - # - all - # - 1.0 - # - 7 - # - 99.99 - - galaxy_tags: [] - # List tags for your role here, one per line. A tag is a keyword that describes - # and categorizes the role. Users find roles by searching for tags. Be sure to - # remove the '[]' above, if you add tags to this list. - # - # NOTE: A tag is limited to a single word comprised of alphanumeric characters. - # Maximum 20 tags per role. - -dependencies: [] - # List your role dependencies here, one per line. Be sure to remove the '[]' above, - # if you add dependencies to this list. diff --git a/roles/claim/tasks/main.yml b/roles/claim/tasks/main.yml deleted file mode 100644 index d040ae9..0000000 --- a/roles/claim/tasks/main.yml +++ /dev/null @@ -1,29 +0,0 @@ ---- -# tasks file for roles/claim - -- name: Get information about running agent - ansible.builtin.command: netdatacli aclk-state json - register: agent_info - - # - set_fact: - # is_online: "{{ agent_info.stdout | from_json | json_query('online') }}" - -- name: Set fact for is_claimed - ansible.builtin.set_fact: - is_claimed: "{{ agent_info.stdout | from_json | json_query('\"agent-claimed\"') }}" - -- name: Claim the new node if is not claimed yet - block: - - name: Generate UUID - ansible.builtin.command: uuidgen - register: uuid - - - name: Set fact new_uuid - ansible.builtin.set_fact: - new_uuid: "{{ uuid.stdout }}" - - - name: Claim the node - ansible.builtin.command: netdata-claim.sh -token="{{ claim_token }}" -rooms="{{ claim_rooms }}" -url="{{ claim_url }}" -id="{{ new_uuid }}" - notify: restart netdata agent - - when: not is_claimed diff --git a/roles/claim/tests/inventory b/roles/claim/tests/inventory deleted file mode 100644 index 878877b..0000000 --- a/roles/claim/tests/inventory +++ /dev/null @@ -1,2 +0,0 @@ -localhost - diff --git a/roles/claim/tests/test.yml b/roles/claim/tests/test.yml deleted file mode 100644 index a97704c..0000000 --- a/roles/claim/tests/test.yml +++ /dev/null @@ -1,6 +0,0 @@ ---- -- name: Test for claim role - hosts: localhost - remote_user: root - roles: - - roles/claim diff --git a/roles/claim/vars/Centos7.yml b/roles/claim/vars/Centos7.yml deleted file mode 100644 index 096099b..0000000 --- a/roles/claim/vars/Centos7.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- - -claiming_script: "/usr/sbin/netdata-claim.sh" diff --git a/roles/claim/vars/Debian11.yml b/roles/claim/vars/Debian11.yml deleted file mode 100644 index 096099b..0000000 --- a/roles/claim/vars/Debian11.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- - -claiming_script: "/usr/sbin/netdata-claim.sh" diff --git a/roles/claim/vars/Fedora35.yml b/roles/claim/vars/Fedora35.yml deleted file mode 100644 index 096099b..0000000 --- a/roles/claim/vars/Fedora35.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- - -claiming_script: "/usr/sbin/netdata-claim.sh" diff --git a/roles/claim/vars/OracleLinux8.yml b/roles/claim/vars/OracleLinux8.yml deleted file mode 100644 index 096099b..0000000 --- a/roles/claim/vars/OracleLinux8.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- - -claiming_script: "/usr/sbin/netdata-claim.sh" diff --git a/roles/claim/vars/Rocky8.yml b/roles/claim/vars/Rocky8.yml deleted file mode 100644 index 096099b..0000000 --- a/roles/claim/vars/Rocky8.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- - -claiming_script: "/usr/sbin/netdata-claim.sh" diff --git a/roles/claim/vars/main.yml b/roles/claim/vars/main.yml deleted file mode 100644 index ad5b5bd..0000000 --- a/roles/claim/vars/main.yml +++ /dev/null @@ -1,6 +0,0 @@ ---- -# vars file for roles/claim - -claim_token: 4p_pe4EUMJ7hyO_DkTicKBRj_jfQXMbRQNaH39dz0YbXOHHrK_5jF9-Sjc5l4DbZMuXVtxE2kVMkP6YXmrYaBRcyg59qVGa0SMx6QhxIGVMMcpzuvom2IFSSaTpBEfBAw-nbcgQ -claim_rooms: 4d9094b6-810e-458c-a9a0-acf3372e08e5 -claim_url: https://app.netdata.cloud diff --git a/roles/install_netdata_agent/README.md b/roles/install_netdata_agent/README.md deleted file mode 100644 index 225dd44..0000000 --- a/roles/install_netdata_agent/README.md +++ /dev/null @@ -1,38 +0,0 @@ -Role Name -========= - -A brief description of the role goes here. - -Requirements ------------- - -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. - -Role Variables --------------- - -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. - -Dependencies ------------- - -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. - -Example Playbook ----------------- - -Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: - - - hosts: servers - roles: - - { role: username.rolename, x: 42 } - -License -------- - -BSD - -Author Information ------------------- - -An optional section for the role authors to include contact information, or a website (HTML is not allowed). diff --git a/roles/install_netdata_agent/defaults/main.yml b/roles/install_netdata_agent/defaults/main.yml deleted file mode 100644 index 9995e15..0000000 --- a/roles/install_netdata_agent/defaults/main.yml +++ /dev/null @@ -1,14 +0,0 @@ ---- -# defaults file for roles/install_netdata_agent -# Global -agent_user: netdata -agent_history: 3600 -# Agent process scheduling policy -agent_policy: idle -# Agent OOM score -oom_score: 1000 - -# Web -owner: root -group: netdata -bind_to: localhost diff --git a/roles/install_netdata_agent/handlers/main.yml b/roles/install_netdata_agent/handlers/main.yml deleted file mode 100644 index fd236a4..0000000 --- a/roles/install_netdata_agent/handlers/main.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- -# handlers file for roles/install_netdata_agent - -- name: Restart netdata agent - ansible.builtin.systemd: - name: netdata.service - state: restarted diff --git a/roles/install_netdata_agent/meta/main.yml b/roles/install_netdata_agent/meta/main.yml deleted file mode 100644 index 2110721..0000000 --- a/roles/install_netdata_agent/meta/main.yml +++ /dev/null @@ -1,41 +0,0 @@ -galaxy_info: - author: Netdata packaging team - description: real-time charts for system monitoring (https://netdata.cloud/) - company: Netdata Inc. - - license: GPL-3.0-or-later - - min_ansible_version: "2.1" - - # If this a Container Enabled role, provide the minimum Ansible Container version. - # min_ansible_container_version: - - # - # Provide a list of supported platforms, and for each platform a list of versions. - # If you don't wish to enumerate all versions for a particular platform, use 'all'. - # To view available platforms and versions (or releases), visit: - # https://galaxy.ansible.com/api/v1/platforms/ - # - # platforms: - # - name: Fedora - # versions: - # - all - # - 25 - # - name: SomePlatform - # versions: - # - all - # - 1.0 - # - 7 - # - 99.99 - - galaxy_tags: [] - # List tags for your role here, one per line. A tag is a keyword that describes - # and categorizes the role. Users find roles by searching for tags. Be sure to - # remove the '[]' above, if you add tags to this list. - # - # NOTE: A tag is limited to a single word comprised of alphanumeric characters. - # Maximum 20 tags per role. - -dependencies: [] - # List your role dependencies here, one per line. Be sure to remove the '[]' above, - # if you add dependencies to this list. diff --git a/roles/install_netdata_agent/tasks/Alpine3.yml b/roles/install_netdata_agent/tasks/Alpine3.yml deleted file mode 100644 index ed97d53..0000000 --- a/roles/install_netdata_agent/tasks/Alpine3.yml +++ /dev/null @@ -1 +0,0 @@ ---- diff --git a/roles/install_netdata_agent/tasks/Centos7.yml b/roles/install_netdata_agent/tasks/Centos7.yml deleted file mode 100644 index ed01295..0000000 --- a/roles/install_netdata_agent/tasks/Centos7.yml +++ /dev/null @@ -1,42 +0,0 @@ ---- - -# We have to install the dependencies from EPEL because we have to disable it when installing netdata agent. - -- name: Dependencies first - ansible.builtin.yum: - name: "{{ item }}" - state: present - update_cache: true - loop: - - Judy - - brotli - - libuv - - netcat - - nodejs - - nodejs-libs - - openssl11 - - yum-plugin-priorities - -# We disabled EPEL for netdata agent installation to exclude the possibility of installing EPEL package -- name: Install netdata agent package - ansible.builtin.package: - name: "{{ netdata_agent_package }}" - state: latest - update_cache: true - disable_gpg_check: true - disablerepo: "epel" - -- name: Writing configuration to /etc/netdata/netdata.conf - ansible.builtin.template: - src: netdata.conf.j2 - dest: /etc/netdata/netdata.conf - owner: root - group: root - mode: '0644' - notify: restart netdata agent - -- name: Start service "{{ netdata_agent_service }}" - ansible.builtin.systemd: - name: "{{ netdata_agent_service }}" - state: started - enabled: true diff --git a/roles/install_netdata_agent/tasks/Debian10.yml b/roles/install_netdata_agent/tasks/Debian10.yml deleted file mode 100644 index 9db2059..0000000 --- a/roles/install_netdata_agent/tasks/Debian10.yml +++ /dev/null @@ -1,20 +0,0 @@ ---- - -- name: Install uuid-runtime - ansible.builtin.package: - name: uuid-runtime - state: present - -- name: Install the netdata agent package - ansible.builtin.apt: - name: netdata - update_cache: true - state: latest - # default_release: - -- name: Start service "{{ netdata_agent_service }}" - ansible.builtin.systemd: - name: "{{ netdata_agent_service }}" - state: started - enabled: true - masked: false diff --git a/roles/install_netdata_agent/tasks/Debian11.yml b/roles/install_netdata_agent/tasks/Debian11.yml deleted file mode 100644 index 9c9fc29..0000000 --- a/roles/install_netdata_agent/tasks/Debian11.yml +++ /dev/null @@ -1,19 +0,0 @@ ---- -- name: Install uuid-runtime - ansible.builtin.package: - name: uuid-runtime - state: present - -- name: Install the netdata agent package - ansible.builtin.apt: - name: netdata - update_cache: true - state: latest - # default_release: - -- name: Start service "{{ netdata_agent_service }}" - ansible.builtin.systemd: - name: "{{ netdata_agent_service }}" - state: started - enabled: true - masked: false diff --git a/roles/install_netdata_agent/tasks/Fedora35.yml b/roles/install_netdata_agent/tasks/Fedora35.yml deleted file mode 100644 index 9e02469..0000000 --- a/roles/install_netdata_agent/tasks/Fedora35.yml +++ /dev/null @@ -1,25 +0,0 @@ ---- - -- name: Install Netdata agent package - ansible.builtin.package: - name: "{{ netdata_agent_package }}" - state: latest - update_cache: true - disable_gpg_check: true - # disablerepo: "epel" # Not needed for Fedora - - -- name: Writing configuration to /etc/netdata/netdata.conf - ansible.builtin.template: - src: netdata.conf.j2 - dest: /etc/netdata/netdata.conf - owner: root - group: root - mode: '0644' - notify: restart netdata agent - -- name: Start service "{{ netdata_agent_service }}" - ansible.builtin.systemd: - name: "{{ netdata_agent_service }}" - state: started - enabled: true diff --git a/roles/install_netdata_agent/tasks/OracleLinux8.yml b/roles/install_netdata_agent/tasks/OracleLinux8.yml deleted file mode 100644 index 1e7366a..0000000 --- a/roles/install_netdata_agent/tasks/OracleLinux8.yml +++ /dev/null @@ -1,38 +0,0 @@ ---- - -- name: Dependencies first - ansible.builtin.dnf: - name: "{{ item }}" - state: present - update_cache: true - loop: - - Judy - - brotli - - libuv - - netcat - - nodejs - - openssl - -- name: Install the netdata agent package - ansible.builtin.package: - name: "{{ netdata_agent_package }}" - state: latest - update_cache: true - disable_gpg_check: true - disablerepo: "epel" - - -- name: Writing configuration to /etc/netdata/netdata.conf - ansible.builtin.template: - src: netdata.conf.j2 - dest: /etc/netdata/netdata.conf - owner: root - group: root - mode: '0644' - notify: restart netdata agent - -- name: Start service "{{ netdata_agent_service }}" - ansible.builtin.systemd: - name: "{{ netdata_agent_service }}" - state: started - enabled: true diff --git a/roles/install_netdata_agent/tasks/Rocky8.yml b/roles/install_netdata_agent/tasks/Rocky8.yml deleted file mode 100644 index b8bb25b..0000000 --- a/roles/install_netdata_agent/tasks/Rocky8.yml +++ /dev/null @@ -1,37 +0,0 @@ ---- - -- name: Dependencies first - ansible.builtin.dnf: - name: "{{ item }}" - state: present - update_cache: true - loop: - - Judy - - brotli - - libuv - - netcat - - nodejs - - openssl - -- name: Install the netdata agent package - ansible.builtin.package: - name: "{{ netdata_agent_package }}" - state: latest - update_cache: true - disable_gpg_check: true - disablerepo: "epel" - -- name: Writing configuration to /etc/netdata/netdata.conf - ansible.builtin.template: - src: netdata.conf.j2 - dest: /etc/netdata/netdata.conf - owner: root - group: root - mode: '0644' - notify: restart netdata agent - -- name: Start service "{{ netdata_agent_service }}" - ansible.builtin.systemd: - name: "{{ netdata_agent_service }}" - state: started - enabled: true diff --git a/roles/install_netdata_agent/tasks/Ubuntu18.yml b/roles/install_netdata_agent/tasks/Ubuntu18.yml deleted file mode 100644 index b3c4cfb..0000000 --- a/roles/install_netdata_agent/tasks/Ubuntu18.yml +++ /dev/null @@ -1,13 +0,0 @@ ---- - -- name: Install the netdata agent package - ansible.builtin.package: - name: "{{ netdata_agent_package }}" - update_cache: true - state: latest - -- name: Start service "{{ netdata_agent_service }}" - ansible.builtin.systemd: - name: "{{ netdata_agent_service }}" - state: started - enabled: true diff --git a/roles/install_netdata_agent/tasks/Ubuntu20.yml b/roles/install_netdata_agent/tasks/Ubuntu20.yml deleted file mode 100644 index b3c4cfb..0000000 --- a/roles/install_netdata_agent/tasks/Ubuntu20.yml +++ /dev/null @@ -1,13 +0,0 @@ ---- - -- name: Install the netdata agent package - ansible.builtin.package: - name: "{{ netdata_agent_package }}" - update_cache: true - state: latest - -- name: Start service "{{ netdata_agent_service }}" - ansible.builtin.systemd: - name: "{{ netdata_agent_service }}" - state: started - enabled: true diff --git a/roles/install_netdata_agent/tasks/Ubuntu22.yml b/roles/install_netdata_agent/tasks/Ubuntu22.yml deleted file mode 100644 index b3c4cfb..0000000 --- a/roles/install_netdata_agent/tasks/Ubuntu22.yml +++ /dev/null @@ -1,13 +0,0 @@ ---- - -- name: Install the netdata agent package - ansible.builtin.package: - name: "{{ netdata_agent_package }}" - update_cache: true - state: latest - -- name: Start service "{{ netdata_agent_service }}" - ansible.builtin.systemd: - name: "{{ netdata_agent_service }}" - state: started - enabled: true diff --git a/roles/install_netdata_agent/tasks/main.yml b/roles/install_netdata_agent/tasks/main.yml deleted file mode 100644 index e216819..0000000 --- a/roles/install_netdata_agent/tasks/main.yml +++ /dev/null @@ -1,11 +0,0 @@ ---- -# tasks file for roles/install_netdata_agent - -- name: Include architecture specific vars - ansible.builtin.include_vars: "{{ ansible_architecture }}.yml" - -- name: Include OS specific vars - ansible.builtin.include_vars: "{{ ansible_distribution }}{{ ansible_distribution_major_version }}.yml" - -- name: Include OS specific tasks - ansible.builtin.include_tasks: "{{ ansible_distribution }}{{ ansible_distribution_major_version }}.yml" diff --git a/roles/install_netdata_agent/templates/netdata.conf.j2 b/roles/install_netdata_agent/templates/netdata.conf.j2 deleted file mode 100644 index da91972..0000000 --- a/roles/install_netdata_agent/templates/netdata.conf.j2 +++ /dev/null @@ -1,16 +0,0 @@ -[global] - run as user = {{agent_user}} - - # the default database size - 1 hour - history = {{agent_history}} - - # some defaults to run netdata with least priority - process scheduling policy = {{agent_policy}} - OOM score = {{oom_score}} - -[web] - web files owner = {{owner}} - web files group = {{group}} - - # by default do not expose the netdata port - bind to = {{bind_to}} diff --git a/roles/install_netdata_agent/tests/inventory b/roles/install_netdata_agent/tests/inventory deleted file mode 100644 index d18580b..0000000 --- a/roles/install_netdata_agent/tests/inventory +++ /dev/null @@ -1 +0,0 @@ -localhost \ No newline at end of file diff --git a/roles/install_netdata_agent/tests/test.yml b/roles/install_netdata_agent/tests/test.yml deleted file mode 100644 index caf1422..0000000 --- a/roles/install_netdata_agent/tests/test.yml +++ /dev/null @@ -1,6 +0,0 @@ ---- -- name: Test role install_netdata_agent - hosts: localhost - remote_user: root - roles: - - roles/install_netdata_agent diff --git a/roles/install_netdata_agent/vars/Alpine3.yml b/roles/install_netdata_agent/vars/Alpine3.yml deleted file mode 100644 index ed97d53..0000000 --- a/roles/install_netdata_agent/vars/Alpine3.yml +++ /dev/null @@ -1 +0,0 @@ ---- diff --git a/roles/install_netdata_agent/vars/Centos7.yml b/roles/install_netdata_agent/vars/Centos7.yml deleted file mode 100644 index f9a221c..0000000 --- a/roles/install_netdata_agent/vars/Centos7.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- - -netdata_agent_package: netdata -netdata_agent_service: netdata diff --git a/roles/install_netdata_agent/vars/Debian10.yml b/roles/install_netdata_agent/vars/Debian10.yml deleted file mode 100644 index 16a9e32..0000000 --- a/roles/install_netdata_agent/vars/Debian10.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- - -netdata_agent_package: netdata -netdata_agent_service: netdata - -package_uri: "{{ 'https://packagecloud.io/netdata/netdata/packages/debian/buster/' if distro == 'stable' else 'https://packagecloud.io/netdata/netdata-edge/packages/debian/buster/' }}" -# package_name: "{{ 'netdata_1.33.1_' if distro == 'stable' else 'netdata_1.33.1-195-nightly_' }}" diff --git a/roles/install_netdata_agent/vars/Debian11.yml b/roles/install_netdata_agent/vars/Debian11.yml deleted file mode 100644 index 3fd0884..0000000 --- a/roles/install_netdata_agent/vars/Debian11.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- - -netdata_agent_package: netdata -netdata_agent_service: netdata - -package_uri: "{{ 'https://packagecloud.io/netdata/netdata/packages/debian/bullseye/' if distro == 'stable' else 'https://packagecloud.io/netdata/netdata-edge/packages/debian/bullseye/' }}" -# package_name: "{{ 'netdata_1.33.1_' if distro == 'stable' else 'netdata_1.33.1-195-nightly_' }}" diff --git a/roles/install_netdata_agent/vars/Fedora35.yml b/roles/install_netdata_agent/vars/Fedora35.yml deleted file mode 100644 index f9a221c..0000000 --- a/roles/install_netdata_agent/vars/Fedora35.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- - -netdata_agent_package: netdata -netdata_agent_service: netdata diff --git a/roles/install_netdata_agent/vars/OracleLinux8.yml b/roles/install_netdata_agent/vars/OracleLinux8.yml deleted file mode 100644 index f9a221c..0000000 --- a/roles/install_netdata_agent/vars/OracleLinux8.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- - -netdata_agent_package: netdata -netdata_agent_service: netdata diff --git a/roles/install_netdata_agent/vars/Rocky8.yml b/roles/install_netdata_agent/vars/Rocky8.yml deleted file mode 100644 index f9a221c..0000000 --- a/roles/install_netdata_agent/vars/Rocky8.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- - -netdata_agent_package: netdata -netdata_agent_service: netdata diff --git a/roles/install_netdata_agent/vars/Ubuntu18.yml b/roles/install_netdata_agent/vars/Ubuntu18.yml deleted file mode 100644 index f9a221c..0000000 --- a/roles/install_netdata_agent/vars/Ubuntu18.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- - -netdata_agent_package: netdata -netdata_agent_service: netdata diff --git a/roles/install_netdata_agent/vars/Ubuntu20.yml b/roles/install_netdata_agent/vars/Ubuntu20.yml deleted file mode 100644 index f9a221c..0000000 --- a/roles/install_netdata_agent/vars/Ubuntu20.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- - -netdata_agent_package: netdata -netdata_agent_service: netdata diff --git a/roles/install_netdata_agent/vars/Ubuntu22.yml b/roles/install_netdata_agent/vars/Ubuntu22.yml deleted file mode 100644 index f9a221c..0000000 --- a/roles/install_netdata_agent/vars/Ubuntu22.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- - -netdata_agent_package: netdata -netdata_agent_service: netdata diff --git a/roles/install_netdata_agent/vars/main.yml b/roles/install_netdata_agent/vars/main.yml deleted file mode 100644 index 8b0dff5..0000000 --- a/roles/install_netdata_agent/vars/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# vars file for roles/install_netdata_agent diff --git a/roles/install_netdata_agent/vars/x86_64.yml b/roles/install_netdata_agent/vars/x86_64.yml deleted file mode 100644 index c2943ef..0000000 --- a/roles/install_netdata_agent/vars/x86_64.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- - -suffix: amd64 diff --git a/roles/install_netdata_repository/README.md b/roles/install_netdata_repository/README.md deleted file mode 100644 index 225dd44..0000000 --- a/roles/install_netdata_repository/README.md +++ /dev/null @@ -1,38 +0,0 @@ -Role Name -========= - -A brief description of the role goes here. - -Requirements ------------- - -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. - -Role Variables --------------- - -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. - -Dependencies ------------- - -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. - -Example Playbook ----------------- - -Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: - - - hosts: servers - roles: - - { role: username.rolename, x: 42 } - -License -------- - -BSD - -Author Information ------------------- - -An optional section for the role authors to include contact information, or a website (HTML is not allowed). diff --git a/roles/install_netdata_repository/defaults/main.yml b/roles/install_netdata_repository/defaults/main.yml deleted file mode 100644 index d8c040c..0000000 --- a/roles/install_netdata_repository/defaults/main.yml +++ /dev/null @@ -1,16 +0,0 @@ ---- -# defaults file for roles/netdata-repository -repository_version: 1.1 - -# Packagecloud repository PGP key -pc_repo_key: https://packagecloud.io/netdata/netdata/gpgkey - -# distribution, stable or edge -distro: stable - -# Debian 11 repo: -debian11_repo: https://packagecloud.io/netdata/netdata/packages/debian/bullseye/netdata-repo_1-1_all.deb/download.deb -# Centos 7 stable repo: -centos7_stable_repo: https://packagecloud.io/netdata/netdata-repoconfig/packages/el/7/netdata-repo-1-1.noarch.rpm/download.rpm -# Rocky Linux 8 stable repo: -rocky8_stable_repo: https://packagecloud.io/netdata/netdata-repoconfig/packages/el/8/netdata-repo-1-1.noarch.rpm/download.rpm diff --git a/roles/install_netdata_repository/handlers/main.yml b/roles/install_netdata_repository/handlers/main.yml deleted file mode 100644 index d626a76..0000000 --- a/roles/install_netdata_repository/handlers/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# handlers file for roles/netdata-repository diff --git a/roles/install_netdata_repository/meta/main.yml b/roles/install_netdata_repository/meta/main.yml deleted file mode 100644 index d76c35e..0000000 --- a/roles/install_netdata_repository/meta/main.yml +++ /dev/null @@ -1,43 +0,0 @@ -galaxy_info: - author: Netdata packaging team - description: real-time charts for system monitoring (https://netdata.cloud/) - company: Netdata Inc. - role_name: install_netdata_repository - namespace: netdata - - license: GPL-3.0-or-later - - min_ansible_version: "2.1" - - # If this a Container Enabled role, provide the minimum Ansible Container version. - # min_ansible_container_version: - - # - # Provide a list of supported platforms, and for each platform a list of versions. - # If you don't wish to enumerate all versions for a particular platform, use 'all'. - # To view available platforms and versions (or releases), visit: - # https://galaxy.ansible.com/api/v1/platforms/ - # - # platforms: - # - name: Fedora - # versions: - # - all - # - 25 - # - name: SomePlatform - # versions: - # - all - # - 1.0 - # - 7 - # - 99.99 - - galaxy_tags: [] - # List tags for your role here, one per line. A tag is a keyword that describes - # and categorizes the role. Users find roles by searching for tags. Be sure to - # remove the '[]' above, if you add tags to this list. - # - # NOTE: A tag is limited to a single word comprised of alphanumeric characters. - # Maximum 20 tags per role. - -dependencies: [] - # List your role dependencies here, one per line. Be sure to remove the '[]' above, - # if you add dependencies to this list. diff --git a/roles/install_netdata_repository/tasks/CentOS7.yml b/roles/install_netdata_repository/tasks/CentOS7.yml deleted file mode 100644 index ad24b05..0000000 --- a/roles/install_netdata_repository/tasks/CentOS7.yml +++ /dev/null @@ -1,23 +0,0 @@ ---- - -- name: Install Netdata stable repository configuration - ansible.builtin.yum: - name: https://packagecloud.io/netdata/netdata-repoconfig/packages/el/7/netdata-repo-1-1.noarch.rpm/download.rpm - state: present - when: distro == 'stable' - -- name: Import a stable repository PGP key from a url - ansible.builtin.rpm_key: - state: present - key: https://packagecloud.io/netdata/netdata/gpgkey - -- name: Install Netdata nightly repository configuration - ansible.builtin.yum: - name: https://packagecloud.io/netdata/netdata-repoconfig/packages/el/7/netdata-repo-edge-1-1.noarch.rpm/download.rpm - state: present - when: distro == 'edge' - -- name: Import an edge repository PGP key from a url - ansible.builtin.rpm_key: - state: present - key: https://packagecloud.io/netdata/netdata-edge/gpgkey diff --git a/roles/install_netdata_repository/tasks/Debian10.yml b/roles/install_netdata_repository/tasks/Debian10.yml deleted file mode 100644 index 9a20033..0000000 --- a/roles/install_netdata_repository/tasks/Debian10.yml +++ /dev/null @@ -1,19 +0,0 @@ ---- - -- name: Install some essential packages - ansible.builtin.apt: - name: "{{ item }}" - update_cache: true - loop: - - gpg - - debian-archive-keyring - - apt-transport-https - -- name: Install Netdata repo key - ansible.builtin.apt_key: - url: https://packagecloud.io/netdata/netdata-repoconfig/gpgkey - state: present - -- name: Install netdata repo - ansible.builtin.apt: - deb: "{{ repo_uri }}" diff --git a/roles/install_netdata_repository/tasks/Debian11.yml b/roles/install_netdata_repository/tasks/Debian11.yml deleted file mode 100644 index 1bb526e..0000000 --- a/roles/install_netdata_repository/tasks/Debian11.yml +++ /dev/null @@ -1,10 +0,0 @@ ---- - -- name: Install Netdata repo key. - ansible.builtin.apt_key: - url: https://packagecloud.io/netdata/netdata/gpgkey - state: present - -- name: Install netdata repo - ansible.builtin.apt: - deb: "{{ repo_uri }}" diff --git a/roles/install_netdata_repository/tasks/Fedora35.yml b/roles/install_netdata_repository/tasks/Fedora35.yml deleted file mode 100644 index 8d369e0..0000000 --- a/roles/install_netdata_repository/tasks/Fedora35.yml +++ /dev/null @@ -1,25 +0,0 @@ ---- - -- name: Import a key from a url - ansible.builtin.rpm_key: - state: present - key: https://packagecloud.io/netdata/netdata/gpgkey - -- name: Import a key from a url - ansible.builtin.rpm_key: - state: present - key: https://packagecloud.io/netdata/netdata-edge/gpgkey - -- name: Install Netdata stable repository configuration - ansible.builtin.dnf: - name: https://packagecloud.io/netdata/netdata-repoconfig/packages/fedora/35/netdata-repo-1-1.noarch.rpm/download.rpm - state: present - disable_gpg_check: true - when: distro == 'stable' - -- name: Install Netdata nightly repository configuration - ansible.builtin.dnf: - name: https://packagecloud.io/netdata/netdata-repoconfig/packages/fedora/35/netdata-repo-edge-1-1.noarch.rpm/download.rpm - state: present - disable_gpg_check: true - when: distro == 'edge' diff --git a/roles/install_netdata_repository/tasks/OracleLinux8.yml b/roles/install_netdata_repository/tasks/OracleLinux8.yml deleted file mode 100644 index 53f94ef..0000000 --- a/roles/install_netdata_repository/tasks/OracleLinux8.yml +++ /dev/null @@ -1,25 +0,0 @@ ---- - -- name: Import a key from a url - ansible.builtin.rpm_key: - state: present - key: https://packagecloud.io/netdata/netdata/gpgkey - -- name: Import a key from a url - ansible.builtin.rpm_key: - state: present - key: https://packagecloud.io/netdata/netdata-edge/gpgkey - -- name: Install Netdata stable repository configuration - ansible.builtin.dnf: - name: https://packagecloud.io/netdata/netdata-repoconfig/packages/ol/8/netdata-repo-1-1.noarch.rpm/download.rpm - state: present - disable_gpg_check: true - when: distro == 'stable' - -- name: Install Netdata nightly repository configuration - ansible.builtin.dnf: - name: https://packagecloud.io/netdata/netdata-repoconfig/packages/ol/8/netdata-repo-edge-1-1.noarch.rpm/download.rpm - state: present - disable_gpg_check: true - when: distro == 'edge' diff --git a/roles/install_netdata_repository/tasks/Rocky8.yml b/roles/install_netdata_repository/tasks/Rocky8.yml deleted file mode 100644 index d4d7617..0000000 --- a/roles/install_netdata_repository/tasks/Rocky8.yml +++ /dev/null @@ -1,25 +0,0 @@ ---- - -- name: Import a key from a url - ansible.builtin.rpm_key: - state: present - key: https://packagecloud.io/netdata/netdata/gpgkey - -- name: Import a key from a url - ansible.builtin.rpm_key: - state: present - key: https://packagecloud.io/netdata/netdata-edge/gpgkey - -- name: Install Netdata stable repository configuration - ansible.builtin.dnf: - name: https://packagecloud.io/netdata/netdata-repoconfig/packages/el/8/netdata-repo-1-1.noarch.rpm/download.rpm - state: present - disable_gpg_check: true - when: distro == 'stable' - -- name: Install Netdata nightly repository configuration - ansible.builtin.dnf: - name: https://packagecloud.io/netdata/netdata-repoconfig/packages/el/8/netdata-repo-edge-1-1.noarch.rpm/download.rpm - state: present - disable_gpg_check: true - when: distro == 'edge' diff --git a/roles/install_netdata_repository/tasks/Ubuntu18.yml b/roles/install_netdata_repository/tasks/Ubuntu18.yml deleted file mode 100644 index c21a144..0000000 --- a/roles/install_netdata_repository/tasks/Ubuntu18.yml +++ /dev/null @@ -1,19 +0,0 @@ ---- - -- name: Install some essential packages - ansible.builtin.apt: - name: "{{ item }}" - update_cache: true - loop: - - gpg - - debian-archive-keyring - - apt-transport-https - -- name: Install Netdata repo key. - ansible.builtin.apt_key: - url: https://packagecloud.io/netdata/netdata/gpgkey - state: present - -- name: Install Netdata repository package - ansible.builtin.apt: - deb: "{{ repo_uri }}" diff --git a/roles/install_netdata_repository/tasks/Ubuntu20.yml b/roles/install_netdata_repository/tasks/Ubuntu20.yml deleted file mode 100644 index 13f918a..0000000 --- a/roles/install_netdata_repository/tasks/Ubuntu20.yml +++ /dev/null @@ -1,10 +0,0 @@ ---- - -- name: Install Netdata repo key. - ansible.builtin.apt_key: - url: https://packagecloud.io/netdata/netdata/gpgkey - state: present - -- name: Install Netdata repository package - ansible.builtin.apt: - deb: "{{ repo_uri }}" diff --git a/roles/install_netdata_repository/tasks/Ubuntu22.yml b/roles/install_netdata_repository/tasks/Ubuntu22.yml deleted file mode 100644 index 13f918a..0000000 --- a/roles/install_netdata_repository/tasks/Ubuntu22.yml +++ /dev/null @@ -1,10 +0,0 @@ ---- - -- name: Install Netdata repo key. - ansible.builtin.apt_key: - url: https://packagecloud.io/netdata/netdata/gpgkey - state: present - -- name: Install Netdata repository package - ansible.builtin.apt: - deb: "{{ repo_uri }}" diff --git a/roles/install_netdata_repository/tasks/main.yml b/roles/install_netdata_repository/tasks/main.yml deleted file mode 100644 index c2c6096..0000000 --- a/roles/install_netdata_repository/tasks/main.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- -# tasks file for roles/netdata-repository -- name: Include OS specific vars - ansible.builtin.include_vars: "{{ ansible_distribution }}{{ ansible_distribution_major_version }}.yml" - -- name: Include OS specific tasks - ansible.builtin.include_tasks: "{{ ansible_distribution }}{{ ansible_distribution_major_version }}.yml" diff --git a/roles/install_netdata_repository/tests/inventory b/roles/install_netdata_repository/tests/inventory deleted file mode 100644 index 878877b..0000000 --- a/roles/install_netdata_repository/tests/inventory +++ /dev/null @@ -1,2 +0,0 @@ -localhost - diff --git a/roles/install_netdata_repository/tests/test.yml b/roles/install_netdata_repository/tests/test.yml deleted file mode 100644 index 67e22dc..0000000 --- a/roles/install_netdata_repository/tests/test.yml +++ /dev/null @@ -1,6 +0,0 @@ ---- -- name: Test for role install_netdata_repository - hosts: localhost - remote_user: root - roles: - - roles/install_netdata_repository diff --git a/roles/install_netdata_repository/vars/Debian10.yml b/roles/install_netdata_repository/vars/Debian10.yml deleted file mode 100644 index 8185001..0000000 --- a/roles/install_netdata_repository/vars/Debian10.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- - -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' }}" diff --git a/roles/install_netdata_repository/vars/Debian11.yml b/roles/install_netdata_repository/vars/Debian11.yml deleted file mode 100644 index 632030c..0000000 --- a/roles/install_netdata_repository/vars/Debian11.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- - -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' }}" diff --git a/roles/install_netdata_repository/vars/Fedora35.yml b/roles/install_netdata_repository/vars/Fedora35.yml deleted file mode 100644 index ed97d53..0000000 --- a/roles/install_netdata_repository/vars/Fedora35.yml +++ /dev/null @@ -1 +0,0 @@ ---- diff --git a/roles/install_netdata_repository/vars/OracleLinux8.yml b/roles/install_netdata_repository/vars/OracleLinux8.yml deleted file mode 100644 index ed97d53..0000000 --- a/roles/install_netdata_repository/vars/OracleLinux8.yml +++ /dev/null @@ -1 +0,0 @@ ---- diff --git a/roles/install_netdata_repository/vars/Rocky8.yml b/roles/install_netdata_repository/vars/Rocky8.yml deleted file mode 100644 index ed97d53..0000000 --- a/roles/install_netdata_repository/vars/Rocky8.yml +++ /dev/null @@ -1 +0,0 @@ ---- diff --git a/roles/install_netdata_repository/vars/Ubuntu18.yml b/roles/install_netdata_repository/vars/Ubuntu18.yml deleted file mode 100644 index e7a2e27..0000000 --- a/roles/install_netdata_repository/vars/Ubuntu18.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- - -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' }}" diff --git a/roles/install_netdata_repository/vars/Ubuntu20.yml b/roles/install_netdata_repository/vars/Ubuntu20.yml deleted file mode 100644 index 87e84fc..0000000 --- a/roles/install_netdata_repository/vars/Ubuntu20.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- - -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' }}" diff --git a/roles/install_netdata_repository/vars/Ubuntu22.yml b/roles/install_netdata_repository/vars/Ubuntu22.yml deleted file mode 100644 index 1b25b3d..0000000 --- a/roles/install_netdata_repository/vars/Ubuntu22.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- - -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' }}" diff --git a/roles/install_netdata_repository/vars/main.yml b/roles/install_netdata_repository/vars/main.yml deleted file mode 100644 index a521a7b..0000000 --- a/roles/install_netdata_repository/vars/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# vars file for roles/netdata-repository diff --git a/roles/purge_netdata_agent/.travis.yml b/roles/purge_netdata_agent/.travis.yml deleted file mode 100644 index 121cc49..0000000 --- a/roles/purge_netdata_agent/.travis.yml +++ /dev/null @@ -1,29 +0,0 @@ ---- -language: python -python: "2.7" - -# Use the new container infrastructure -sudo: false - -# Install ansible -addons: - apt: - packages: - - python-pip - -install: - # Install ansible - - pip install ansible - - # Check ansible version - - ansible --version - - # Create ansible.cfg with correct roles_path - - printf '[defaults]\nroles_path=../' >ansible.cfg - -script: - # Basic role syntax check - - ansible-playbook tests/test.yml -i tests/inventory --syntax-check - -notifications: - webhooks: https://galaxy.ansible.com/api/v1/notifications/ diff --git a/roles/purge_netdata_agent/README.md b/roles/purge_netdata_agent/README.md deleted file mode 100644 index 225dd44..0000000 --- a/roles/purge_netdata_agent/README.md +++ /dev/null @@ -1,38 +0,0 @@ -Role Name -========= - -A brief description of the role goes here. - -Requirements ------------- - -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. - -Role Variables --------------- - -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. - -Dependencies ------------- - -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. - -Example Playbook ----------------- - -Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: - - - hosts: servers - roles: - - { role: username.rolename, x: 42 } - -License -------- - -BSD - -Author Information ------------------- - -An optional section for the role authors to include contact information, or a website (HTML is not allowed). diff --git a/roles/purge_netdata_agent/defaults/main.yml b/roles/purge_netdata_agent/defaults/main.yml deleted file mode 100644 index 5f45bc4..0000000 --- a/roles/purge_netdata_agent/defaults/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# defaults file for roles/purge_netdata_agent diff --git a/roles/purge_netdata_agent/handlers/main.yml b/roles/purge_netdata_agent/handlers/main.yml deleted file mode 100644 index 61d9de3..0000000 --- a/roles/purge_netdata_agent/handlers/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# handlers file for roles/purge_netdata_agent diff --git a/roles/purge_netdata_agent/meta/main.yml b/roles/purge_netdata_agent/meta/main.yml deleted file mode 100644 index 2110721..0000000 --- a/roles/purge_netdata_agent/meta/main.yml +++ /dev/null @@ -1,41 +0,0 @@ -galaxy_info: - author: Netdata packaging team - description: real-time charts for system monitoring (https://netdata.cloud/) - company: Netdata Inc. - - license: GPL-3.0-or-later - - min_ansible_version: "2.1" - - # If this a Container Enabled role, provide the minimum Ansible Container version. - # min_ansible_container_version: - - # - # Provide a list of supported platforms, and for each platform a list of versions. - # If you don't wish to enumerate all versions for a particular platform, use 'all'. - # To view available platforms and versions (or releases), visit: - # https://galaxy.ansible.com/api/v1/platforms/ - # - # platforms: - # - name: Fedora - # versions: - # - all - # - 25 - # - name: SomePlatform - # versions: - # - all - # - 1.0 - # - 7 - # - 99.99 - - galaxy_tags: [] - # List tags for your role here, one per line. A tag is a keyword that describes - # and categorizes the role. Users find roles by searching for tags. Be sure to - # remove the '[]' above, if you add tags to this list. - # - # NOTE: A tag is limited to a single word comprised of alphanumeric characters. - # Maximum 20 tags per role. - -dependencies: [] - # List your role dependencies here, one per line. Be sure to remove the '[]' above, - # if you add dependencies to this list. diff --git a/roles/purge_netdata_agent/tasks/Centos7.yml b/roles/purge_netdata_agent/tasks/Centos7.yml deleted file mode 100644 index c0c0455..0000000 --- a/roles/purge_netdata_agent/tasks/Centos7.yml +++ /dev/null @@ -1,17 +0,0 @@ ---- - -- name: Remove Netdata packages - ansible.builtin.yum: - state: absent - name: netdata - -- name: Remove the remains - ansible.builtin.file: - path: "{{ item }}" - state: absent - with_items: - - /etc/netdata - - /var/log/netdata - - /var/lib/netdata - - /var/cache/netdata - - /usr/libexec/netdata diff --git a/roles/purge_netdata_agent/tasks/Debian10.yml b/roles/purge_netdata_agent/tasks/Debian10.yml deleted file mode 100644 index 916c9fb..0000000 --- a/roles/purge_netdata_agent/tasks/Debian10.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- - -- name: Remove Netdata packages - ansible.builtin.apt: - state: absent - name: netdata - purge: true diff --git a/roles/purge_netdata_agent/tasks/Debian11.yml b/roles/purge_netdata_agent/tasks/Debian11.yml deleted file mode 100644 index 916c9fb..0000000 --- a/roles/purge_netdata_agent/tasks/Debian11.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- - -- name: Remove Netdata packages - ansible.builtin.apt: - state: absent - name: netdata - purge: true diff --git a/roles/purge_netdata_agent/tasks/Fedora35.yml b/roles/purge_netdata_agent/tasks/Fedora35.yml deleted file mode 100644 index 0257de3..0000000 --- a/roles/purge_netdata_agent/tasks/Fedora35.yml +++ /dev/null @@ -1,19 +0,0 @@ ---- - -- name: Remove Netdata packages - ansible.builtin.dnf: - state: absent - name: - - "{{ netdata_repo_package }}" - - "{{ netdata_agent_package }}" - -- name: Remove the remains - ansible.builtin.file: - path: "{{ item }}" - state: absent - with_items: - - /etc/netdata - - /var/log/netdata - - /var/lib/netdata - - /var/cache/netdata - - /usr/libexec/netdata diff --git a/roles/purge_netdata_agent/tasks/OracleLinux8.yml b/roles/purge_netdata_agent/tasks/OracleLinux8.yml deleted file mode 100644 index 0257de3..0000000 --- a/roles/purge_netdata_agent/tasks/OracleLinux8.yml +++ /dev/null @@ -1,19 +0,0 @@ ---- - -- name: Remove Netdata packages - ansible.builtin.dnf: - state: absent - name: - - "{{ netdata_repo_package }}" - - "{{ netdata_agent_package }}" - -- name: Remove the remains - ansible.builtin.file: - path: "{{ item }}" - state: absent - with_items: - - /etc/netdata - - /var/log/netdata - - /var/lib/netdata - - /var/cache/netdata - - /usr/libexec/netdata diff --git a/roles/purge_netdata_agent/tasks/Rocky8.yml b/roles/purge_netdata_agent/tasks/Rocky8.yml deleted file mode 100644 index 0257de3..0000000 --- a/roles/purge_netdata_agent/tasks/Rocky8.yml +++ /dev/null @@ -1,19 +0,0 @@ ---- - -- name: Remove Netdata packages - ansible.builtin.dnf: - state: absent - name: - - "{{ netdata_repo_package }}" - - "{{ netdata_agent_package }}" - -- name: Remove the remains - ansible.builtin.file: - path: "{{ item }}" - state: absent - with_items: - - /etc/netdata - - /var/log/netdata - - /var/lib/netdata - - /var/cache/netdata - - /usr/libexec/netdata diff --git a/roles/purge_netdata_agent/tasks/Ubuntu18.yml b/roles/purge_netdata_agent/tasks/Ubuntu18.yml deleted file mode 100644 index bc8c547..0000000 --- a/roles/purge_netdata_agent/tasks/Ubuntu18.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- - -- name: Remove Netdata packages - ansible.builtin.apt: - state: absent - name: "netdata*" - purge: true - autoremove: true diff --git a/roles/purge_netdata_agent/tasks/Ubuntu20.yml b/roles/purge_netdata_agent/tasks/Ubuntu20.yml deleted file mode 100644 index bc8c547..0000000 --- a/roles/purge_netdata_agent/tasks/Ubuntu20.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- - -- name: Remove Netdata packages - ansible.builtin.apt: - state: absent - name: "netdata*" - purge: true - autoremove: true diff --git a/roles/purge_netdata_agent/tasks/Ubuntu22.yml b/roles/purge_netdata_agent/tasks/Ubuntu22.yml deleted file mode 100644 index bc8c547..0000000 --- a/roles/purge_netdata_agent/tasks/Ubuntu22.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- - -- name: Remove Netdata packages - ansible.builtin.apt: - state: absent - name: "netdata*" - purge: true - autoremove: true diff --git a/roles/purge_netdata_agent/tasks/main.yml b/roles/purge_netdata_agent/tasks/main.yml deleted file mode 100644 index d2d87b4..0000000 --- a/roles/purge_netdata_agent/tasks/main.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -# tasks file for roles/purge_netdata_agent - -- name: Include OS specific vars - ansible.builtin.include_vars: "{{ ansible_distribution }}{{ ansible_distribution_major_version }}.yml" - -- name: Include OS specific install - ansible.builtin.include_tasks: "{{ ansible_distribution }}{{ ansible_distribution_major_version }}.yml" diff --git a/roles/purge_netdata_agent/tests/inventory b/roles/purge_netdata_agent/tests/inventory deleted file mode 100644 index 878877b..0000000 --- a/roles/purge_netdata_agent/tests/inventory +++ /dev/null @@ -1,2 +0,0 @@ -localhost - diff --git a/roles/purge_netdata_agent/tests/test.yml b/roles/purge_netdata_agent/tests/test.yml deleted file mode 100644 index 6d7138b..0000000 --- a/roles/purge_netdata_agent/tests/test.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- - -- name: "Test role: purge_netdata_agent" - hosts: localhost - remote_user: root - roles: - - roles/purge_netdata_agent diff --git a/roles/purge_netdata_agent/vars/Centos7.yml b/roles/purge_netdata_agent/vars/Centos7.yml deleted file mode 100644 index c5e2065..0000000 --- a/roles/purge_netdata_agent/vars/Centos7.yml +++ /dev/null @@ -1,6 +0,0 @@ ---- - -netdata_repo_package: "{{ 'netdata-repo' if distro == 'stable' else 'netdata-repo-edge' }}" - -netdata_agent_package: netdata -netdata_agent_service: netdata diff --git a/roles/purge_netdata_agent/vars/Debian10.yml b/roles/purge_netdata_agent/vars/Debian10.yml deleted file mode 100644 index ed97d53..0000000 --- a/roles/purge_netdata_agent/vars/Debian10.yml +++ /dev/null @@ -1 +0,0 @@ ---- diff --git a/roles/purge_netdata_agent/vars/Debian11.yml b/roles/purge_netdata_agent/vars/Debian11.yml deleted file mode 100644 index ed97d53..0000000 --- a/roles/purge_netdata_agent/vars/Debian11.yml +++ /dev/null @@ -1 +0,0 @@ ---- diff --git a/roles/purge_netdata_agent/vars/Fedora35.yml b/roles/purge_netdata_agent/vars/Fedora35.yml deleted file mode 100644 index c5e2065..0000000 --- a/roles/purge_netdata_agent/vars/Fedora35.yml +++ /dev/null @@ -1,6 +0,0 @@ ---- - -netdata_repo_package: "{{ 'netdata-repo' if distro == 'stable' else 'netdata-repo-edge' }}" - -netdata_agent_package: netdata -netdata_agent_service: netdata diff --git a/roles/purge_netdata_agent/vars/OracleLinux8.yml b/roles/purge_netdata_agent/vars/OracleLinux8.yml deleted file mode 100644 index c8f71c8..0000000 --- a/roles/purge_netdata_agent/vars/OracleLinux8.yml +++ /dev/null @@ -1,6 +0,0 @@ ---- - -netdata_agent_package: netdata -netdata_agent_service: netdata - -netdata_repo_package: "{{ 'netdata-repo' if distro == 'stable' else 'netdata-repo-edge' }}" diff --git a/roles/purge_netdata_agent/vars/Rocky8.yml b/roles/purge_netdata_agent/vars/Rocky8.yml deleted file mode 100644 index c5e2065..0000000 --- a/roles/purge_netdata_agent/vars/Rocky8.yml +++ /dev/null @@ -1,6 +0,0 @@ ---- - -netdata_repo_package: "{{ 'netdata-repo' if distro == 'stable' else 'netdata-repo-edge' }}" - -netdata_agent_package: netdata -netdata_agent_service: netdata diff --git a/roles/purge_netdata_agent/vars/Ubuntu18.yml b/roles/purge_netdata_agent/vars/Ubuntu18.yml deleted file mode 100644 index ed97d53..0000000 --- a/roles/purge_netdata_agent/vars/Ubuntu18.yml +++ /dev/null @@ -1 +0,0 @@ ---- diff --git a/roles/purge_netdata_agent/vars/Ubuntu20.yml b/roles/purge_netdata_agent/vars/Ubuntu20.yml deleted file mode 100644 index ed97d53..0000000 --- a/roles/purge_netdata_agent/vars/Ubuntu20.yml +++ /dev/null @@ -1 +0,0 @@ ---- diff --git a/roles/purge_netdata_agent/vars/Ubuntu22.yml b/roles/purge_netdata_agent/vars/Ubuntu22.yml deleted file mode 100644 index ed97d53..0000000 --- a/roles/purge_netdata_agent/vars/Ubuntu22.yml +++ /dev/null @@ -1 +0,0 @@ ---- diff --git a/roles/purge_netdata_agent/vars/main.yml b/roles/purge_netdata_agent/vars/main.yml deleted file mode 100644 index e62efb7..0000000 --- a/roles/purge_netdata_agent/vars/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# vars file for roles/purge_netdata_agent diff --git a/roles/purge_netdata_repository/.travis.yml b/roles/purge_netdata_repository/.travis.yml deleted file mode 100644 index 121cc49..0000000 --- a/roles/purge_netdata_repository/.travis.yml +++ /dev/null @@ -1,29 +0,0 @@ ---- -language: python -python: "2.7" - -# Use the new container infrastructure -sudo: false - -# Install ansible -addons: - apt: - packages: - - python-pip - -install: - # Install ansible - - pip install ansible - - # Check ansible version - - ansible --version - - # Create ansible.cfg with correct roles_path - - printf '[defaults]\nroles_path=../' >ansible.cfg - -script: - # Basic role syntax check - - ansible-playbook tests/test.yml -i tests/inventory --syntax-check - -notifications: - webhooks: https://galaxy.ansible.com/api/v1/notifications/ diff --git a/roles/purge_netdata_repository/README.md b/roles/purge_netdata_repository/README.md deleted file mode 100644 index 225dd44..0000000 --- a/roles/purge_netdata_repository/README.md +++ /dev/null @@ -1,38 +0,0 @@ -Role Name -========= - -A brief description of the role goes here. - -Requirements ------------- - -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. - -Role Variables --------------- - -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. - -Dependencies ------------- - -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. - -Example Playbook ----------------- - -Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: - - - hosts: servers - roles: - - { role: username.rolename, x: 42 } - -License -------- - -BSD - -Author Information ------------------- - -An optional section for the role authors to include contact information, or a website (HTML is not allowed). diff --git a/roles/purge_netdata_repository/defaults/main.yml b/roles/purge_netdata_repository/defaults/main.yml deleted file mode 100644 index 3100664..0000000 --- a/roles/purge_netdata_repository/defaults/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# defaults file for roles/purge_netdata_repository diff --git a/roles/purge_netdata_repository/handlers/main.yml b/roles/purge_netdata_repository/handlers/main.yml deleted file mode 100644 index 069fb85..0000000 --- a/roles/purge_netdata_repository/handlers/main.yml +++ /dev/null @@ -1,12 +0,0 @@ ---- -# handlers file for roles/purge_netdata_repository - -- name: Yum clean metadata - ansible.builtin.command: yum clean metadata - args: - warn: no - -- name: Dnf clean metadata - ansible.builtin.command: dnf clean metadata - args: - warn: no diff --git a/roles/purge_netdata_repository/tasks/Centos7.yml b/roles/purge_netdata_repository/tasks/Centos7.yml deleted file mode 100644 index 1978115..0000000 --- a/roles/purge_netdata_repository/tasks/Centos7.yml +++ /dev/null @@ -1,10 +0,0 @@ ---- - -- name: Remove Netdata configuration package - ansible.builtin.yum: - name: - - netdata - - netdata-repo - - netdata-repo-edge - state: absent - notify: yum-clean-metadata diff --git a/roles/purge_netdata_repository/tasks/Debian10.yml b/roles/purge_netdata_repository/tasks/Debian10.yml deleted file mode 100644 index c98af0e..0000000 --- a/roles/purge_netdata_repository/tasks/Debian10.yml +++ /dev/null @@ -1,25 +0,0 @@ ---- - -- name: Remove Netdata repo key. - ansible.builtin.apt_key: - url: https://packagecloud.io/netdata/netdata-repoconfig/gpgkey - state: absent - -- name: Remove Netdata packages - ansible.builtin.apt: - state: absent - purge: true - name: - - netdata - - netdata-repo - - netdata-repo-edge - -- name: Remove the remains - ansible.builtin.file: - path: "{{ item }}" - state: absent - with_items: - - /var/log/netdata - - /var/lib/netdata - - /var/cache/netdata - - /usr/libexec/netdata diff --git a/roles/purge_netdata_repository/tasks/Debian11.yml b/roles/purge_netdata_repository/tasks/Debian11.yml deleted file mode 100644 index c98af0e..0000000 --- a/roles/purge_netdata_repository/tasks/Debian11.yml +++ /dev/null @@ -1,25 +0,0 @@ ---- - -- name: Remove Netdata repo key. - ansible.builtin.apt_key: - url: https://packagecloud.io/netdata/netdata-repoconfig/gpgkey - state: absent - -- name: Remove Netdata packages - ansible.builtin.apt: - state: absent - purge: true - name: - - netdata - - netdata-repo - - netdata-repo-edge - -- name: Remove the remains - ansible.builtin.file: - path: "{{ item }}" - state: absent - with_items: - - /var/log/netdata - - /var/lib/netdata - - /var/cache/netdata - - /usr/libexec/netdata diff --git a/roles/purge_netdata_repository/tasks/Fedora35.yml b/roles/purge_netdata_repository/tasks/Fedora35.yml deleted file mode 100644 index 0103c5b..0000000 --- a/roles/purge_netdata_repository/tasks/Fedora35.yml +++ /dev/null @@ -1,20 +0,0 @@ ---- - -- name: Remove Netdata packages - ansible.builtin.dnf: - state: absent - name: - - netdata - - netdata-repo - - netdata-repo-edge - notify: dnf-clean-metadata - -- name: Remove the remains - ansible.builtin.file: - path: "{{ item }}" - state: absent - with_items: - - /var/log/netdata - - /var/lib/netdata - - /var/cache/netdata - - /usr/libexec/netdata diff --git a/roles/purge_netdata_repository/tasks/OracleLinux8.yml b/roles/purge_netdata_repository/tasks/OracleLinux8.yml deleted file mode 100644 index 5730e08..0000000 --- a/roles/purge_netdata_repository/tasks/OracleLinux8.yml +++ /dev/null @@ -1,19 +0,0 @@ ---- - -- name: Remove Netdata packages - ansible.builtin.dnf: - state: absent - name: - - "{{ netdata_repo_package }}" - - "{{ netdata_agent_package }}" - notify: dnf-clean-metadata - -- name: Remove the remains - ansible.builtin.file: - path: "{{ item }}" - state: absent - with_items: - - /var/log/netdata - - /var/lib/netdata - - /var/cache/netdata - - /usr/libexec/netdata diff --git a/roles/purge_netdata_repository/tasks/Rocky8.yml b/roles/purge_netdata_repository/tasks/Rocky8.yml deleted file mode 100644 index 0103c5b..0000000 --- a/roles/purge_netdata_repository/tasks/Rocky8.yml +++ /dev/null @@ -1,20 +0,0 @@ ---- - -- name: Remove Netdata packages - ansible.builtin.dnf: - state: absent - name: - - netdata - - netdata-repo - - netdata-repo-edge - notify: dnf-clean-metadata - -- name: Remove the remains - ansible.builtin.file: - path: "{{ item }}" - state: absent - with_items: - - /var/log/netdata - - /var/lib/netdata - - /var/cache/netdata - - /usr/libexec/netdata diff --git a/roles/purge_netdata_repository/tasks/Ubuntu18.yml b/roles/purge_netdata_repository/tasks/Ubuntu18.yml deleted file mode 100644 index 5df4ead..0000000 --- a/roles/purge_netdata_repository/tasks/Ubuntu18.yml +++ /dev/null @@ -1,24 +0,0 @@ ---- - -- name: Remove Netdata repo key. - ansible.builtin.apt_key: - url: https://packagecloud.io/netdata/netdata-repoconfig/gpgkey - state: absent - -- name: Remove Netdata packages - ansible.builtin.apt: - state: absent - purge: true - name: - - netdata - - netdata-repo-edge - -- name: Remove the remains - ansible.builtin.file: - path: "{{ item }}" - state: absent - with_items: - - /var/log/netdata - - /var/lib/netdata - - /var/cache/netdata - - /usr/libexec/netdata diff --git a/roles/purge_netdata_repository/tasks/Ubuntu20.yml b/roles/purge_netdata_repository/tasks/Ubuntu20.yml deleted file mode 100644 index 5df4ead..0000000 --- a/roles/purge_netdata_repository/tasks/Ubuntu20.yml +++ /dev/null @@ -1,24 +0,0 @@ ---- - -- name: Remove Netdata repo key. - ansible.builtin.apt_key: - url: https://packagecloud.io/netdata/netdata-repoconfig/gpgkey - state: absent - -- name: Remove Netdata packages - ansible.builtin.apt: - state: absent - purge: true - name: - - netdata - - netdata-repo-edge - -- name: Remove the remains - ansible.builtin.file: - path: "{{ item }}" - state: absent - with_items: - - /var/log/netdata - - /var/lib/netdata - - /var/cache/netdata - - /usr/libexec/netdata diff --git a/roles/purge_netdata_repository/tasks/Ubuntu22.yml b/roles/purge_netdata_repository/tasks/Ubuntu22.yml deleted file mode 100644 index 5df4ead..0000000 --- a/roles/purge_netdata_repository/tasks/Ubuntu22.yml +++ /dev/null @@ -1,24 +0,0 @@ ---- - -- name: Remove Netdata repo key. - ansible.builtin.apt_key: - url: https://packagecloud.io/netdata/netdata-repoconfig/gpgkey - state: absent - -- name: Remove Netdata packages - ansible.builtin.apt: - state: absent - purge: true - name: - - netdata - - netdata-repo-edge - -- name: Remove the remains - ansible.builtin.file: - path: "{{ item }}" - state: absent - with_items: - - /var/log/netdata - - /var/lib/netdata - - /var/cache/netdata - - /usr/libexec/netdata diff --git a/roles/purge_netdata_repository/tasks/main.yml b/roles/purge_netdata_repository/tasks/main.yml deleted file mode 100644 index c97f993..0000000 --- a/roles/purge_netdata_repository/tasks/main.yml +++ /dev/null @@ -1,9 +0,0 @@ ---- - -# tasks file for roles/purge_netdata_repository - -- name: Include OS specific vars - ansible.builtin.include_vars: "{{ ansible_distribution }}{{ ansible_distribution_major_version }}.yml" - -- name: Include OS specific tasks - ansible.builtin.include_tasks: "{{ ansible_distribution }}{{ ansible_distribution_major_version }}.yml" diff --git a/roles/purge_netdata_repository/tests/inventory b/roles/purge_netdata_repository/tests/inventory deleted file mode 100644 index 878877b..0000000 --- a/roles/purge_netdata_repository/tests/inventory +++ /dev/null @@ -1,2 +0,0 @@ -localhost - diff --git a/roles/purge_netdata_repository/tests/test.yml b/roles/purge_netdata_repository/tests/test.yml deleted file mode 100644 index 5cce06c..0000000 --- a/roles/purge_netdata_repository/tests/test.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- - -- name: "Test for role: purge_netdata_repository" - hosts: localhost - remote_user: root - roles: - - roles/purge_netdata_repository diff --git a/roles/purge_netdata_repository/vars/Centos7.yml b/roles/purge_netdata_repository/vars/Centos7.yml deleted file mode 100644 index 5dd4934..0000000 --- a/roles/purge_netdata_repository/vars/Centos7.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- - -netdata_repo_package: "{{ 'netdata-repo' if distro == 'stable' else 'netdata-repo-edge' }}" diff --git a/roles/purge_netdata_repository/vars/Debian10.yml b/roles/purge_netdata_repository/vars/Debian10.yml deleted file mode 100644 index 6e4e779..0000000 --- a/roles/purge_netdata_repository/vars/Debian10.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- - -dir_list: - - /var/log/netdata - - /var/lib/netdata - - /var/cache/netdata - - /usr/libexec/netdata diff --git a/roles/purge_netdata_repository/vars/Debian11.yml b/roles/purge_netdata_repository/vars/Debian11.yml deleted file mode 100644 index 6e4e779..0000000 --- a/roles/purge_netdata_repository/vars/Debian11.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- - -dir_list: - - /var/log/netdata - - /var/lib/netdata - - /var/cache/netdata - - /usr/libexec/netdata diff --git a/roles/purge_netdata_repository/vars/Fedora35.yml b/roles/purge_netdata_repository/vars/Fedora35.yml deleted file mode 100644 index 3e2b105..0000000 --- a/roles/purge_netdata_repository/vars/Fedora35.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- - -netdata_repo_package: "{{ 'netdata-repo' if distro == 'stable' else 'netdata-repo-edge' }}" -netdata_agent_package: netdata -netdata_agent_service: netdata diff --git a/roles/purge_netdata_repository/vars/OracleLinux8.yml b/roles/purge_netdata_repository/vars/OracleLinux8.yml deleted file mode 100644 index 3e2b105..0000000 --- a/roles/purge_netdata_repository/vars/OracleLinux8.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- - -netdata_repo_package: "{{ 'netdata-repo' if distro == 'stable' else 'netdata-repo-edge' }}" -netdata_agent_package: netdata -netdata_agent_service: netdata diff --git a/roles/purge_netdata_repository/vars/Rocky8.yml b/roles/purge_netdata_repository/vars/Rocky8.yml deleted file mode 100644 index 3e2b105..0000000 --- a/roles/purge_netdata_repository/vars/Rocky8.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- - -netdata_repo_package: "{{ 'netdata-repo' if distro == 'stable' else 'netdata-repo-edge' }}" -netdata_agent_package: netdata -netdata_agent_service: netdata diff --git a/roles/purge_netdata_repository/vars/Ubuntu18.yml b/roles/purge_netdata_repository/vars/Ubuntu18.yml deleted file mode 100644 index 6e4e779..0000000 --- a/roles/purge_netdata_repository/vars/Ubuntu18.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- - -dir_list: - - /var/log/netdata - - /var/lib/netdata - - /var/cache/netdata - - /usr/libexec/netdata diff --git a/roles/purge_netdata_repository/vars/Ubuntu20.yml b/roles/purge_netdata_repository/vars/Ubuntu20.yml deleted file mode 100644 index 6e4e779..0000000 --- a/roles/purge_netdata_repository/vars/Ubuntu20.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- - -dir_list: - - /var/log/netdata - - /var/lib/netdata - - /var/cache/netdata - - /usr/libexec/netdata diff --git a/roles/purge_netdata_repository/vars/Ubuntu22.yml b/roles/purge_netdata_repository/vars/Ubuntu22.yml deleted file mode 100644 index 6e4e779..0000000 --- a/roles/purge_netdata_repository/vars/Ubuntu22.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- - -dir_list: - - /var/log/netdata - - /var/lib/netdata - - /var/cache/netdata - - /usr/libexec/netdata diff --git a/roles/purge_netdata_repository/vars/main.yml b/roles/purge_netdata_repository/vars/main.yml deleted file mode 100644 index 84ad313..0000000 --- a/roles/purge_netdata_repository/vars/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# vars file for roles/purge_netdata_repository diff --git a/tasks/configure-linux.yml b/tasks/configure-linux.yml new file mode 100644 index 0000000..512c428 --- /dev/null +++ b/tasks/configure-linux.yml @@ -0,0 +1,47 @@ +- name: Apply the netdata.conf.j2 template + ansible.builtin.template: + src: "{{ netdata_custom_config_path }}" + dest: "{{ netdata_config_dir }}/netdata.conf" + owner: root + group: netdata + mode: '0644' + when: + - netdata_manage_config + - netdata_custom_config_path != "" + notify: Restart Netdata + +- name: Configure Go Collector Plugins + ansible.builtin.template: + src: go.d/plugin.conf.j2 + dest: "{{ netdata_config_dir }}/go.d/{{ item.name }}.conf" + owner: root + group: netdata + mode: '0644' + loop: "{{ netdata_go_collector_plugins }}" + loop_control: + label: "{{ item.name | default(omit) }}" + when: + - 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 }}" + dest: "{{ netdata_chart_dir }}/{{ item | basename | regex_replace('\\.j2$', '') }}" + owner: root + group: netdata + mode: '0750' + loop: "{{ lookup('fileglob', netdata_custom_charts_path + '/*.j2', wantlist=True) }}" + when: + - netdata_manage_charts and netdata_custom_charts_path != "" + notify: Restart Netdata diff --git a/tasks/install-debian.yml b/tasks/install-debian.yml new file mode 100644 index 0000000..46baa89 --- /dev/null +++ b/tasks/install-debian.yml @@ -0,0 +1,39 @@ +--- + +- name: Add repo and install package + block: + +# Debian + + - name: Ensure gpg is installed. + ansible.builtin.apt: + name: gnupg + state: present + update_cache: true + + - name: Install Netdata repo key. + ansible.builtin.apt_key: + url: "{{ netdata_repository_key_url }}" + 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 }}/ + state: present + + - name: Install package + ansible.builtin.apt: + name: "netdata" + state: present + install_recommends: true + update_cache: true + notify: Restart Netdata + + - name: Install chart support if enabled + ansible.builtin.apt: + name: "netdata-plugin-chartsd" + state: present + notify: Restart Netdata + when: netdata_manage_charts diff --git a/tasks/install-opensuse.yml b/tasks/install-opensuse.yml new file mode 100644 index 0000000..499dcb9 --- /dev/null +++ b/tasks/install-opensuse.yml @@ -0,0 +1,50 @@ +--- + +# Suse + +- name: Add repo and install package + block: + + - name: Add netfilter repository configuration + community.general.zypper_repository: + repo: "https://download.opensuse.org/repositories/security:netfilter/openSUSE_Tumbleweed/security:netfilter.repo" + state: present + auto_import_keys: true + + - name: Install dependencies + community.general.zypper: + name: libnetfilter_acct1 + state: present + + - name: Import Netdata GPG key + ansible.builtin.rpm_key: + state: present + key: "{{ netdata_repository_key_url }}" + + - name: Add repository + community.general.zypper_repository: + name: "netdata" + repo: "{{ netdata_repository_url }}{{ netdata_release_version }}/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" + state: present + auto_import_keys: true + + - name: Install package + community.general.zypper: + name: netdata + state: present + disable_recommends: false + notify: Restart Netdata + + - name: Install chart support if enabled + community.general.zypper: + name: netdata-plugin-chartsd + state: present + notify: Restart Netdata + when: netdata_manage_charts diff --git a/tasks/install-ubuntu.yml b/tasks/install-ubuntu.yml new file mode 100644 index 0000000..3e88788 --- /dev/null +++ b/tasks/install-ubuntu.yml @@ -0,0 +1,37 @@ +--- + +- name: Add repo and install package + block: + + - name: Ensure gpg is installed. + ansible.builtin.apt: + name: gnupg + state: present + update_cache: true + + - name: Install Netdata repo key. + ansible.builtin.apt_key: + url: "{{ netdata_repository_key_url }}" + 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 }}/ + state: present + + - name: Install package + ansible.builtin.apt: + name: "netdata" + state: present + install_recommends: true + update_cache: true + notify: Restart Netdata + + - name: Install chart support if enabled + ansible.builtin.apt: + name: "netdata-plugin-chartsd" + state: present + notify: Restart Netdata + when: netdata_manage_charts diff --git a/tasks/main.yml b/tasks/main.yml new file mode 100644 index 0000000..f58f37a --- /dev/null +++ b/tasks/main.yml @@ -0,0 +1,24 @@ +--- + +- 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: 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 OpenSUSE + ansible.builtin.include_tasks: install-opensuse.yml + when: "'opensuse' in ansible_facts.distribution | lower" + +- name: Configure the Netdata Linux agent + ansible.builtin.include_tasks: configure-linux.yml + when: netdata_manage_config and ansible_facts.os_family != "Windows" and ansible_facts.os_family != "Darwin" + +- name: Claim node if claim_token + ansible.builtin.include_tasks: node_claim.yml + when: netdata_claim diff --git a/tasks/node_claim.yml b/tasks/node_claim.yml new file mode 100644 index 0000000..2733169 --- /dev/null +++ b/tasks/node_claim.yml @@ -0,0 +1,10 @@ +--- + +- name: Create node claim file + ansible.builtin.template: + src: claim.conf.j2 + dest: "{{ netdata_config_dir }}/claim.conf" + owner: root + group: root + mode: '0644' + notify: Restart Netdata diff --git a/templates/claim.conf.j2 b/templates/claim.conf.j2 new file mode 100644 index 0000000..7d266c0 --- /dev/null +++ b/templates/claim.conf.j2 @@ -0,0 +1,8 @@ +[global] + url = {{ netdata_claim_url }} + token = {{ netdata_claim_token }} + rooms = {{ netdata_claim_rooms }} + {% if netdata_proxy %} + proxy = {{ netdata_proxy }} + {% endif %} + insecure = 'no' diff --git a/templates/go.d/plugin.conf.j2 b/templates/go.d/plugin.conf.j2 new file mode 100644 index 0000000..1d5c1c0 --- /dev/null +++ b/templates/go.d/plugin.conf.j2 @@ -0,0 +1,3 @@ +{{ ansible_managed | comment }} + +{{ item.config | to_nice_yaml(indent=2) }} diff --git a/roles/install_netdata_repository/vars/CentOS7.yml b/tests/example.chart.j2 similarity index 100% rename from roles/install_netdata_repository/vars/CentOS7.yml rename to tests/example.chart.j2 diff --git a/tests/netdata.conf.j2 b/tests/netdata.conf.j2 new file mode 100644 index 0000000..e69de29 diff --git a/tests/test.yml b/tests/test.yml new file mode 100644 index 0000000..a50db83 --- /dev/null +++ b/tests/test.yml @@ -0,0 +1,10 @@ +# CI test against localhost +- name: CI tests for localhost + hosts: localhost + roles: + - role: ../netdata-ansible + vars: + netdata_manage_config: true + netdata_manage_charts: true + netdata_custom_config_path: "netdata.conf.j2" + netdata_custom_charts_path: "example.chart.j2" diff --git a/vars/main.yml b/vars/main.yml new file mode 100644 index 0000000..01ab1e4 --- /dev/null +++ b/vars/main.yml @@ -0,0 +1,2 @@ +--- +# vars file for role