DEBOPS.INFLUXDATA(5)

NAME
debops.influxdata - Configure InfluxData APT repositories

SYNOPSIS

debops service/influxdata [--limit group,host,...] [--diff] [--check] [--tags tag1,tag2,...] [--skip-tags tag1,tag2,...] [<ansible-playbook options>] ...

DESCRIPTION

The debops.influxdata Ansible role can be used to configure APT repositories maintained by the InfluxData <https://www.influxdata.com/about/> company on Debian and Ubuntu hosts. The APT repositories are used to distribute influxdb, telegraf, chronograf and kapacitor APT packages. The role allows only for installation of packages, additional configuration and management of the installed software is performed by other Ansible roles.

GETTING STARTED

  General role usage

The role will configure an APT repository provided by the InfluxData company to allow secure installation of various software packages developed by said company. The GPG key used by the repository is downloaded from a OpenPGP keyserver to ensure authenticity and verification by a third party.

The role itself does not install any APT packages by default. The APT package selection can be performed either using Ansible inventory, or through role dependent variables.

In an example application role, create a YAML list variable that contains APT packages you want to install:

application__influxdata__dependent_packages:
  - 'influxdb'
  - 'telegraf'

Then, in either the playbook, or in role dependencies, use that variable with the influxdata role to specify what APT packages to install:

roles:
  - role: influxdata
    influxdata__dependent_packages:
      - '{{ application__influxdata__dependent_packages }}'

The role will install selected packages automatically after configuring the repository. When this mechanism is used, the Ansible local facts that contain application versions will be correctly updated by the role.

  Ansible local facts

The debops.influxdata role provides a set of Ansible local facts which can be used by other roles. In the ansible_local.influxdata.packages YAML dictionary you can find a YAML dictionary which contains all APT package names recognized by the role as keys, and their installed version as values. You can use these facts to for example provide an accurate version number on your role to check against version_compare() Ansible filter:

application__version: '{{ ansible_local.influxdata.packages.influxdb|d("0.0.0") }}'

You can also use the ansible_local.influxdata.packages fact to check if a given InfluxData application is installed:

application__present: '{{ "influxdb" in (ansible_local.influxdata.packages|d({})) }}'

  Example inventory

To enable configuration of the InfluxData APT repositories, you need to add a host to the [debops_service_influxdata] Ansible inventory group:

[debops_service_influxdata]
hostname

The role will be automatically used by other Ansible roles that manage InfluxData software, therefore the above step is not strictly necessary. Refer to the documentation of these roles for more details.

  Example playbook

If you are using this role without DebOps, here's an example Ansible playbook that uses the debops.influxdata role:

---
- name: Manage InfluxData APT repositories
  collections: [ 'debops.debops', 'debops.roles01',
                 'debops.roles02', 'debops.roles03' ]
  hosts: [ 'debops_service_influxdata' ]
  become: True
  environment: '{{ inventory__environment | d({})
                   | combine(inventory__group_environment | d({}))
                   | combine(inventory__host_environment  | d({})) }}'
  roles:
    - role: keyring
      tags: [ 'role::keyring', 'skip::keyring', 'role::influxdata' ]
      keyring__dependent_apt_keys:
        - '{{ influxdata__keyring__dependent_apt_keys }}'
    - role: influxdata
      tags: [ 'role::influxdata', 'skip::influxdata' ]

AUTHOR
Patryk Ściborek, Maciej Delmanowski

COPYRIGHT
2014-2022, Maciej Delmanowski, Nick Janetakis, Robin Schneider and others