Compare commits

...

2 Commits

Author SHA1 Message Date
acec77ca5b Add handlers back to common role 2021-01-23 18:45:32 -06:00
7e8e9563fd Add Netdata role 2021-01-23 18:45:20 -06:00
73 changed files with 8261 additions and 0 deletions

View File

@ -11,6 +11,7 @@ apache_mods_enabled:
- rewrite.load
- ssl.load
apache_mods_disabled:
- mpm_event.load
- mpm_prefork.load
- php7.4.load
apache_global_vhost_settings: |

View File

@ -0,0 +1,8 @@
#!/usr/bin/env ansible-playbook
# vim:ft=ansible:
- name: restart cron
service: name=cron state=restarted
become: yes
- name: regen initramfs
command: /usr/sbin/update-initramfs -c -k all
become: yes

View File

@ -0,0 +1,2 @@
skip_list:
- 106

2
roles/netdata/.flake8 Normal file
View File

@ -0,0 +1,2 @@
[flake8]
exclude = venv/

View File

@ -0,0 +1,36 @@
---
name: Molecule Test
on: push
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
max-parallel: 4
matrix:
molecule_distro:
- centos7
- centos8
# - debian8
- debian9
- debian10
# - fedora
- ubuntu1604
- ubuntu1804
- ubuntu2004
steps:
- uses: actions/checkout@v1
- name: Set up Python 3
uses: actions/setup-python@v1
with:
python-version: "3.x"
- name: Install dependencies
run: |
python -m pip install --upgrade pip pip-tools
pip-sync requirements.txt requirements-dev.txt
ansible --version
molecule --version
- name: Test with molecule
run: |
molecule test --scenario-name ${{ matrix.molecule_distro }}

1
roles/netdata/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
venv/

View File

@ -0,0 +1,65 @@
---
image: docker:git
services:
- docker:dind
stages:
- molecule-test
before_script:
- apk update && apk add --no-cache docker
python3-dev py3-pip docker gcc git curl build-base
autoconf automake py3-cryptography linux-headers
musl-dev libffi-dev openssl-dev openssh
- docker info
- python3 --version
- pip3 install --upgrade pip pip-tools
- pip-sync requirements.txt requirements-dev.txt
- ansible --version
- molecule --version
centos7:
stage: molecule-test
script:
- molecule test --scenario-name centos7
centos8:
stage: molecule-test
script:
- molecule test --scenario-name centos8
# debian8:
# stage: molecule-test
# script:
# - molecule test --scenario-name debian8
debian9:
stage: molecule-test
script:
- molecule test --scenario-name debian9
debian10:
stage: molecule-test
script:
- molecule test --scenario-name debian10
# fedora:
# stage: molecule-test
# script:
# - molecule test --scenario-name fedora
ubuntu1604:
stage: molecule-test
script:
- molecule test --scenario-name ubuntu1604
ubuntu1804:
stage: molecule-test
script:
- molecule test --scenario-name ubuntu1804
ubuntu2004:
stage: molecule-test
script:
- molecule test --scenario-name ubuntu2004

26
roles/netdata/.travis.yml Normal file
View File

@ -0,0 +1,26 @@
---
sudo: required
language: python
services:
- docker
before_install:
- sudo apt-get -qq update
env:
- molecule_distro=centos7
- molecule_distro=centos8
# - molecule_distro=debian8
- molecule_distro=debian9
- molecule_distro=debian10
# - molecule_distro=fedora
- molecule_distro=ubuntu1604
- molecule_distro=ubuntu1804
- molecule_distro=ubuntu2004
install:
- pip3 install --upgrade pip pip-tools
- pip-sync requirements.txt requirements-dev.txt
- ansible --version
- molecule --version
script:
- molecule test --scenario-name "$molecule_distro"
notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/

36
roles/netdata/.yamllint Normal file
View File

@ -0,0 +1,36 @@
---
# Based on ansible-lint config
extends: default
ignore: |
venv/
rules:
braces:
max-spaces-inside: 1
level: error
brackets:
max-spaces-inside: 1
level: error
colons:
max-spaces-after: -1
level: error
commas:
max-spaces-after: -1
level: error
comments: disable
comments-indentation: disable
document-start: disable
empty-lines:
max: 3
level: error
hyphens:
level: error
indentation: disable
key-duplicates: enable
line-length: disable
new-line-at-end-of-file: disable
new-lines:
type: unix
trailing-spaces: disable
truthy: disable

429
roles/netdata/CHANGELOG.md Normal file
View File

