Title: Re-render the Alloy exporters when a services converge changes a node by shipmill-romamo[bot] · Pull Request #330 · cloudfall-dev/cloudfall · GitHub
Open Graph Title: Re-render the Alloy exporters when a services converge changes a node by shipmill-romamo[bot] · Pull Request #330 · cloudfall-dev/cloudfall
X Title: Re-render the Alloy exporters when a services converge changes a node by shipmill-romamo[bot] · Pull Request #330 · cloudfall-dev/cloudfall
Description: Plan Serves: quality bar (Q-1) Files: engine/ansible/playbooks/services.yml, engine/ansible/roles/cloudfall_logging_collector/tasks/exporters.yml (new), engine/ansible/roles/cloudfall_logging_collector/meta/argument_specs.yml, engine/tests/test_s012_elasticsearch_access.py, engine/tests/test_component_hosts.py (the stub role gains the new entry point), changelog.d/329-es-exporter-follows-remote-access.md Order: a failing test that runs the services converge's collector step for a host before and after remoteAccess is added (and removed); then the collector role's exporters entry point and the services.yml task that includes it on hosts where logging deploy already set Alloy up; then the changelog fragment Proof: uv run pytest engine/tests/test_s012_elasticsearch_access.py engine/tests/test_s012_elasticsearch_role.py engine/tests/test_logging_templates.py engine/tests/test_component_hosts.py, ansible-lint (CI), ruff, mypy Summary Adding remoteAccess to an Elasticsearch service with metrics.enabled switches the node to HTTPS when services.yml converges it, but the collector's Alloy exporter kept scraping over plain HTTP until the next logging deploy, because only logging.yml rendered the collector. logging deploy feeds the collector role from host vars the engine inventory gives every playbook (cloudfall_logging_collector for a collector host, cloudfall_services), so the services play has the same inputs and the preferred design applies (no fallback message): The collector role gets an exporters entry point (tasks/exporters.yml): it stats /etc/alloy/cloudfall.alloy and /usr/bin/alloy, and only when both exist re-renders the same two files main.yml writes (config.alloy.j2, alloy-systemd-override.conf.j2, same owners and modes), notifies the existing Restart Alloy handler (daemon-reload + restart, only when a file changed), runs alloy validate, and flushes handlers services.yml includes it as its last task, only when cloudfall_logging_collector is defined; a host that is not a collector is never touched, and a collector logging deploy has not set up yet gets nothing installed meta/argument_specs.yml adds an exporters entry point that reuses the main options through a YAML anchor; main is unchanged Templates are untouched, so PostgreSQL and Redis exporters and the #326 SetCredential= fallbacks render byte-identical to before. Test plan New in engine/tests/test_s012_elasticsearch_access.py (all three fail on main with StopIteration: services.yml has no collector step): test_a_services_converge_takes_the_exporter_to_https_with_remote_access: evaluates the services step's when/vars and the exporters guard with Ansible's Templar, renders the files it writes for a host without and with remoteAccess, and asserts http to https plus the CA credential, back to http when it is removed, and byte equality with what logging deploy renders test_the_services_converge_reloads_alloy_only_through_its_validated_files: same template arguments as main.yml, Restart Alloy notify, validate before the flush test_a_services_converge_leaves_a_host_without_the_collector_alone: non-collector host and a collector without Alloy set up get nothing; no apt or user tasks engine/tests/test_component_hosts.py: the stub cloudfall_logging_collector role gains exporters.yml, so the real services.yml run over the stubbed fleet passes A local ansible-playbook --check run of the include on localhost passed the exporters argument-spec validation and skipped the block (no Alloy there) Ran: ruff check, mypy, the touched test files plus test_s012_elasticsearch_role.py, test_logging_templates.py, test_services_passwords.py, sdk/tests/test_s012_elasticsearch_converge.py, sdk/tests/test_owned_postgresql_converge.py: all green. ansible-lint was refused by the session's hook, so it is left to CI, as is the full suite Not run on a live host: the restart of a running Alloy after the switch Fixes #329 🤖 Generated with Claude Code
Open Graph Description: Plan Serves: quality bar (Q-1) Files: engine/ansible/playbooks/services.yml, engine/ansible/roles/cloudfall_logging_collector/tasks/exporters.yml (new), engine/ansible/roles/cloudfall_logging_coll...
X Description: Plan Serves: quality bar (Q-1) Files: engine/ansible/playbooks/services.yml, engine/ansible/roles/cloudfall_logging_collector/tasks/exporters.yml (new), engine/ansible/roles/cloudfall_logging_coll...
Opengraph URL: https://github.com/cloudfall-dev/cloudfall/pull/330
X: @github
Domain: github.com
IPv4 address: 140.82.112.4
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:d2834330-e252-cd6c-7bf9-fa5d6e6f509b |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | E136:2F671E:28A23B7:353046E:6B05591C |
| html-safe-nonce | 345af8bbf53bd313b187de7643f32a3ffe2eecb13b7500fcbf4639fd600d2bf7 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMTM2OjJGNjcxRToyOEEyM0I3OjM1MzA0NkU6NkIwNTU5MUMiLCJ2aXNpdG9yX2lkIjoiNDY2MTk2ODI0NjAzNDIyNTQzNiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | f4f8a6304048dd700cf91d475464bf3576b9652a4184c40f663810092e7a9f33 |
| hovercard-subject-tag | pull_request:5314340359 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/cloudfall-dev/cloudfall/pull/330/files |
| twitter:image | https://avatars.githubusercontent.com/u/5600783?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/5600783?s=400&v=4 |
| og:image:alt | Plan Serves: quality bar (Q-1) Files: engine/ansible/playbooks/services.yml, engine/ansible/roles/cloudfall_logging_collector/tasks/exporters.yml (new), engine/ansible/roles/cloudfall_logging_coll... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | a79a02b7e7546ea306864e922ed2103ef4c04fac63168e11c2b2d4d816793080 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/cloudfall-dev/cloudfall git https://github.com/cloudfall-dev/cloudfall.git |
| octolytics-dimension-user_id | 339512759 |
| octolytics-dimension-user_login | cloudfall-dev |
| octolytics-dimension-repository_id | 1360999777 |
| octolytics-dimension-repository_nwo | cloudfall-dev/cloudfall |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1360999777 |
| octolytics-dimension-repository_network_root_nwo | cloudfall-dev/cloudfall |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 10dff83edfd4f3617a7792a152d44991587b434c |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | no-cache |
Viewport: width=device-width