Getting started

Default configuration

The default installation deploys InfluxDBv2 behind the nginx webserver using the debops.nginx role, with automatic HTTPS support provided by the debops.pki role. By default the user interface will be deployed on the host's FQDN, controlled by the influxdb2__fqdn default variable.

Example inventory

To install InfluxDBv2 on a host, you need to add it to the [debops_service_influxdb2] Ansible group:

[debops_service_influxdb2]
database-host

This will install the influxdb2 and influxdb2-cli packages from the InfluxData repositories (InfluxDB v2.x is currently not available in Debian).

After role deployment, users need to initialize the service and create an initial user account and organization. This can be done by using the web interface or, preferably, by logging in to the influx setup command. The command line option will automatically create a corresponding ~/.influxdbv2/configs configuration file and make latter use of the influx commands easier.

Example playbook

Here's an example Ansible playbook that uses the debops.influxdb2 role:

---

- name: Manage InfluxDBv2 server
  collections: [ 'debops.debops' ]
  hosts: [ 'debops_service_influxdb2' ]
  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:
        - '{{ nginx__keyring__dependent_apt_keys }}'
        - '{{ influxdata__keyring__dependent_apt_keys }}'

    - role: apt_preferences
      tags: [ 'role::apt_preferences', 'skip::apt_preferences' ]
      apt_preferences__dependent_list:
        - '{{ nginx__apt_preferences__dependent_list }}'

    - role: etc_services
      tags: [ 'role::etc_services', 'skip::etc_services' ]
      etc_services__dependent_list:
        - '{{ influxdb2__etc_services__dependent_list }}'

    - role: ferm
      tags: [ 'role::ferm', 'skip::ferm' ]
      ferm__dependent_rules:
        - '{{ nginx__ferm__dependent_rules }}'

    - role: python
      tags: [ 'role::python', 'skip::python' ]
      python__dependent_packages3:
        - '{{ nginx__python__dependent_packages3 }}'
      python__dependent_packages2:
        - '{{ nginx__python__dependent_packages2 }}'

    - role: nginx
      tags: [ 'role::nginx', 'skip::nginx' ]
      nginx__dependent_upstreams:
        - '{{ influxdb2__nginx__dependent_upstreams }}'
      nginx__dependent_servers:
        - '{{ influxdb2__nginx__dependent_servers }}'

    - role: influxdata
      tags: [ 'role::influxdata', 'skip::influxdata' ]
      influxdata__dependent_packages:
        - '{{ influxdb2__influxdata__dependent_packages }}'

    - role: influxdb2
      tags: [ 'role::influxdb2', 'skip::influxdb2' ]

Ansible tags

You can use Ansible --tags or --skip-tags parameters to limit what tasks are performed during Ansible run. This can be used after a host was first configured to speed up playbook execution, when you are sure that most of the configuration is already in the desired state.

Available role tags:

role::influxdb2

Main role tag, should be used in the playbook to execute all of the role tasks as well as role dependencies.

skip::influxdb2

Main role tag, should be used in the playbook to skip all of the role tasks.