@ -0,0 +1,429 @@
commit 3293b627f4ebd71094352a334a820a39b7563560
Author: Larry Smith Jr <mrlesmithjr@gmail.com>
Date: Fri Sep 11 02:18:57 2020 -0400
Disabled Fedora testing
Will come back to this later. Fedora support will address issue #11
commit fc685ad8aa5cf3ea67e9889206a4da7c77c5c1db
Author: Larry Smith Jr <mrlesmithjr@gmail.com>
Date: Fri Sep 11 02:16:51 2020 -0400
Added skip Ansible lint role name check
commit 69a9f60f2e950212ec598276adb16e6ef08637bc
Author: Larry Smith Jr <mrlesmithjr@gmail.com>
Date: Fri Sep 11 02:16:26 2020 -0400
Updated Ansible roles requirements
commit bfd04aec90ad4ef5fa67826d6e6ca5638e16fb86
Author: Larry Smith Jr <mrlesmithjr@gmail.com>
Date: Fri Sep 11 02:15:50 2020 -0400
Fixed Ubuntu 20.04 install
Fixes #49
commit 33051c6bf351ff31e404977146bc8ab53fe679f3
Author: Larry Smith Jr <mrlesmithjr@gmail.com>
Date: Fri Sep 11 01:50:52 2020 -0400
Molecule tests updated
All Molecule testing scenarios have been updated
commit 3b137d1dd7ada72ae0fe725ed492b32786eb62cc
Author: Larry Smith Jr <mrlesmithjr@gmail.com>
Date: Fri Sep 11 01:48:19 2020 -0400
Linting configs added
- Ansible Lint
- Flake8
commit 074ecfe95c26ab5d4aa9e4d050ac8f0767efb1f2
Author: Larry Smith Jr <mrlesmithjr@gmail.com>
Date: Fri Sep 11 01:47:13 2020 -0400
Python Requirements updated
All prod/development Python requirements updated
commit 770a020914a8ccd8e86ff72a7c8044997bbd2bc7
Author: Larry Smith Jr <mrlesmithjr@gmail.com>
Date: Fri Sep 11 01:46:18 2020 -0400
Updated CI tests
The following CI tests have been updated:
- GitLab CI
- Travis CI
- GitHub Actions
commit 06d64bb66479600e6201bfe36d6e56b065d07cc3
Author: Felix Bechstein <f@ub0r.de>
Date: Tue May 26 15:46:16 2020 +0200
fix install on EL8
commit 7af8e3e7b92e3c2978d9b3c6c9b5f52e0e6970c3
Author: Larry Smith Jr <mrlesmithjr@gmail.com>
Date: Sat Feb 22 00:43:52 2020 -0500
Disabled Fedora testing
- Issues that need to be addressed later
commit 698968e7017bbbc966ae1a2941d083ce2f1e0ab1
Author: Larry Smith Jr <mrlesmithjr@gmail.com>
Date: Sat Feb 22 00:07:52 2020 -0500
Changed Molecule scenarios, tests, etc.
commit 28b89f420ed34d6dc2f7afdf1bdb5e834b954ef8
Author: Larry Smith Jr <mrlesmithjr@gmail.com>
Date: Sat Feb 22 00:06:36 2020 -0500
Updated files, etc. after new structure
commit a8af449baae441aa7df3b97281413e6eea7cac4e
Author: Larry Smith Jr <mrlesmithjr@gmail.com>
Date: Wed Feb 19 11:53:22 2020 -0500
New files, etc. from cookiecutter template
commit 8f8e58d2f7249ee42488b6b4b3ccd4d334a7087e
Author: Larry Smith Jr <mrlesmithjr@gmail.com>
Date: Wed Feb 19 11:52:36 2020 -0500
Changes made based on new Molecule testing, etc.
- When testing a few things were uncovered and have been addressed at
this time.
commit 8ba792745746bc7ce0d7f07ab19b32ab20ea9829
Author: Larry Smith Jr <mrlesmithjr@gmail.com>
Date: Wed Feb 19 11:51:28 2020 -0500
Changes made based on implementing cookiecutter template
commit 691d32487e0d8e9c9d1952d0f73ec8865c7c6b67
Author: Larry Smith Jr <mrlesmithjr@gmail.com>
Date: Wed Feb 19 00:34:35 2020 -0500
Replaced previous Molecule testing with new
commit a6f810256600ea16589a697b6c08838a6be34106
Author: Gaëtan Duchaussois <gaetan.duchaussois@fretlink.com>
Date: Mon Feb 10 16:54:12 2020 +0100
Add client tls configuration for streams
commit 397a64b863c2d808b919512378a30640f73e02cb
Author: Gaëtan Duchaussois <gaetan.duchaussois@fretlink.com>
Date: Tue Feb 11 09:48:52 2020 +0100
force systemd for Ubuntu 16.04
commit 65b4fe5f83890e4dbc252594dad6983346f6b3d1
Author: Gaëtan Duchaussois <gaetan.duchaussois@fretlink.com>
Date: Mon Feb 10 17:09:53 2020 +0100
add missing dependencies
commit 436a8dbe694638d3fb46167f7833614b6b418821
Author: Gaëtan Duchaussois <gaetan.duchaussois@fretlink.com>
Date: Mon Feb 10 18:28:47 2020 +0100
CI: remove ubuntu 14.04 support reenable 16.04 support
commit 8ccc6040a722a919003560312b3ad6d426d6ca26
Author: Larry Smith Jr <mrlesmithjr@gmail.com>
Date: Thu Aug 1 08:02:54 2019 -0400
Resolved formatting/task issues with Molecule testing
- some services needed to be tweaked to account for sysvinit
- linting issues were found and resolved
commit 01c046a3939bf586a2de6a51c7ded3a1314eeaba
Author: Larry Smith Jr <mrlesmithjr@gmail.com>
Date: Thu Aug 1 08:00:47 2019 -0400
Added Molecule testing
- Added Default (Docker) testing
- Added vagrant (Vagrant) testing
commit d89c224662a82106e341532b7f43cdf2a857acdf
Author: Larry Smith Jr <mrlesmithjr@gmail.com>
Date: Thu Aug 1 07:59:35 2019 -0400
Removed previous Travis testing methods
commit 5dfb9a50dd62e20dce76e04c57eb9287e58069fb
Author: Gaëtan Duchaussois <gaetan.duchaussois@fretlink.com>
Date: Thu Jul 25 15:11:52 2019 +0200
fix template logic for proxy
commit acb35c700fed298f0aad275bb15079e4435d0e4f
Author: Gaëtan Duchaussois <gaetan.duchaussois@fretlink.com>
Date: Mon Jul 22 14:04:24 2019 +0200
Feature: a netdata host can be defined as a proxy for streaming
commit 4e05065736e2ae6fb2caf629aadcfbde040d0741
Author: Alexandre Garand <alexandre.garand@fretlink.com>
Date: Mon Jul 22 17:13:19 2019 +0200
define variable to configure repeat frequency of alarms
commit d7b5c1ed16f78beae2783b29794856b1d8275cce
Author: Alexandre Garand <alexandre.garand@fretlink.com>
Date: Tue Jul 23 11:09:21 2019 +0200
replace blockinfile task by template task to manage health_alarm_notify.conf and add a variable to manage custom_sender_function
commit 39c397b456385d197222378faa53c09d3a7fd68a
Author: Paul B <paul@bonaud.fr>
Date: Fri Jul 12 11:30:35 2019 +0200
auto-update: don't break existing configurations
commit dbcc7a56df9f70594c83709ed43a411ade497b58
Author: Paul B <paul@bonaud.fr>
Date: Thu Jul 11 18:00:59 2019 +0200
auto-udpate: since Netdata v1.11 the auto-updater cron is automatic
Netdata v1.11 now installs the cron by itself and the installer takes
an `--auto-update` option to install the updater script.
commit 9f6ceff7f4304c3affcf6016b79d08b4d6c74290
Author: Markus Binsteiner <makkus@frkl.io>
Date: Wed May 22 16:59:44 2019 +0200
Fix for version check logic. did not work on Debian stretch.
commit 513be125f0515646a3d391b0c9c2cec1c20429c1
Author: Soumik <soumik@soumikghosh.com>
Date: Wed Mar 13 10:09:15 2019 -0400
Don't use a loop for installing pre-requisites
commit 61a0dbe347de54c3086f83363de73a0ac60f034a
Author: Soumik <soumik@soumikghosh.com>
Date: Wed Dec 19 18:32:40 2018 -0500
Make web mode configurable
commit 624f8167c6880b48faf6e6af2321e2ed331771ed
Author: Mickaël PERRIN <dev@mickaelperrin.fr>
Date: Tue Dec 18 06:22:15 2018 +0100
[BUGFIX] Notifications are not sent
Missing permissions on /etc/netdata/health_alarm_notify.conf file
commit 21e1af7238e4419da98d24a30ac296563dbfe017
Author: bunchc <bunchc@gmail.com>
Date: Mon Dec 10 10:42:33 2018 -0600
Updating netdata git url to fix #23
Netdata changed git URLs. This broke auto updating. Uninstalling netdata and reinstalling with the correct URL addresses this.
This pull fixes #23
commit 375b546d1981908e2e4d19379746328d73965dda
Author: Gaëtan Duchaussois <gaetan.duchaussois@fretlink.com>
Date: Wed Oct 10 11:33:50 2018 +0200
Fix alarm configuration failing when file doesn't exists
commit 152ad798977348b251774f9dabe66420be803ca6
Author: John Hogenmiller <john@yourtech.us>
Date: Tue Oct 9 08:38:37 2018 -0400
Allow restart on failure
This will cause the service to restart if it gets shut down uncleanly. It will wait 30 seconds between restart attempts
commit 7fe32b4392addde72cb7a0ebf1e2d5e35963af6f
Author: Gaëtan Duchaussois <gaetan.duchaussois@fretlink.com>
Date: Mon Oct 8 17:59:31 2018 +0200
really set netdata_hostname in backend and registry
commit b07e88495f23875707d9885563dfea1e379d9402
Author: Gaëtan Duchaussois <gaetan.duchaussois@fretlink.com>
Date: Wed Oct 3 19:41:15 2018 +0200
Allow hostname customisation
commit fd1724ae622dcd4225e1515e0de280d021e16e6a
Author: Guillaume Grussenmeyer <ggrussenmeyer@solent.fr>
Date: Wed Aug 29 18:50:53 2018 +0200
Added support for specifying master node port for streaming.
commit cdf12fa35fda8499512e286142313b106bd9f9a9
Author: Maxime Loliée <maxime@siliadev.com>
Date: Fri Jul 27 11:23:58 2018 +0200
Added some new parameters for tunning flood protection
commit 9d5d82db40ac80722d8c94d302e6db5815ec0e78
Author: Larry Smith Jr <mrlesmithjr@gmail.com>
Date: Mon Apr 30 10:04:56 2018 -0400
Resolved Ubuntu 18.04 install
This resolves #12
The iproute package no longer exists in Ubuntu 18.04 default
installation so we needed to exclude installing this package only on
Ubuntu 18.04+.
commit b2e0c932a534c637f284c91c9e7e4cf82e044062
Author: Larry Smith Jr <mrlesmithjr@gmail.com>
Date: Mon Apr 30 01:04:28 2018 -0400
Added Debian Stretch as supported distro
commit abe5dbfd6bef04107412637f56e01f554e5834b7
Author: Larry Smith Jr <mrlesmithjr@gmail.com>
Date: Mon Apr 30 00:55:42 2018 -0400
Disabled Fedora and Ubuntu 18.04 testing
Fedora support is not available. Issue logged
https://github.com/mrlesmithjr/ansible-netdata/issues/11
Ubuntu Bionic(18.04) is failing by trying to install iproute which is
not available. Issue logged for this
https://github.com/mrlesmithjr/ansible-netdata/issues/12
commit 49333b4004be45718542d3bf3f6d9dd91cfd8e9d
Author: Larry Smith Jr <mrlesmithjr@gmail.com>
Date: Mon Apr 30 00:41:09 2018 -0400
Added build status
commit ec0964157a169daef106dc79b5542c7e581565a8
Author: Larry Smith Jr <mrlesmithjr@gmail.com>
Date: Mon Apr 30 00:40:58 2018 -0400
Added cron package as pre-req
This package should exist anyways but to ensure that it is available we
will install as a pre-req. This was discovered as testing with Travis-CI
because cron is not installed in base container images.
commit 840ba74f3a2534cb064ea71afcab9181fea40227
Author: Larry Smith Jr <mrlesmithjr@gmail.com>
Date: Mon Apr 30 00:22:00 2018 -0400
Implemented new Travis-CI testing
commit 049ca80f081b86ab348683f5b3b05fd52bdbe097
Author: Larry Smith Jr <mrlesmithjr@gmail.com>
Date: Sat Apr 14 22:27:34 2018 -0400
Resolves #10
commit 5ed1ff2c63f91277e80bd0ee79f8c74099b4302b
Author: bunchc <bunchc@gmail.com>
Date: Fri Apr 13 13:05:27 2018 -0500
Adding configuration for netdata backends.
* defaults/main.yml - added backend configuration variables
* templates/netdata.conf.j2 - Added if/then logic around backend configuration
commit 1bbdd00354b3ee146c616d97c040290eec9fd212
Author: Larry Smith Jr <mrlesmithjr@gmail.com>
Date: Mon Mar 19 23:35:10 2018 -0400
Create LICENSE
commit 2a6e440982728836db6dceddb53e7b45a3ae5ac6
Author: Larry Smith Jr <mrlesmithjr@gmail.com>
Date: Mon Mar 19 23:33:45 2018 -0400
Split example playbook out into it's own file w/reference in README
commit 868f4f17e8f7584a25d12f64386c25a5f09aa365
Author: Larry Smith Jr <mrlesmithjr@gmail.com>
Date: Mon Mar 19 23:33:22 2018 -0400
Cleaned up repo info and added TOC
commit b88d79cabf224af9067f2d2aa891e38584dc5584
Author: Larry Smith Jr <mrlesmithjr@gmail.com>
Date: Mon Mar 19 23:33:09 2018 -0400
Cleaned up Ansible Galaxy meta info
commit fdad094eb31621faeac52e49e2d00527a32b0822
Author: Larry Smith Jr <mrlesmithjr@gmail.com>
Date: Mon Mar 19 23:32:49 2018 -0400
Cleaned formatting of vars and tasks
Removed single/double quotes where not needed to make code cleaner. Also
changed single quotes to double quotes where they are needed.
commit 57e651426935598e7c40b1d93c2f323803f4c49c
Author: John H <john.hogenmiller@emc.com>
Date: Wed Feb 21 11:29:32 2018 -0500
Alarms customization
commit b452a5b75826c15c005eada11f4bc5d365f69495
Author: Sylvester Neau <neau@lemonde.fr>
Date: Wed Jan 3 16:43:21 2018 +0100
feat: add Netdata streaming configuration
commit 2023a45956fad6edfc03b441c0472f08a2c4eba5
Author: Chris <github.account@chrigel.net>
Date: Mon Jan 29 21:00:05 2018 +0100
Fix yaml syntax error.
commit c8a1b94391b50e3607b5668e5f04e08ba7431658
Author: Chris <github.account@chrigel.net>
Date: Mon Jan 29 10:44:19 2018 +0100
Removed restart handler from forced updater. The update script does that already.
commit 10df439ae354ae09602930c00721b20605eb27b6
Author: Chris <github.account@chrigel.net>
Date: Mon Jan 29 10:40:27 2018 +0100
Add forced update flag.
commit 01aaef8a28fb6c825216fb1fe84253bedc7c6723
Author: Larry Smith Jr <mrlesmithjr@gmail.com>
Date: Fri Apr 28 23:01:38 2017 -0400
Added CentOS 6/7 functionality
Signed-off-by: Larry Smith Jr <mrlesmithjr@gmail.com>
commit 13615487c89b40bf9db794d6142b6d68f9402ad3
Author: Larry Smith Jr <mrlesmithjr@gmail.com>
Date: Fri Apr 28 19:15:29 2017 -0400
Removed reloading of systemd when using upstart
Signed-off-by: Larry Smith Jr <mrlesmithjr@gmail.com>
commit 0ee4c8ee1fe94df91630b2e5d75aa91e66cfa6e4
Author: Larry Smith Jr <mrlesmithjr@gmail.com>
Date: Fri Apr 28 19:11:24 2017 -0400
first commit

