influxdb icon indicating copy to clipboard operation
influxdb copied to clipboard

Create Ansible module collection

Open samhld opened this issue 2 years ago • 3 comments

We want to enable users to scale deployments of OSS across their global topologies. To help with this, we should try to meet them where they are from a distributed deployment standpoint. A common tool used for this is Ansible.

Currently, there is a community-contributed InfluxDB deployment module for 1.X as well as a set of InfluxDB modules that interact with the other APIs: Screen Shot 2022-07-12 at 8 01 13 PM

This is a request to do something in a similar vein with v2. I think we need a collection of modules that encompass at least most of the operational APIs (i.e., not query or write). I say operational APIs as that is, in my experience, the audience that uses Ansible. Interfacing with InfluxDB via query and writes should be done elsewhere. Ansible's role in "usage" of instances is likely best for testing/benchmarking.

MVP Spec:

  • (discuss) Download, install, run, restart (it's possible this could be left out as it's fairly simple to do this with service/package management modules)
  • Setup
  • Health
  • Users
  • Authorizations
  • Buckets (create and delete)
  • Tasks
  • Remotes and replications

Full Spec:

  • Rest of APIs -- priority order (debatable):
    • Dashboards
    • Labels and variables
    • Scrapers
    • Write (for benchmarking)
    • Query (benchmarking)
    • v1 write/query
    • Backup/restore
    • Checks/Notifications
    • ...

samhld avatar Jul 13 '22 15:07 samhld

(discuss) Download, install, run, restart (it's possible this could be left out as it's fairly simple to do this with service/package management modules)

I definitely think this can be left out. Ansible already provides apt/yum/docker wrappers. For run/restart/etc, we could easily provide a systemd unit and then let Ansible manage that.

jeffreyssmith2nd avatar Jul 13 '22 18:07 jeffreyssmith2nd

@jeffreyssmith2nd Agreed -- thoughts on running the instance? I'm thinking about how we want users to be able to configure the instances at runtime (via config file or influxd daemon).

samhld avatar Jul 13 '22 18:07 samhld

For config file we could have a well defined systemd unit file that is installed with influxdb. It basically would look at a specified path for the config, which could then be put in place by ansible. Ansible has good support for managing systemd units.

For cli flags, I think we could just the ansible shell module in combination with daemon to run influxd in the background. daemon -- influxdb --here --are --my --flags. There would be no lifecycle management though other than some form of kill.

I have no strong preferences towards any approach though, these are just the ones I know how to do based on past ansible experience.

jeffreyssmith2nd avatar Jul 14 '22 13:07 jeffreyssmith2nd