netdata-service

Example:

# Install netdata, listening on all interfaces.
- netdata-service:
    bind:
    - '*'

Description

Install netdata using the mrlesmithjr.ansible-netdata Ansible role.

After install, netdata should be available on port 19999.

Variables

Name Type Default Description

api_key

string --

Netdata api key.

bind

list ['*']

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.

is_registry

boolean False

Whether this instance should act as netdata registry.

registry

string https://registry.my-netdata.io

The registry to use.

stream

boolean False

Whether netdata streawming should be configured.

stream_master_node

string --

Stream master node.

Examples

Example 1

Install netdata, listening on all interfaces.

Code
- netdata-service:
    bind:
    - '*'

Code

doc:
  short_help: Makes sure netdata service is installed and running.
  help: |
    Install [netdata](https://my-netdata.io/) using the [mrlesmithjr.ansible-netdata](https://github.com/mrlesmithjr/ansible-netdata) Ansible role.

    After install, netdata should be available on port 19999.
  furter_reading:
    netdata homepage: https://github.com/firehol/netdata/
    mrlesmithjr.ansible-netdata Ansible role: https://github.com/mrlesmithjr/ansible-netdata
  examples:
  - title: Install netdata, listening on all interfaces.
    vars:
      bind:
      - '*'



args:
  bind:
    doc:
      short_help: The ip address and port to listen to.
      help: |
        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.
    type: list
    schema:
      type: string
    required: false
    default:
    - '*'
    cli:
      metavar: IP
      show_default: true
  is_registry:
    doc:
      short_help: Whether this instance should act as netdata registry.
      furter_reading:
      - https://github.com/firehol/netdata/wiki/mynetdata-menu-item
    type: boolean
    default: false
    required: false
    cli:
      is_flag: true
  registry:
    doc:
      short_help: The registry to use.
      furter_reading:
      - https://github.com/firehol/netdata/wiki/mynetdata-menu-item
    type: string
    default: https://registry.my-netdata.io
    required: false
    cli:
      show_default: true
      metavar: URL
  stream:
    doc:
      short_help: Whether netdata streawming should be configured.
      furter_reading:
      - https://github.com/firehol/netdata/wiki/Monitoring-ephemeral-nodes
    type: boolean
    required: false
    default: false
    cli:
      is_flag: true
      show_default: true
  api_key:
    doc:
      short_help: Netdata api key.
    type: string
    required: false
    cli:
      metavar: API_KEY
  stream_master_node:
    doc:
      short_help: Stream master node.
    type: string
    required: false
    cli:
      metavar: IP

#TODO: archive args

meta:
  tags:
  - netadata
  - monitoring
  - featured-frecklecutable
  - setup

frecklets:
- frecklet:
    name: mrlesmithjr.ansible-netdata
    type: ansible-role
    resources:
      ansible-role:
      - mrlesmithjr.ansible-netdata
    desc:
      short: installing netdata
      references:
        "'mrlesmithjr.ansible-netdata'": https://github.com/mrlesmithjr/ansible-netdata
    properties:
      elevated: true
      idempotent: true
      internet: true
  task:
    become: true
  vars:
    netdata_bind_to: '{{:: bind ::}}'
    netdata_registry_enabled: '{{:: is_registry ::}}'
    netdata_registry_to_announce: '{{:: registry ::}}'
    netdata_stream_enabled: '{{:: stream ::}}'
    netdata_stream_api_key: '{{:: api_key ::}}'
    netdata_stream_master_node: '{{:: stream_master_node ::}}'
frecklecute netdata-service --help

Usage: frecklecute netdata-service [OPTIONS]

  Install [netdata](https://my-netdata.io/) using the [mrlesmithjr.ansible-
  netdata](https://github.com/mrlesmithjr/ansible-netdata) Ansible role.

  After install, netdata should be available on port 19999.

Options:
  --api-key API_KEY               Netdata api key.
  --bind IP                       The ip address and port to listen to.
  --is-registry / --no-is-registry
                                  Whether this instance should act as netdata
                                  registry.
  --registry URL                  The registry to use.
  --stream / --no-stream          Whether netdata streawming should be
                                  configured.
  --stream-master-node IP         Stream master node.
  --help                          Show this message and exit.
# -*- coding: utf-8 -*-


#
# module path: pycklets.netdata_service.NetdataService
#


from dataclasses import dataclass
from pyckles import AutoPycklet
from typing import *    # noqa

@dataclass
class NetdataService(AutoPycklet):
    """Install [netdata](https://my-netdata.io/) using the [mrlesmithjr.ansible-netdata](https://github.com/mrlesmithjr/ansible-netdata) Ansible role.

     After install, netdata should be available on port 19999.

       Args:
         api_key: Netdata api key.
         bind: The ip address and port to listen to.
         is_registry: Whether this instance should act as netdata registry.
         registry: The registry to use.
         stream: Whether netdata streawming should be configured.
         stream_master_node: Stream master node.

    """

    FRECKLET_ID = "netdata-service"

    api_key: str = None
    bind: List = None
    is_registry: bool = None
    registry: str = None
    stream: bool = None
    stream_master_node: str = None


    def __post_init__(self):
        super(NetdataService, self).__init__(var_names=["api_key", "bind", "is_registry", "registry", "stream", "stream_master_node"])


frecklet_class = NetdataService
# -*- coding: utf-8 -*-


#
# module path: pycklets.netdata_service.NetdataService
#


from pyckles import AutoPycklet

class NetdataService(AutoPycklet):
    """Install [netdata](https://my-netdata.io/) using the [mrlesmithjr.ansible-netdata](https://github.com/mrlesmithjr/ansible-netdata) Ansible role.

     After install, netdata should be available on port 19999.

       Args:
         api_key: Netdata api key.
         bind: The ip address and port to listen to.
         is_registry: Whether this instance should act as netdata registry.
         registry: The registry to use.
         stream: Whether netdata streawming should be configured.
         stream_master_node: Stream master node.

    """

    FRECKLET_ID = "netdata-service"

    def __init__(self, api_key=None, bind=['*'], is_registry=None, registry="https://registry.my-netdata.io", stream=None, stream_master_node=None):

        super(NetdataService, self).__init__(var_names=["api_key", "bind", "is_registry", "registry", "stream", "stream_master_node"])
        self._api_key = api_key
        self._bind = bind
        self._is_registry = is_registry
        self._registry = registry
        self._stream = stream
        self._stream_master_node = stream_master_node

    @property
    def api_key(self):
        return self._api_key

    @api_key.setter
    def api_key(self, api_key):
        self._api_key = api_key

    @property
    def bind(self):
        return self._bind

    @bind.setter
    def bind(self, bind):
        self._bind = bind

    @property
    def is_registry(self):
        return self._is_registry

    @is_registry.setter
    def is_registry(self, is_registry):
        self._is_registry = is_registry

    @property
    def registry(self):
        return self._registry

    @registry.setter
    def registry(self, registry):
        self._registry = registry

    @property
    def stream(self):
        return self._stream

    @stream.setter
    def stream(self, stream):
        self._stream = stream

    @property
    def stream_master_node(self):
        return self._stream_master_node

    @stream_master_node.setter
    def stream_master_node(self, stream_master_node):
        self._stream_master_node = stream_master_node



frecklet_class = NetdataService