View File

@ -0,0 +1,76 @@
# Contributor Covenant Code of Conduct
## Our Pledge
In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.
## Our Standards
Examples of behavior that contributes to creating a positive environment
include:
- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
- The use of sexualized language or imagery and unwelcome sexual attention or
advances
- Trolling, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or electronic
address, without explicit permission
- Other conduct which could reasonably be considered inappropriate in a
professional setting
## Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.
## Scope
This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at mrlesmithjr@gmail.com. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
[homepage]: https://www.contributor-covenant.org
For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq

View File

@ -0,0 +1,9 @@
# Contributing to ansible-netdata
## Table Of Contents
[Code of Conduct](#code-of-conduct)
## Code of Conduct
This project and everyone participating in it is governed by the [ansible-netdata Code of Conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. Please report unacceptable behavior to [mrlesmithjr@gmail.com](mailto:mrlesmithjr@gmail.com).

View File

@ -0,0 +1 @@
Larry Smith Jr. - mrlesmithjr@gmail.com

21
roles/netdata/LICENSE.md Normal file
View File

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2020 Larry Smith Jr.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

42
roles/netdata/README.md Normal file
View File

@ -0,0 +1,42 @@
# ansible-netdata
Ansible role to install/configure Netdata
## Build Status
### GitHub Actions
![Molecule Test](https://github.com/mrlesmithjr/ansible-netdata/workflows/Molecule%20Test/badge.svg)
### Travis CI
[![Build Status](https://travis-ci.org/mrlesmithjr/ansible-netdata.svg?branch=master)](https://travis-ci.org/mrlesmithjr/ansible-netdata)
## Requirements
For any required Ansible roles, review:
[requirements.yml](requirements.yml)
## Role Variables
[defaults/main.yml](defaults/main.yml)
## Dependencies
## Example Playbook
[playbook.yml](playbook.yml)
## License
MIT
## Author Information
Larry Smith Jr.
- [@mrlesmithjr](https://twitter.com/mrlesmithjr)
- [mrlesmithjr@gmail.com](mailto:mrlesmithjr@gmail.com)
- [http://everythingshouldbevirtual.com](http://everythingshouldbevirtual.com)
> NOTE: Repo has been created/updated using [https://github.com/mrlesmithjr/cookiecutter-ansible-role](https://github.com/mrlesmithjr/cookiecutter-ansible-role) as a template.

View File

@ -0,0 +1,213 @@
---
# defaults file for ansible-netdata
# Adds installer flag to enable auto updates
# https://docs.netdata.cloud/packaging/installer/update/#auto-update
netdata_auto_updates:
enabled: true
day: "*"
hour: 6
minute: 0
user: root
weekday: "*"
# WARNING: when you set this variable to 'true' and are migrating from an old version
# of Netdata (< v1.11.0) then the cron will be removed from your system.
# You will then need to launch the netdata installer manually to make sure
# netdata installs the cron by itself with: `./netdata-installer.sh --auto-update`
clean_legacy_cron: true
# The IP address and port to listen to. This is a space separated list of
# IPv4 or IPv6 address and ports. The default will bind to all IP addresses
netdata_bind_to:
- "*"
# Defines if Netdata should be configured
netdata_config: true
# Defines location of Netdata configuration file
netdata_config_file: /etc/netdata/netdata.conf
# Defines the Git repo to pull down for installs
netdata_git_repo: https://github.com/netdata/netdata.git
# Defines the version tag to clone for installation
netdata_git_version_tag: v1.25.0
# Defines whether Netdata health is enabled
netdata_health_enabled: true
# Defines if Netdata health alarms should be configured
netdata_alarm_configure: false
# Defines location of Netdata health_alarm_notify.conf
netdata_alarm_config_file: /etc/netdata/health_alarm_notify.conf
# Define configuration for health_alarm_notify.conf.
# Example:
# netdata_health_alarm_notify_configs:
# https_proxy: http://localhost:3128
# SLACK_WEBHOOK_URL: https://hooks.slack.com/...
netdata_alarm_notify_configs: {}
# Define custom_sender function in health_alarm_notify.conf
# only the body of the function should be in there
# Exemple: netdata_custom_sender_function: "curl -X POST url"
# netdata_custom_sender_function: ""
# Defines path to alarm-notify.sh
netdata_health_alarm_script: /usr/libexec/netdata/plugins.d/alarm-notify.sh
# Defines how often a critical alarm is repeated
netdata_default_repeat_critical: never
# Defines how often a warning alarm is repeated
netdata_default_repeat_warning: never
# The host name displayed in netdata
netdata_hostname: "{{ ansible_hostname }}"
# The number of entries the netdata daemon will by default keep in memory
# for each chart dimension.
netdata_history: 3996
# Defines Netdata installer script
netdata_installer: ./netdata-installer.sh
# Defines Netdata requirements installer script
netdata_requirements_installer: packaging/installer/install-required-packages.sh
# Defines Netdata requirements installer options (if we want morre complete requirements)
netdata_requirements_installer_options:
- "--non-interactive"
- netdata
# When set to save netdata will save its round robin database on exit and
# load it on startup. When set to map the cache files will be updated in
# real time (check man mmap - do not set this on systems with heavy load or
# slow disks - the disks will continuously sync the in-memory database of
# netdata). When set to ram the round robin database will be temporary and it
# will be lost when netdata exits.
netdata_memory_mode: save
# This variables are only used if netdata_memory_mode is set to dbengine
netdata_dbengine_page_cache_size: 32
netdata_dbengine_multihost_disk_space: 256
# Defines the mode the web-server will run in
# static-threaded is a web server with a fix (configured number of threads)
# single-threaded is a simple web server running with a single thread
# multi-threaded is a web server that spawns a thread for each client connection
# none will disable the web-server and the API
netdata_web_mode: multi-threaded
# The default port to listen for web clients.
netdata_default_port: 19999
netdata_epel_setup: false
netdata_epel_repo_url: "https://dl.fedoraproject.org/pub/epel/epel-release-latest-{{ ansible_distribution_major_version }}.noarch.rpm"
netdata_epel_repo_gpg_key_url: "https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-{{ ansible_distribution_major_version }}"
netdata_epel_repofile_path: "/etc/yum.repos.d/epel.repo"
netdata_centos6_install_okay: false
# Defines if Netdata host should be enabled as a registry
# https://github.com/firehol/netdata/wiki/mynetdata-menu-item
netdata_registry_enabled: false
# https://registry.my-netdata.io
# https://github.com/firehol/netdata/wiki/mynetdata-menu-item
netdata_registry_to_announce: https://registry.my-netdata.io
# Defines directory to store install source from Git repo
netdata_source_dir: /usr/local/src/netdata
# Defines if Netdata streaming should be configured
# https://github.com/firehol/netdata/wiki/Monitoring-ephemeral-nodes
netdata_stream_enabled: false
# Defines location of Netdata stream configuration file
netdata_stream_config_file: /etc/netdata/stream.conf
# Defines Netdata API Keys (must be generated with command uuidgen)
netdata_stream_api_key: 11111111-2222-3333-4444-555555555555
netdata_stream_send_api_key: "{{ netdata_stream_api_key }}"
netdata_stream_receive_api_key: "{{ netdata_stream_api_key }}"
# Defines Netdata master node and port (e.g. 127.0.0.1:19999)
netdata_stream_master_node: ""
# Defines whether the netdata node is acting as a proxy
netdata_stream_proxy: false
# Defines client ssl configuration
# netdata_client_ssl_options:
# ssl skip certificate verification: "yes"
# CAfile: /etc/ssl/certs/ca-certificates.crt
netdata_client_ssl_options: {}
# Defines if Netdata should be uninstalled
# Caution: This does not prompt for uninstall as the original script
# was intended.
# https://github.com/firehol/netdata/wiki/Installation#uninstalling-netdata
netdata_uninstall: false
# Defines the Netdata uninstaller script
netdata_uninstaller: ./netdata-uninstaller.sh
# Defines if Netdata should be updated
# Not the same as auto_updates
netdata_update: false
# Force the update. Sometimes the update script skips installing new plugins.
netdata_update_force: false
# The frequency in seconds, for data collection
netdata_update_every: 1
# Defines Netdata update script
netdata_updater: ./netdata-updater.sh
# Defines Netdata user info
netdata_user_info:
group: netdata
user: netdata
# Defines if Netdata should store data in a backend
netdata_configure_archive: false
# Defines Netdata backend for long term datastorage
# https://github.com/firehol/netdata/wiki/netdata-backends
# Defines if the Netdata backend is enabled
netdata_archive_enabled: "yes"
# Defines the backend type as one of
# graphite | opentsdb | json
netdata_archive_type: "opentsdb"
# Defines the host(s) and ports netdata should send data to
netdata_archive_destination:
- localhost
# - "{{ vip }}:5252"
# Defines how to send the archive data as one of
# as collected, average, sum
netdata_archive_data_source: "average"
# Defines a prefix for the archive data
netdata_archive_prefix: "netdata"
# Defines how often to send archive data in seconds
netdata_archive_update: 1
# Defines the number of update intervals
# after which dataloss occurs
netdata_archive_buffer_on_failures: 30
# Defines when to timeout sending to a backend in milliseconds
netdata_archive_timeout: 20000
# Defines if Netdata sends metric names or UUIDs
netdata_archive_send_names: true
# Defines the flood protection period
netdata_errors_flood_protection_period: 1200
# Defines when to trigger flood proctection
netdata_errors_to_trigger_flood_protection: 200

View File

View File

@ -0,0 +1,30 @@
---
# handlers file for ansible-netdata
#
- name: reload systemd netdata
systemd:
name: "netdata"
daemon_reload: true
become: true
- name: restart netdata
service:
name: "netdata"
state: "restarted"
enabled: true
sleep: 10
become: true
- name: start netdata
service:
name: "netdata"
state: "started"
enabled: true
become: true
- name: stop netdata
service:
name: "netdata"
state: "stopped"
enabled: true
become: true

View File

@ -0,0 +1,2 @@
install_date: Sat Jan 23 23:31:54 2021
version: v1.4.1

View File

@ -0,0 +1,34 @@
---
galaxy_info:
author: Larry Smith Jr.
description: Ansible role to install/configure Netdata
license: MIT
min_ansible_version: 2.0
platforms:
- name: EL
versions:
- 6
- 7
- 8
- name: Debian
versions:
- buster
- jessie
- stretch
- name: Ubuntu
versions:
- bionic
- dingo
- focal
- precise
- trusty
- xenial
galaxy_tags:
- system
- performance
- monitoring
dependencies: []

View File

@ -0,0 +1,22 @@
*******
Docker driver installation guide
*******
Requirements
============
* Docker Engine
Install
=======
Please refer to the `Virtual environment`_ documentation for installation best
practices. If not using a virtual environment, please consider passing the
widely recommended `'--user' flag`_ when invoking ``pip``.
.. _Virtual environment: https://virtualenv.pypa.io/en/latest/
.. _'--user' flag: https://packaging.python.org/tutorials/installing-packages/#installing-to-the-user-site
.. code-block:: bash
$ pip install 'molecule[docker]'

View File

@ -0,0 +1,29 @@
---
dependency:
name: galaxy
enabled: true
options:
role-file: requirements.yml
driver:
name: docker
lint: |
yamllint .
ansible-lint
flake8
platforms:
- name: centos7
image: jrei/systemd-centos:7
privileged: true
command: /usr/sbin/init
# tmpfs:
# - /run
# - /tmp
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
provisioner:
name: ansible
playbooks:
converge: ../shared/converge.yml
prepare: ../shared/prepare.yml
verifier:
name: ansible

View File

@ -0,0 +1,9 @@
---
# This is an example playbook to execute Ansible tests.
- name: Verify
hosts: all
tasks:
- name: Example assertion
assert:
that: true

View File

@ -0,0 +1,22 @@
*******
Docker driver installation guide
*******
Requirements
============
* Docker Engine
Install
=======
Please refer to the `Virtual environment`_ documentation for installation best
practices. If not using a virtual environment, please consider passing the
widely recommended `'--user' flag`_ when invoking ``pip``.
.. _Virtual environment: https://virtualenv.pypa.io/en/latest/
.. _'--user' flag: https://packaging.python.org/tutorials/installing-packages/#installing-to-the-user-site
.. code-block:: bash
$ pip install 'molecule[docker]'

View File

@ -0,0 +1,29 @@
---
dependency:
name: galaxy
enabled: true
options:
role-file: requirements.yml
driver:
name: docker
lint: |
yamllint .
ansible-lint
flake8
platforms:
- name: centos8
image: jrei/systemd-centos:8
privileged: true
command: /usr/sbin/init
# tmpfs:
# - /run
# - /tmp
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
provisioner:
name: ansible
playbooks:
converge: ../shared/converge.yml
prepare: ../shared/prepare.yml
verifier:
name: ansible

View File

@ -0,0 +1,9 @@
---
# This is an example playbook to execute Ansible tests.
- name: Verify
hosts: all
tasks:
- name: Example assertion
assert:
that: true

View File

@ -0,0 +1,22 @@
*******
Docker driver installation guide
*******
Requirements
============
* Docker Engine
Install
=======
Please refer to the `Virtual environment`_ documentation for installation best
practices. If not using a virtual environment, please consider passing the
widely recommended `'--user' flag`_ when invoking ``pip``.
.. _Virtual environment: https://virtualenv.pypa.io/en/latest/
.. _'--user' flag: https://packaging.python.org/tutorials/installing-packages/#installing-to-the-user-site
.. code-block:: bash
$ pip install 'molecule[docker]'

View File

@ -0,0 +1,29 @@
---
dependency:
name: galaxy
enabled: true
options:
role-file: requirements.yml
driver:
name: docker
lint: |
yamllint .
ansible-lint
flake8
platforms:
- name: debian10
image: jrei/systemd-debian:10
privileged: true
command: /lib/systemd/systemd
# tmpfs:
# - /run
# - /tmp
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
provisioner:
name: ansible
playbooks:
prepare: ../shared/prepare.yml
converge: ../shared/converge.yml
verifier:
name: ansible

View File

@ -0,0 +1,9 @@
---
# This is an example playbook to execute Ansible tests.
- name: Verify
hosts: all
tasks:
- name: Example assertion
assert:
that: true

View File

@ -0,0 +1,22 @@
*******
Docker driver installation guide
*******
Requirements
============
* Docker Engine
Install
=======
Please refer to the `Virtual environment`_ documentation for installation best
practices. If not using a virtual environment, please consider passing the
widely recommended `'--user' flag`_ when invoking ``pip``.
.. _Virtual environment: https://virtualenv.pypa.io/en/latest/
.. _'--user' flag: https://packaging.python.org/tutorials/installing-packages/#installing-to-the-user-site
.. code-block:: bash
$ pip install 'molecule[docker]'

View File

@ -0,0 +1,29 @@
---
dependency:
name: galaxy
enabled: true
options:
role-file: requirements.yml
driver:
name: docker
lint: |
yamllint .
ansible-lint
flake8
platforms:
- name: debian8
image: jrei/systemd-debian:8
privileged: true
command: /lib/systemd/systemd
# tmpfs:
# - /run
# - /tmp
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
provisioner:
name: ansible
playbooks:
prepare: ../shared/prepare.yml
converge: ../shared/converge.yml
verifier:
name: ansible

View File

@ -0,0 +1,9 @@
---
# This is an example playbook to execute Ansible tests.
- name: Verify
hosts: all
tasks:
- name: Example assertion
assert:
that: true

View File

@ -0,0 +1,22 @@
*******
Docker driver installation guide
*******
Requirements
============
* Docker Engine
Install
=======
Please refer to the `Virtual environment`_ documentation for installation best
practices. If not using a virtual environment, please consider passing the
widely recommended `'--user' flag`_ when invoking ``pip``.
.. _Virtual environment: https://virtualenv.pypa.io/en/latest/
.. _'--user' flag: https://packaging.python.org/tutorials/installing-packages/#installing-to-the-user-site
.. code-block:: bash
$ pip install 'molecule[docker]'

View File

@ -0,0 +1,29 @@
---
dependency:
name: galaxy
enabled: true
options:
role-file: requirements.yml
driver:
name: docker
lint: |
yamllint .
ansible-lint
flake8
platforms:
- name: debian9
image: jrei/systemd-debian:9
privileged: true
command: /lib/systemd/systemd
# tmpfs:
# - /run
# - /tmp
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
provisioner:
name: ansible
playbooks:
prepare: ../shared/prepare.yml
converge: ../shared/converge.yml
verifier:
name: ansible

View File

@ -0,0 +1,9 @@
---
# This is an example playbook to execute Ansible tests.
- name: Verify
hosts: all
tasks:
- name: Example assertion
assert:
that: true

View File

@ -0,0 +1,22 @@
*******
Docker driver installation guide
*******
Requirements
============
* Docker Engine
Install
=======
Please refer to the `Virtual environment`_ documentation for installation best
practices. If not using a virtual environment, please consider passing the
widely recommended `'--user' flag`_ when invoking ``pip``.
.. _Virtual environment: https://virtualenv.pypa.io/en/latest/
.. _'--user' flag: https://packaging.python.org/tutorials/installing-packages/#installing-to-the-user-site
.. code-block:: bash
$ pip install 'molecule[docker]'

View File

@ -0,0 +1,29 @@
---
dependency:
name: galaxy
enabled: true
options:
role-file: requirements.yml
driver:
name: docker
lint: |
yamllint .
ansible-lint
flake8
platforms:
- name: fedora
image: jrei/systemd-fedora
privileged: true
command: /usr/sbin/init
# tmpfs:
# - /run
# - /tmp
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
provisioner:
name: ansible
playbooks:
converge: ../shared/converge.yml
prepare: ../shared/prepare.yml
verifier:
name: ansible

View File

@ -0,0 +1,9 @@
---
# This is an example playbook to execute Ansible tests.
- name: Verify
hosts: all
tasks:
- name: Example assertion
assert:
that: true

View File

@ -0,0 +1,9 @@
---
- name: Converge
hosts: all
tasks:
- name: Include ansible-netdata
include_role:
name: ansible-netdata
vars:
netdata_epel_setup: "{{ ansible_hostname == 'centos7' }}"

View File

@ -0,0 +1,16 @@
---
- hosts: all
tasks:
- name: Update Apt Cache and install cron
apt:
name: cron
update_cache: true
become: true
when: ansible_os_family == "Debian"
- name: Install cron as requisite
package:
name: cronie
state: present
become: true
when: ansible_os_family == "RedHat"

View File

@ -0,0 +1,9 @@
---
# This is an example playbook to execute Ansible tests.
- name: Verify
hosts: all
tasks:
- name: Example assertion
assert:
that: true

View File

@ -0,0 +1,22 @@
*******
Docker driver installation guide
*******
Requirements
============
* Docker Engine
Install
=======
Please refer to the `Virtual environment`_ documentation for installation best
practices. If not using a virtual environment, please consider passing the
widely recommended `'--user' flag`_ when invoking ``pip``.
.. _Virtual environment: https://virtualenv.pypa.io/en/latest/
.. _'--user' flag: https://packaging.python.org/tutorials/installing-packages/#installing-to-the-user-site
.. code-block:: bash
$ pip install 'molecule[docker]'

View File

@ -0,0 +1,29 @@
---
dependency:
name: galaxy
enabled: true
options:
role-file: requirements.yml
driver:
name: docker
lint: |
yamllint .
ansible-lint
flake8
platforms:
- name: ubuntu1604
image: jrei/systemd-ubuntu:16.04
privileged: true
command: /lib/systemd/systemd
# tmpfs:
# - /run
# - /tmp
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
provisioner:
name: ansible
playbooks:
prepare: ../shared/prepare.yml
converge: ../shared/converge.yml
verifier:
name: ansible

View File

@ -0,0 +1,9 @@
---
# This is an example playbook to execute Ansible tests.
- name: Verify
hosts: all
tasks:
- name: Example assertion
assert:
that: true

View File

@ -0,0 +1,22 @@
*******
Docker driver installation guide
*******
Requirements
============
* Docker Engine
Install
=======
Please refer to the `Virtual environment`_ documentation for installation best
practices. If not using a virtual environment, please consider passing the
widely recommended `'--user' flag`_ when invoking ``pip``.
.. _Virtual environment: https://virtualenv.pypa.io/en/latest/
.. _'--user' flag: https://packaging.python.org/tutorials/installing-packages/#installing-to-the-user-site
.. code-block:: bash
$ pip install 'molecule[docker]'

View File

@ -0,0 +1,29 @@
---
dependency:
name: galaxy
enabled: true
options:
role-file: requirements.yml
driver:
name: docker
lint: |
yamllint .
ansible-lint
flake8
platforms:
- name: ubuntu1804
image: jrei/systemd-ubuntu:18.04
privileged: true
command: /lib/systemd/systemd
# tmpfs:
# - /run
# - /tmp
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
provisioner:
name: ansible
playbooks:
prepare: ../shared/prepare.yml
converge: ../shared/converge.yml
verifier:
name: ansible

View File

@ -0,0 +1,9 @@
---
# This is an example playbook to execute Ansible tests.
- name: Verify
hosts: all
tasks:
- name: Example assertion
assert:
that: true

View File

@ -0,0 +1,22 @@
*******
Docker driver installation guide
*******
Requirements
============
* Docker Engine
Install
=======
Please refer to the `Virtual environment`_ documentation for installation best
practices. If not using a virtual environment, please consider passing the
widely recommended `'--user' flag`_ when invoking ``pip``.
.. _Virtual environment: https://virtualenv.pypa.io/en/latest/
.. _'--user' flag: https://packaging.python.org/tutorials/installing-packages/#installing-to-the-user-site
.. code-block:: bash
$ pip install 'molecule[docker]'

View File

@ -0,0 +1,29 @@
---
dependency:
name: galaxy
enabled: true
options:
role-file: requirements.yml
driver:
name: docker
lint: |
yamllint .
ansible-lint
flake8
platforms:
- name: ubuntu2004
image: jrei/systemd-ubuntu:20.04
privileged: true
command: /lib/systemd/systemd
# tmpfs:
# - /run
# - /tmp
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
provisioner:
name: ansible
playbooks:
prepare: ../shared/prepare.yml
converge: ../shared/converge.yml
verifier:
name: ansible

View File

@ -0,0 +1,9 @@
---
# This is an example playbook to execute Ansible tests.
- name: Verify
hosts: all
tasks:
- name: Example assertion
assert:
that: true

View File

@ -0,0 +1,32 @@
---
- hosts: netdata_registry
vars:
netdata_registry_enabled: true
netdata_registry_to_announce: "http://{{ netdata_stream_master_node }}:{{ netdata_default_port }}"
pri_domain_name: test.vagrant.local
netdata_stream_enabled: true
netdata_stream_api_key: 359CCA67-C678-49E7-9A39-DEC1B92DFB34
netdata_stream_master_node: 192.168.250.10
tasks:
- name: Include ansible-nodejs
include_role:
name: ansible-nodejs
- name: Include ansible-netdata
include_role:
name: ansible-netdata
- hosts: netdata:!netdata_registry
vars:
netdata_registry_enabled: false
netdata_registry_to_announce: "http://{{ netdata_stream_master_node }}:{{ netdata_default_port }}"
pri_domain_name: test.vagrant.local
netdata_stream_enabled: true
netdata_stream_api_key: 359CCA67-C678-49E7-9A39-DEC1B92DFB34
netdata_stream_master_node: 192.168.250.10
tasks:
- name: Include ansible-nodejs
include_role:
name: ansible-nodejs
- name: Include ansible-netdata
include_role:
name: ansible-netdata

View File

@ -0,0 +1,7 @@
# Python requirements for development
-c requirements.txt
autopep8
flake8
pycodestyle
pylint
tox

View File

@ -0,0 +1,27 @@
#
# This file is autogenerated by pip-compile
# To update, run:
#
# pip-compile requirements-dev.in
#
appdirs==1.4.4 # via virtualenv
astroid==2.4.2 # via pylint
autopep8==1.5.4 # via -r requirements-dev.in
distlib==0.3.1 # via virtualenv
filelock==3.0.12 # via tox, virtualenv
flake8==3.8.3 # via -r requirements-dev.in
isort==5.5.2 # via pylint
lazy-object-proxy==1.4.3 # via astroid
mccabe==0.6.1 # via flake8, pylint
packaging==20.4 # via tox
pluggy==0.13.1 # via -c requirements.txt, tox
py==1.9.0 # via tox
pycodestyle==2.6.0 # via -r requirements-dev.in, autopep8, flake8
pyflakes==2.2.0 # via flake8
pylint==2.6.0 # via -r requirements-dev.in
pyparsing==2.4.7 # via packaging
six==1.15.0 # via -c requirements.txt, astroid, packaging, tox, virtualenv
toml==0.10.1 # via autopep8, pylint, tox
tox==3.20.0 # via -r requirements-dev.in
virtualenv==20.0.31 # via tox
wrapt==1.12.1 # via astroid

View File

@ -0,0 +1,8 @@
# Python requirements for executing
ansible
ansible-lint
docker
mkdocs
molecule
pip-tools
yamllint

View File

@ -0,0 +1,72 @@
#
# This file is autogenerated by pip-compile
# To update, run:
#
# pip-compile
#
ansible-lint==4.3.4 # via -r requirements.in
ansible==2.9.13 # via -r requirements.in, ansible-lint, molecule
arrow==0.16.0 # via jinja2-time
bcrypt==3.2.0 # via paramiko
binaryornot==0.4.4 # via cookiecutter
cerberus==1.3.2 # via molecule
certifi==2020.6.20 # via requests
cffi==1.14.2 # via bcrypt, cryptography, pynacl
chardet==3.0.4 # via binaryornot, requests
click-completion==0.5.2 # via molecule
click-help-colors==0.8 # via molecule
click==7.1.2 # via click-completion, click-help-colors, cookiecutter, mkdocs, molecule, nltk, pip-tools, python-gilt
colorama==0.4.3 # via molecule, python-gilt, rich
commonmark==0.9.1 # via rich
cookiecutter==1.7.2 # via molecule
cryptography==3.1 # via ansible, paramiko
docker==4.3.1 # via -r requirements.in
fasteners==0.15 # via python-gilt
future==0.18.2 # via lunr
idna==2.10 # via requests
jinja2-time==0.2.0 # via cookiecutter
jinja2==2.11.2 # via ansible, click-completion, cookiecutter, jinja2-time, mkdocs, molecule
joblib==0.16.0 # via nltk
livereload==2.6.3 # via mkdocs
lunr[languages]==0.5.8 # via mkdocs
markdown==3.2.2 # via mkdocs
markupsafe==1.1.1 # via cookiecutter, jinja2
mkdocs==1.1.2 # via -r requirements.in
molecule==3.0.8 # via -r requirements.in
monotonic==1.5 # via fasteners
nltk==3.5 # via lunr
paramiko==2.7.2 # via molecule
pathspec==0.8.0 # via yamllint
pexpect==4.8.0 # via molecule
pip-tools==5.3.1 # via -r requirements.in
pluggy==0.13.1 # via molecule
poyo==0.5.0 # via cookiecutter
ptyprocess==0.6.0 # via pexpect
pycparser==2.20 # via cffi
pygments==2.6.1 # via rich
pynacl==1.4.0 # via paramiko
python-dateutil==2.8.1 # via arrow
python-gilt==1.2.3 # via molecule
python-slugify==4.0.1 # via cookiecutter
pyyaml==5.3.1 # via ansible, ansible-lint, mkdocs, molecule, python-gilt, yamllint
regex==2020.7.14 # via nltk
requests==2.24.0 # via cookiecutter, docker
rich==6.1.1 # via ansible-lint
ruamel.yaml.clib==0.2.2 # via ruamel.yaml
ruamel.yaml==0.16.12 # via ansible-lint
sh==1.13.1 # via molecule, python-gilt
shellingham==1.3.2 # via click-completion
six==1.15.0 # via bcrypt, click-completion, cookiecutter, cryptography, docker, fasteners, livereload, lunr, pip-tools, pynacl, python-dateutil, websocket-client
tabulate==0.8.7 # via molecule
text-unidecode==1.3 # via python-slugify
tornado==6.0.4 # via livereload, mkdocs
tqdm==4.48.2 # via nltk
tree-format==0.1.2 # via molecule
typing-extensions==3.7.4.3 # via rich
urllib3==1.25.10 # via requests
websocket-client==0.57.0 # via docker
yamllint==1.24.2 # via -r requirements.in, molecule
# The following packages are considered to be unsafe in a requirements file:
# pip
# setuptools

View File

@ -0,0 +1,14 @@
---
# Since netdata 1.11 the auto-updater installs the cron by itself
# This is a legacy when Netdata didn't handle the cron itself
- name: auto_updates | Setting Up Cron Job For Auto Updates
cron:
name: Netdata Auto Updates
weekday: "{{ netdata_auto_updates['weekday'] }}"
minute: "{{ netdata_auto_updates['minute'] }}"
hour: "{{ netdata_auto_updates['hour'] }}"
user: "{{ netdata_auto_updates['user'] }}"
job: "{{ netdata_source_dir }}/{{ netdata_updater|basename }}"
cron_file: netdata_auto_updates
state: "{{ netdata_auto_updates['clean_legacy_cron']|default(false)|ternary('absent', 'present') }}"
become: true

View File

@ -0,0 +1,75 @@
---
- name: config | Configuring Netdata
template:
src: netdata.conf.j2
dest: "{{ netdata_config_file }}"
owner: "{{ netdata_user_info['user'] }}"
group: root
mode: u=rx,g=rx,o=r
notify: restart netdata
become: true
- name: config | Configuring Netdata Alarm Notifications
template:
dest: "{{ netdata_alarm_config_file }}"
owner: "{{ netdata_user_info['user'] }}"
group: root
src: "health_alarm_notify.conf.j2"
mode: u=rw,g=rw,o=r
notify: restart netdata
become: true
when: netdata_alarm_configure
- name: config | Configuring Netdata streaming
template:
src: stream.conf.j2
dest: "{{ netdata_stream_config_file }}"
owner: "{{ netdata_user_info['user'] }}"
group: root
mode: u=rx,g=rx,o=r
notify: restart netdata
become: true
when: netdata_stream_enabled
- name: config | Configuring Netdata Service (systemd)
template:
src: etc/systemd/system/netdata.service.j2
dest: /etc/systemd/system/netdata.service
owner: root
group: root
mode: u=rw,g=rw,o=r
notify:
- reload systemd netdata
- restart netdata
become: true
when: ansible_service_mgr == "systemd"
- name: config | Configuring Netdata Service (upstart|sysvinit) - Debian
template:
src: etc/init.d/netdata.debian.j2
dest: /etc/init.d/netdata
owner: root
group: root
mode: u=rwx,g=rx,o=rx
notify:
- restart netdata
become: true
when: >
(ansible_service_mgr == "upstart"
or ansible_service_mgr == "sysvinit") and
ansible_os_family == "Debian"
- name: config | Configuring Netdata Service (upstart|sysvinit) - RedHat
template:
src: etc/init.d/netdata.redhat.j2
dest: /etc/init.d/netdata
owner: root
group: root
mode: u=rwx,g=rx,o=rx
notify:
- restart netdata
become: true
when: >
(ansible_service_mgr == "upstart"
or ansible_service_mgr == "sysvinit") and
ansible_os_family == "RedHat"

View File

@ -0,0 +1,17 @@
---
- name: debian | Installing git
apt:
name: git
state: present
become: true
- name: debian | Installing iproute Package
apt:
name: iproute
state: present
become: true
when: >
(ansible_distribution == "Debian" and
ansible_distribution_version|int < 10) or
(ansible_distribution == "Ubuntu" and
ansible_distribution_version < "18.04")

View File

@ -0,0 +1,35 @@
---
- name: install | Defining Auto Update CLI Option
set_fact:
auto_update_cli_option: "{{ netdata_auto_updates['enabled']|ternary('--auto-update', '') }}"
- name: install | Cloning {{ netdata_git_repo }} to {{ netdata_source_dir }}
git:
repo: "{{ netdata_git_repo }}"
dest: "{{ netdata_source_dir }}"
depth: 1
version: "{{ netdata_git_version_tag }}"
become: true
- name: use Netdata dependencies installation
command: "{{ netdata_requirements_installer }} {{ netdata_requirements_installer_options|join(' ') }}" # noqa 301
args:
chdir: "{{ netdata_source_dir }}"
become: true
register: netdata_requirements_install
changed_when: >
'All required packages are already installed. Now proceed to the next step.'
not in netdata_requirements_install.stderr_lines
- name: install | Installing Netdata ({{ netdata_installer }}) From {{ netdata_source_dir }}
command: "{{ installer_cli|join(' ') }}"
vars:
installer_cli:
- "{{ netdata_installer }}"
- "{{ auto_update_cli_option }}"
- "--dont-wait"
args:
chdir: "{{ netdata_source_dir }}"
creates: /usr/sbin/netdata
become: true
notify: restart netdata

View File

@ -0,0 +1,26 @@
---
# tasks file for ansible-netdata
- include_tasks: set_facts.yml
- include: debian.yml
when: ansible_os_family == "Debian"
- include: redhat.yml
when: ansible_os_family == "RedHat"
- include: install.yml
- include: config.yml
when: netdata_config
- include: update.yml
when: netdata_update or netdata_update_force
- include: auto_updates.yml
when: netdata_auto_updates['enabled']
- include: uninstall.yml
when: netdata_uninstall
tags:
- netdata_uninstall

View File

@ -0,0 +1,33 @@
---
- name: redhat | Install git
yum:
name: git
state: present
- name: redhat | Check if EPEL repo is already configured.
stat: path={{ netdata_epel_repofile_path }}
register: epel_repofile_result
when: netdata_epel_setup
- name: redhat | Install EPEL repo.
yum:
name: "{{ netdata_epel_repo_url }}"
state: present
register: result
when:
- netdata_epel_setup
- not epel_repofile_result.stat.exists
- name: redhat | Import EPEL GPG key.
rpm_key:
key: "{{ netdata_epel_repo_gpg_key_url }}"
state: present
when:
- netdata_epel_setup
- not epel_repofile_result.stat.exists
- name: redhat | install okay repo
yum:
name: http://repo.okay.com.mx/centos/6/x86_64/release/okay-release-1-3.el6.noarch.rpm
state: present
when: netdata_centos6_install_okay

View File

@ -0,0 +1,67 @@
---
- name: set_facts | Defining Debian Packages
set_fact:
netdata_debian_pre_reqs:
- autoconf-archive
- autoconf
- autogen
- automake
- build-essential
- cron
- curl
- gcc
- git
- libmnl-dev
- libmnl0
- libssl-dev
- libuuid1
- libuv1-dev
- lm-sensors
- make
- netcat
- pkg-config
- python-mysqldb
- python-psycopg2
- python-pymongo
- python-yaml
- util-linux
- uuid
- uuid-dev
- zlib1g-dev
when: >
ansible_distribution == "Debian" or
(ansible_distribution == "Ubuntu" and
ansible_distribution_version is version('20.04', '<'))
- name: set_facts | Defining Debian Packages
set_fact:
netdata_debian_pre_reqs:
- autoconf-archive
- autoconf
- autogen
- automake
- build-essential
- cron
- curl
- gcc
- git
- libmnl-dev
- libmnl0
- libssl-dev
- libuuid1
- libuv1-dev
- lm-sensors
- make
- netcat
- pkg-config
- python3-pymysql
- python3-psycopg2
- python3-pymongo
- python3-yaml
- util-linux
- uuid
- uuid-dev
- zlib1g-dev
when:
- ansible_distribution == "Ubuntu"
- ansible_distribution_version is version('20.04', '>=')

View File

@ -0,0 +1,34 @@
---
- name: uninstall | Prepping For Uninstalling Netdata
replace:
dest: "{{ netdata_source_dir }}/{{ netdata_uninstaller|basename }}"
regexp: 'rm -I -R "'
replace: 'rm -R "'
become: true
- name: uninstall | Prepping For Uninstalling Netdata
replace:
dest: "{{ netdata_source_dir }}/{{ netdata_uninstaller|basename }}"
regexp: 'rm -i "'
replace: 'rm "'
become: true
- name: uninstall | Uninstalling Netdata # noqa 301
command: "{{ netdata_uninstaller }} --force"
args:
chdir: "{{ netdata_source_dir }}"
become: true
- name: uninstall | Cleaning Up After Uninstalling Netdata
replace:
dest: "{{ netdata_source_dir }}/{{ netdata_uninstaller|basename }}"
regexp: 'rm -R "'
replace: 'rm -I -R "'
become: true
- name: uninstall | Cleaning Up After Uninstalling Netdata
replace:
dest: "{{ netdata_source_dir }}/{{ netdata_uninstaller|basename }}"
regexp: 'rm "'
replace: 'rm -i "'
become: true

View File

@ -0,0 +1,15 @@
---
- name: update | Updating Netdata ({{ netdata_updater }}) From {{ netdata_source_dir }}
command: "{{ netdata_updater }}"
args:
chdir: "{{ netdata_source_dir }}"
become: true
notify: restart netdata
when: not netdata_update_force|bool
- name: update | Force Updating Netdata ({{ netdata_updater }}) From {{ netdata_source_dir }}
command: "{{ netdata_updater }} -f"
args:
chdir: "{{ netdata_source_dir }}"
become: true
when: netdata_update_force

View File

View File

@ -0,0 +1,100 @@
#!/bin/bash
#
### BEGIN INIT INFO
# Provides: netdata
# Required-Start: $local_fs $remote_fs $network $named $time apache2 httpd squid nginx mysql named opensips upsd hostapd postfix lm_sensors
# Required-Stop: $local_fs $remote_fs $network $named $time apache2 httpd squid nginx mysql named opensips upsd hostapd postfix lm_sensors
# Should-Start: $local_fs $network $named $remote_fs $time $all
# Should-Stop: $local_fs $network $named $remote_fs $time $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start and stop the netdata real-time monitoring server daemon
# Description: Controls the main netdata monitoring server daemon "netdata".
# and all its plugins.
### END INIT INFO
#
set -e
set -u
${DEBIAN_SCRIPT_DEBUG:+ set -v -x}
DAEMON="netdata"
DAEMON_PATH=/usr/sbin
PIDFILE=/var/run/$DAEMON.pid
DAEMONOPTS="-P $PIDFILE"
test -x $DAEMON_PATH/$DAEMON || exit 0
. /lib/lsb/init-functions
# Safeguard (relative paths, core dumps..)
cd /
umask 022
service_start() {
log_daemon_msg "Starting real-time performance monitoring" "netdata"
start_daemon -p $PIDFILE $DAEMON_PATH/$DAEMON $DAEMONOPTS
RETVAL=$?
log_end_msg $RETVAL
return $RETVAL
}
service_stop() {
log_daemon_msg "Stopping real-time performance monitoring" "netdata"
killproc -p ${PIDFILE} $DAEMON_PATH/$DAEMON
RETVAL=$?
log_end_msg $RETVAL
if [ $RETVAL -eq 0 ]; then
rm -f ${PIDFILE}
fi
return $RETVAL
}
condrestart() {
if ! service_status > /dev/null; then
RETVAL=$1
return
fi
service_stop
service_start
}
service_status() {
status_of_proc -p $PIDFILE $DAEMON_PATH/$DAEMON netdata
}
#
# main()
#
case "${1:-''}" in
'start')
service_start
;;
'stop')
service_stop
;;
'restart')
service_stop
service_start
;;
'try-restart')
condrestart 0
;;
'force-reload')
condrestart 7
;;
'status')
service_status && exit 0 || exit $?
;;
*)
echo "Usage: $0 {start|stop|restart|try-restart|force-reload|status}"
exit 1
esac

View File

@ -0,0 +1,91 @@
#!/bin/sh
#
# netdata Real-time performance monitoring, done right
# chkconfig: 345 99 01
# description: Netdata is a daemon that collects data in real-time (per second)
# and presents a web site to view and analyze them. The presentation
# is also real-time and full of interactive charts that precisely
# render all collected values.
# processname: netdata
# Source functions
. /etc/rc.d/init.d/functions
DAEMON="netdata"
DAEMON_PATH=/usr/sbin
PIDFILE=/var/run/$DAEMON.pid
DAEMONOPTS="-P $PIDFILE"
STOP_TIMEOUT="10"
[ -e /etc/sysconfig/$DAEMON ] && . /etc/sysconfig/$DAEMON
LOCKFILE=/var/lock/subsys/$DAEMON
service_start()
{
[ -x $DAEMON_PATH ] || exit 5
echo -n "Starting $DAEMON..."
daemon $DAEMON_PATH/$DAEMON $DAEMONOPTS
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch $LOCKFILE
return $RETVAL
}
service_stop()
{
printf "%-50s" "Stopping $DAEMON..."
killproc -p ${PIDFILE} -d ${STOP_TIMEOUT} $DAEMON
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f ${PIDFILE} ${LOCKFILE}
return $RETVAL
}
condrestart()
{
if ! service_status > /dev/null; then
RETVAL=$1
return $RETVAL
fi
service_stop
service_start
}
service_status()
{
status -p ${PIDFILE} $DAEMON_PATH/$DAEMON
}
service_status_quiet()
{
status -p ${PIDFILE} $DAEMON_PATH/$DAEMON >/dev/null 2>&1
}
case "$1" in
start)
service_status_quiet && exit 0
service_start
;;
stop)
service_status_quiet || exit 0
service_stop
;;
restart)
service_stop
service_start
;;
try-restart)
condrestart 0
;;
force-reload)
condrestart 7
;;
status)
service_status
;;
*)
echo "Usage: $0 {start|stop|restart|try-restart|force-reload|status}"
exit 3
esac

