Git Product home page Git Product logo

ansible-role-influxdb's People

Contributors

boutetnico avatar michaelbaisch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ansible-role-influxdb's Issues

Make admin token optional and create tokens seperately

Hi :)

wdyt of removing the admin_token in influx setup here?

--token {{ influxdb_admin_token }} \

An then, add the possibility to configure tokens (including the primary admin token) in a separate task like creating users, buckets, etc.?

- name: Ensure users exist
command: influx user create \
--host "{{ influxdb_host }}" \
--name "{{ item.name }}" \
--org "{{ item.org }}" \
--password "{{ item.password }}"
loop: "{{ influxdb_users }}"
loop_control:
label: "{{ item.name }}"
register: _user
failed_when:
- _user.rc != 0
- '"already exists" not in _user.stderr'
changed_when: _user.rc == 0

Why do we need this?

This would allow us to skip the configuration of a default token and make it optional as not everybody needs a primary admin_token.

New Release

Version 5.0.0 does not work due to InfluxDB signing key URL changing:

TASK [boutetnico.influxdb : Manage InfluxData APT repositories] ****************
failed: [monitoring-instance] (item=deb https://repos.influxdata.com/ubuntu focal stable) => {"ansible_loop_var": "item", "changed": false, "item": "deb https://repos.influxdata.com/ubuntu focal stable", "msg": "Failed to update apt cache: W:GPG error: https://repos.influxdata.com/ubuntu focal InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY D8FF8E1F7DF8B07E, E:The repository 'https://repos.influxdata.com/ubuntu focal InRelease' is not signed."}

This was fixed in 8fb28b3 but a new release has not been created yet. Is is possible for a new release and version on ansible-galaxy be published? Thanks.

Current fix is to use role directly from github.

Client sent an HTTP request to an HTTPS server.

Hello,

when using this role configured with TLS like so:

influxdb_config:
  tls-cert: "/etc/letsencrypt/live/{{ my_domain }}/fullchain.pem"
  tls-key: "/etc/letsencrypt/live/{{ my_domain }}/privkey.pem"

I get an error on the task Ensure InfluxDB is up and running:

Error: Got 400 from 'http://localhost:8086/health', Attempted to unmarshal error as JSON but failed: invalid character 'C' looking for beginning of value: Client sent an HTTP request to an HTTPS server.

This error will also happen on Set InfluxDB default user, organization, and bucket when the last one is disabled.

The way I understand it is as follows: as long as the configuration (in /root/.influxdbv2/configs) with a correct host isn't created, which is done with the influx setup, the influx command will use the default host http://localhost:8086/. That will not work with TLS, because it should be https and the domain is wrong. The way I found to fix that was to use the --host argument in those two tasks like so:

- name: Ensure InfluxDB is up and running
  command: influx ping \
    --host {{ influxdb_host}}
  retries: 10
  delay: 5
  register: _ping
  until: _ping.rc == 0
  changed_when: false

- name: Set InfluxDB default user, organization, and bucket
  command: influx setup \
    --org {{ influxdb_primary_org }} \
    --bucket {{ influxdb_primary_bucket }} \
    --username {{ influxdb_primary_username }} \
    --password {{ influxdb_primary_password }} \
    --token {{ influxdb_admin_token }} \
    --host {{ influxdb_host}} \
    --force
  register: _setup
  failed_when:
    - _setup.rc != 0
    - '"has already been setup" not in _setup.stdout'
  changed_when: _setup.rc == 0

influxdb_host could be a variable of the role, which is by default set to http://localhost:8086/

Any thoughts on that suggestion?

Greetings Michael

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.