commit e511b717069719c40fcfebbb8c5e8641801b583a Author: Gardais Jérémy Date: Thu Jul 26 17:02:22 2018 +0200 Install Netdata diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..0624241 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,6 @@ + +## v1.0 + +### Features +* Install Netdata. +* Can choose to install recommends packages. diff --git a/README.md b/README.md new file mode 100644 index 0000000..49a46a4 --- /dev/null +++ b/README.md @@ -0,0 +1,59 @@ +# Netdata + +1. [Overview](#overview) +2. [Role Variables](#role-variables) +3. [Example Playbook](#example-playbook) +4. [Configuration](#configuration) +5. [Development](#development) +6. [License](#license) +7. [Author Information](#author-information) + +## Overview + +A role to manage Netdata installation and configuration. + +## Role Variables + +* **netdata__base_packages** : List of base packages in order to provide Netdata [default : `netdata`]. +* **netdata__install_recommends** : If recommends packages should be install [default : `True`]. +* **netdata__deploy_state** : The desired state this role should achieve. [default : `present`]. + +## Example Playbook + +* Use defaults vars : + +``` yaml +- hosts: mynode.domain + roles: + - role: ipr-cnrs.netdata + tags: ['role::netdata', 'ipr'] +``` + +## Configuration + +This role will : +* Install needed packages to provide `netdata` service. + +## Development + +This source code comes from our [Gogs instance][netdata source] and the [Github repo][netdata github] exist just to be able to send the role to Ansible Galaxy… + +But feel free to send issue/PR here :) + +Thanks to this [hook][gogs to github hook], Github automatically got updates from our [Gogs instance][netdata source] :) + +## License + +[WTFPL][wtfpl website] + +## Author Information + +Jérémy Gardais +* Source : [on IPR's Gogs][netdata source] +* [IPR][ipr website] (Institut de Physique de Rennes) + +[gogs to github hook]: https://stackoverflow.com/a/21998477 +[netdata source]: https://git.ipr.univ-rennes1.fr/cellinfo/ansible.netdata +[netdata github]: https://github.com/ipr-cnrs/netdata +[wtfpl website]: http://www.wtfpl.net/about/ +[ipr website]: https://ipr.univ-rennes1.fr/ diff --git a/defaults/main.yml b/defaults/main.yml new file mode 100644 index 0000000..f33fca7 --- /dev/null +++ b/defaults/main.yml @@ -0,0 +1,39 @@ +--- +# .. vim: foldmarker=[[[,]]]:foldmethod=marker + +# ipr-cnrs.netdata default variables [[[ +# ====================================== + +# Packages and installation [[[ +# ----------------------------- + +# .. envvar:: netdata__base_packages [[[ +# +# List of base packages to install. +netdata__base_packages: + - 'netdata' + # ]]] +# .. envvar:: netdata__install_recommends [[[ +# +# If recommended packages should be install ? Possible options : +# +# ``True`` +# Default. Ensure all probes can work. +# +# ``False`` +# +netdata__install_recommends: True + # ]]] +# .. envvar:: netdata__deploy_state [[[ +# +# What is the desired state which this role should achieve ? Possible options : +# +# ``present`` +# Default. Ensure that netdata is installed and configured as requested. +# +# ``absent`` +# Ensure that netdata is uninstalled and it's configuration is removed. +# +netdata__deploy_state: 'present' + # ]]] + # ]]] diff --git a/meta/main.yml b/meta/main.yml new file mode 100644 index 0000000..2000cf3 --- /dev/null +++ b/meta/main.yml @@ -0,0 +1,15 @@ +galaxy_info: + author: "Jérémy Gardais" + description: "Manage Netdata configuration" + license: WTFPL + company: IPR + issue_tracker_url: https://git.ipr.univ-rennes1.fr/cellinfo/ansible.netadata/issues + min_ansible_version: 2.6 + platforms: + - name: Debian + versions: + - stretch + galaxy_tags: + - system + - netadata + - monitoring diff --git a/tasks/main.yml b/tasks/main.yml new file mode 100644 index 0000000..5dc2fc6 --- /dev/null +++ b/tasks/main.yml @@ -0,0 +1,15 @@ +--- +# .. vim: foldmarker=[[[,]]]:foldmethod=marker +# +# tasks file for netdata + +# Manage base system packages [[[1 +- name: Ensure base packages are in there desired state + package: + name: '{{ item }}' + state: '{{ "present" if (netdata__deploy_state == "present") else "absent" }}' + install_recommends: '{{ netdata__install_recommends | bool }}' + with_flattened: + - '{{ netdata__base_packages }}' + +