View File

@ -0,0 +1,16 @@
[Unit]
Description=Real time performance monitoring
After=network.target httpd.service squid.service nfs-server.service mysqld.service mysql.service named.service postfix.service
[Service]
Type=simple
User={{ netdata_user_info['user'] }}
Group={{ netdata_user_info['group'] }}
ExecStart=/usr/sbin/netdata -D
Restart=on-failure
# saving a big db on slow disks may need some time
TimeoutStopSec=60
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1,9 @@
{% for key in netdata_alarm_notify_configs %}
{{ key }}="{{ netdata_alarm_notify_configs[key] }}"
{% endfor %}
{% if netdata_custom_sender_function is defined %}
custom_sender() {
{{ netdata_custom_sender_function }}
}
{% endif %}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,33 @@
# netdata stream configuration
{% if (netdata_stream_master_node == '') or netdata_stream_proxy %}
[{{ netdata_stream_receive_api_key }}]
# enable/disable this API key
enabled = yes
# one hour of data for each of the slaves
default history = 3600
# do not save slave metrics on disk
default memory = ram
# alarms checks, only while the slave is connected
health enabled by default = auto
{% endif %}
{% if netdata_stream_master_node != '' %}
[stream]
# stream metrics to another netdata
enabled = yes
# the IP and PORT of the master
destination = {{ netdata_stream_master_node }}
# TLS client options
{% for ssl_option, ssl_value in netdata_client_ssl_options.items() %}
{{ ssl_option }} = {{ ssl_value }}
{% endfor %}
# the API key to use
api key = {{ netdata_stream_send_api_key }}
{% endif %}

View File

@ -0,0 +1,2 @@
---
# vars file for ansible-netdata

View File

@ -11,6 +11,12 @@
version: 2.2.1
name: postgresql
# Monitoring
# Upstream: https://github.com/mrlesmithjr/ansible-netdata
- src: mrlesmithjr.netdata
version: v1.4.1
name: netdata
# Webserver stuff
# Upstream: https://github.com/geerlingguy/ansible-role-certbot
- src: geerlingguy.certbot