Skip to content

feat: InfluxDB/Grafana/Telegraf support, multi-OS fixes, CI improvements#3

Merged
davidpablocohn merged 27 commits into
mainfrom
dev
Apr 26, 2026
Merged

feat: InfluxDB/Grafana/Telegraf support, multi-OS fixes, CI improvements#3
davidpablocohn merged 27 commits into
mainfrom
dev

Conversation

@davidpablocohn-claude-bot

Copy link
Copy Markdown
Contributor

Summary

This PR brings dev up to date with main, encompassing all work since the initial project setup. The changes fall into four areas:

New features

  • InfluxDB / Grafana / Telegraf roles — new Ansible roles and a dedicated playbook to install and configure the full metrics stack alongside OpenRVDAS (feat: add InfluxDB/Grafana/Telegraf installation roles and playbook)
  • rvdas user added to sudo group on Debian/Ubuntu/Raspbian to support post-install management tasks

Bug fixes

  • InfluxDB integration — resolved installation failures and Python interpreter mismatch on Ubuntu/Debian (/usr/bin/python3)
  • Django / OpenRVDAS package install — editable-install (pip install -e) when a pyproject.toml is present; create_superuser() shell workaround to bypass Django password validators in CI
  • Vault & secrets — vault secrets now written as properly quoted YAML; rvdas system user password set correctly; vault read-back quoting fixed
  • APT reliability — heal broken dpkg state before apt operations; retry apt-get install on transient network failures; remove openssh-server from package lists (caused conflicts)
  • SELinux — fixed SELinux policy application on RHEL-family hosts
  • configure_and_install.sh — macOS compatibility fixes; sudo handling corrected (Ubuntu localhost only); removed RUN_ANSIBLE_VIA_SUDO flag

CI

  • Added self-install test (ansible_connection=local on a Linux GitHub Actions runner)
  • Fixed use_deadsnakes written as boolean (not quoted string) in CI test matrix
  • APT retries to handle transient network failures in CI

Docs

  • Rewrote README; defaults for install_simulate_nbp / run_simulate_nbp set to false
  • Added experimental preface noting this is an unofficial Ansible-based alternative to install_openrvdas.sh

Test plan

  • Run configure_and_install.sh against a fresh Ubuntu/Debian host and verify OpenRVDAS + InfluxDB stack comes up cleanly
  • Run against a CentOS/Rocky host to verify SELinux fix holds
  • Re-run playbook (idempotency check) — no tasks should report changed
  • Confirm CI self-install job passes on the PR

🤖 Generated with Claude Code

davidpablocohn and others added 27 commits April 9, 2026 20:12
…o false

Reorganised README: installation/verification/update/managing at the
top, configuration/SSL/backup/status/manual-setup in the middle, and
testing (Docker + CI) at the end. Added Docker local testing section
and CI matrix table.

Simulator install and autostart now default to false — users who want
the NBP1406 test data simulator opt in explicitly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds influxdb.yml playbook and supporting roles to install and configure
the InfluxDB v2 observability stack (InfluxDB, Grafana, Telegraf) with
optional OpenRVDAS settings.py integration.

Key design decisions:
- standalone_influx auto-detected: installs supervisord only on hosts
  not already running OpenRVDAS
- InfluxDB setup via HTTP API POST /api/v2/setup (fully idempotent)
- User-supplied token from vault; no fragile CLI token parsing
- Single combined supervisor conf (influx.conf.j2) covers all three
  services with Jinja2 conditionals and [group:influx]
- Grafana admin password via GF_SECURITY_ADMIN_PASSWORD env var
- Version-branched task structure (setup_v2.yml, setup_v3.yml stub)
  ready for future InfluxDB v3 support
- Interactive configure_and_install_influxdb.sh installer following
  same pattern as configure_and_install.sh

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Tests the 'localhost' install path where Ansible runs on the same
machine being configured, using real sudo become rather than the
Docker sudo shim.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…l test

Quoted "false" is a truthy string in Ansible; unquoted false is the
boolean the when: conditional expects.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…re_and_install

Fix ./configure_and_install.sh on MacOS
If Ansible can connect to run the playbook, sshd is already installed
and running. Including it causes apt to attempt an upgrade mid-play,
and openssh-server's post-install script fails when it tries to restart
sshd via systemctl on some machines (VPS, restricted systemd etc.).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
If a previous run left a package half-configured (e.g. openssh-server
failing its post-install systemctl restart), every subsequent apt-get
invocation fails with 'Sub-process dpkg returned error code 1'.

Run dpkg --configure -a behind a policy-rc.d guard (prevents service
start/restart scripts from running) to clear the broken state before
any package installation tasks.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Unquoted values in the secrets heredoc break YAML parsing when
passwords or tokens contain special characters (: # { } [ ]).

Replace heredoc with a Python writer that wraps all values in YAML
single quotes (doubling any embedded single quotes), which is safe
for any string content.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Stale copy of python_bin_for_os still had python3.9, which doesn't
exist on Ubuntu 22.04/24.04 without deadsnakes. The influxdb playbook
doesn't need a specific Python minor version.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Use current InfluxData GPG key (influxdata-archive.key) with fingerprint
  verification and /etc/apt/keyrings/ keyring path
- Validate InfluxDB admin password is 8-72 characters in installer
- Offer to auto-generate API token via openssl rand in installer
- Fix 'influxd_pid.stdout' reference when temp influxd block is skipped
- Fix supervisord reload handler using shell instead of command for &&
- Ensure database/influxdb/__init__.py exists so Python import succeeds
- Fix influxdb_openrvdas restart handler to reread/update before restart

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Prompt for rvdas Linux system user password in installer; store in vault
- Apply password to rvdas user via password_hash('sha512') in Ansible role
- Fix vault read-back using yaml.safe_load instead of awk/sed to prevent
  YAML single-quote wrapping from compounding on each re-run
- Preserve rvdas_user_password when influxdb installer merges secrets
- Fix Django superuser creation to use createsuperuser --noinput with
  DJANGO_SUPERUSER_PASSWORD env var (avoids quoting/indentation errors)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…s in CI

createsuperuser --noinput runs password validation and rejects 'changeme'
(common password). Revert to calling User.objects.create_superuser() directly
via manage.py shell with env vars — bypasses validators, safe for any password.
Also add rvdas_user_password to secrets.yml.example to avoid undefined var.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
RHEL-family already had wheel in rvdas_groups; add sudo for Debian-family
so rvdas can run privileged commands after install.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add retries=3/delay=15 to both apt-get install tasks so flaky connections
to Ubuntu package mirrors don't fail the run.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Upstream dev branch removed all sys.path.append() calls in favour of
proper packaging (pyproject.toml, #544/#545). Without pip install -e .,
supervised processes (logger_manager, cached_data_server, uWSGI, etc.)
fail on import because the openrvdas subpackages are not on sys.path.

Mirror what install_openrvdas.sh does: stat-guard the step so it is a
no-op on the master branch where pyproject.toml does not yet exist.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@davidpablocohn davidpablocohn merged commit 74a86df into main Apr 26, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants