Commit Graph
1953 Commits
Author SHA1 Message Date
kevinveenbirkenbach 88c3bbb721 test: fix templating env lookup fallback and unify unittest.mock import usage
https://chatgpt.com/share/698992ef-215c-800f-a93e-5d8e75b81f23
2026-02-09 08:55:17 +01:00
kevinveenbirkenbach 4fe03975fc Merge remote-tracking branch 'origin/alert-autofix-168' into merge-autofix 2026-02-09 08:42:28 +01:00
kevinveenbirkenbach 80f457de9e Merge remote-tracking branch 'origin/alert-autofix-139' into merge-autofix 2026-02-09 08:42:06 +01:00
kevinveenbirkenbach ae967bb559 Merge branch 'alert-autofix-212' 2026-02-09 08:39:44 +01:00
kevinveenbirkenbach 6c6229708c fix(compose): retry on image config verification failures during pull
Treat "error pulling image configuration" and "image config verification failed"
as transient Docker pull errors so retries are attempted instead of failing
immediately. This improves robustness against registry/CDN glitches.

Also clarify retry log output and add unit coverage to prevent regressions.

https://chatgpt.com/share/698987eb-3d64-800f-a4b3-749b545f7370
2026-02-09 08:08:21 +01:00
kevinveenbirkenbachandCopilot Autofix powered by AI 7bdc59a9f4 Potential fix for code scanning alert no. 212: Unused local variable
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2026-02-09 08:01:09 +01:00
kevinveenbirkenbachandCopilot Autofix powered by AI 26851bcfe1 Potential fix for code scanning alert no. 139: Module is imported with 'import' and 'import from'
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2026-02-09 08:00:59 +01:00
kevinveenbirkenbachandCopilot Autofix powered by AI c84616fd50 Potential fix for code scanning alert no. 168: Module is imported with 'import' and 'import from'
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2026-02-09 07:59:57 +01:00
kevinveenbirkenbach 4e5e8d2a7d Fix compose down behavior and harden templar rendering
- Restore full teardown semantics in Compose.down by delegating to down_stack
  (including volume removal and CI cleanup)
- Normalize templar render output to string to avoid None-related failures
- Clean up unused variable in templating fallback path
- Reorder test imports without changing behavior

https://chatgpt.com/share/69890935-4f1c-800f-8f2c-1b18a1df0ea5
2026-02-08 23:07:44 +01:00
kevinveenbirkenbach 50fc018f39 Merge branch 'alert-autofix-201' 2026-02-08 22:35:27 +01:00
kevinveenbirkenbach 5ffc0c8390 tests: fix domain_mapper unit tests to use explicit module references
- Call iter_app_domains and build_domain_index via module_utils.domain_mapper
- Avoid NameError caused by missing direct imports in test module
- Improve formatting consistency in assertions for readability

https://chatgpt.com/share/69890141-da40-800f-ab40-1b30ba15ac7c
2026-02-08 22:33:35 +01:00
kevinveenbirkenbach d4a41bc5d8 Merge branch 'alert-autofix-139' 2026-02-08 22:26:06 +01:00
kevinveenbirkenbach 7d8d024868 tests: fix missing mock import in inventory manager tests
Add missing `from unittest import mock` import to prevent NameError
in test_inventory_manager when using mock.patch().

https://chatgpt.com/share/6988ff29-8470-800f-97a5-2c3ad1a224b1
2026-02-08 22:24:47 +01:00
kevinveenbirkenbachandCopilot Autofix powered by AI b5ffea5034 Potential fix for code scanning alert no. 139: Module is imported with 'import' and 'import from'
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2026-02-08 18:36:22 +01:00
kevinveenbirkenbachandCopilot Autofix powered by AI abe7512b75 Potential fix for code scanning alert no. 194: Module is imported with 'import' and 'import from'
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2026-02-08 18:35:24 +01:00
kevinveenbirkenbachandCopilot Autofix powered by AI c3ccfff16c Potential fix for code scanning alert no. 201: Module is imported with 'import' and 'import from'
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2026-02-08 18:32:48 +01:00
kevinveenbirkenbachandCopilot Autofix powered by AI 96d98bf542 Potential fix for code scanning alert no. 214: Empty except
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2026-02-08 09:50:55 +01:00
kevinveenbirkenbachandCopilot Autofix powered by AI 9c15df9b6b Potential fix for code scanning alert no. 216: Empty except
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2026-02-08 09:44:36 +01:00
kevinveenbirkenbachandCopilot Autofix powered by AI aff4d7679f Potential fix for code scanning alert no. 213: Empty except
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2026-02-08 09:42:36 +01:00
kevinveenbirkenbach a55c99ef62 refactor(compose): replace docker lookup with container and unify compose paths
- Rename lookup plugin from `docker` to `container`
- Switch all lookups from `lookup('docker', ...)` to `lookup('container', ...)`
- Normalize compose file keys:
  - docker_compose → compose
  - docker_compose_override → compose_override
  - docker_compose_ca_override → compose_ca_override
- Centralize compose path resolution via docker_paths_utils
- Update compose_file_args to always derive paths from DIR_COMPOSITIONS
- Align all roles, templates, and vars with container/compose naming
- Update and rename unit tests accordingly

This prepares the codebase for engine-agnostic container backends
(e.g. Docker ↔ Podman) and removes legacy docker-specific assumptions.

https://chatgpt.com/share/6987a7cc-d374-800f-99ad-bb4c8f92c59e
2026-02-07 21:59:39 +01:00
kevinveenbirkenbach 64b0506947 refactor: replace raw docker usage with container wrapper across roles
Replace direct `docker` command usage, references, and documentation with
the `container` wrapper to ensure engine abstraction and future portability
(e.g. Docker → Podman).

This includes:
- Shell scripts, Ansible tasks, handlers, and Python helpers
- Documentation, comments, help texts, and meta descriptions
- Network, volume, system, and image operations
- Test expectations and comments

All runtime behavior remains unchanged while enforcing the repository-wide
rule to avoid raw Docker invocations.

https://chatgpt.com/share/698721c3-e270-800f-be7a-e4435fb54506
2026-02-07 12:57:26 +01:00
kevinveenbirkenbach b78ab29218 Renamed config entry from docker to compose
https://chatgpt.com/share/69870f54-d708-800f-9870-e9ae5a4bff44
2026-02-07 11:09:36 +01:00
kevinveenbirkenbach 53e817fa22 refactor(compose): migrate from docker-compose.yml to compose.yml everywhere
- Rename all docker-compose.yml templates to compose.yml
- Update override and CA override filenames accordingly
- Adjust compose wrapper, lookup plugins, filters and path helpers
- Update roles, tasks, handlers and scripts to use compose CLI
- Rewrite documentation and admin guides to reference compose
- Update unit and integration tests to expect compose.yml
- Keep internal variable keys for backward compatibility where needed

https://chatgpt.com/share/69870272-b168-800f-84c3-6417398e441f
2026-02-07 10:14:21 +01:00
kevinveenbirkenbach 8447ddc10a feat(sys-svc-compose): support -f/--file and append to autodetected compose files
https://chatgpt.com/share/69869046-8f78-800f-bdb9-0bd7d644ce4a
2026-02-07 02:07:01 +01:00
kevinveenbirkenbach 86533cbd2e refactor(container): use compose wrapper from PATH and drop hardcoded binary paths
- Replace hardcoded /usr/local/bin/compose with `compose` everywhere
- Remove explicit wrapper existence checks (PATH resolution is authoritative)
- Align hard/soft repair scripts and cert deploy helper with wrapper usage
- Update unit tests and paths after renaming docker → container roles
- Keep compose invocation consistent across scripts and tests

https://chatgpt.com/share/6986772f-d780-800f-8362-b5b66c6f33f2
2026-02-07 00:19:53 +01:00
kevinveenbirkenbach 9fa9692d7d refactor(compose): replace docker compose calls with compose wrapper
- Switch all docker compose invocations to the compose wrapper
- Update comments, task names, and log messages accordingly
- Simplify handlers and tasks to rely on wrapper-managed flags and env files
- Align tests and documentation with compose-based workflow

https://chatgpt.com/share/69866ede-be2c-800f-94b0-bffcf8fed260
2026-02-06 23:44:39 +01:00
kevinveenbirkenbach e3a16cbe8a refactor: switch docker CLI usage to container wrapper
- Replace direct docker calls with container wrapper across scripts, roles, and templates
- Add support for cp, start, stop, and restart passthrough commands
- Align handlers and notifications to container manager restart semantics
- Fix systemd ExecStartPost to use container wrapper without hardcoded paths
- Silence ShellCheck SC2016 false positive for container exec password injection
- Update tests and documentation strings to reflect container-based workflow

https://chatgpt.com/share/69866958-c88c-800f-9b4f-3a972615bf42
2026-02-06 23:21:02 +01:00
kevinveenbirkenbach ba35d7c5e0 refactor(container): replace docker ps usages with container wrapper and move binaries to /usr/bin
https://chatgpt.com/share/698660b7-4c78-800f-b25f-af5408cff034
2026-02-06 22:44:14 +01:00
kevinveenbirkenbach fb43b44240 hlth-csp: run CSP checker containers as one-shot (--rm)
Add --rm to container run so CSP checker containers are removed
automatically after completion. This prevents exited one-shot containers
from being picked up by repair/health logic and avoids false recovery
attempts.

Unit tests were updated to reflect the new --rm behavior.

https://chatgpt.com/share/6986525a-4b48-800f-b310-bb8b231121ec
2026-02-06 21:50:29 +01:00
kevinveenbirkenbach 04255cb372 rpr-container-soft: ignore non-compose containers when repairing exited/unhealthy
Filter docker ps by com.docker.compose.project label in STRICT mode so that
one-shot docker run containers are ignored. This prevents false repair
attempts and label lookup errors for containers without compose metadata.

Unit tests were updated to reflect the new compose-only prefilter behavior.

https://chatgpt.com/share/6986525a-4b48-800f-b310-bb8b231121ec
2026-02-06 21:43:01 +01:00
kevinveenbirkenbach 10043ebacf sys-svc-container: make CA injection soft-fail and extend unit tests
- Switch CA handling to soft-fail with warnings instead of hard exits
- Fallback to plain `docker run` when CA env vars or files are missing
- Avoid failing on images without ENTRYPOINT (warn + fallback)
- Simplify entrypoint inspect recovery logic (direct pull + retry)
- Refactor container wrapper structure and comments
- Extend unit tests to cover CA soft-fail and docker run fallback paths

https://chatgpt.com/share/69864bf2-7830-800f-ae8a-dad17c4f6e13
2026-02-06 21:15:42 +01:00
kevinveenbirkenbach 92a4cc0eaf Replaced _global by global 2026-02-06 17:57:12 +01:00
kevinveenbirkenbach c2a5ee0e19 feat(lookup): add strict config lookup backed by applications variable
Introduce a `config` lookup plugin that exposes `get_app_conf` via Ansible
lookups, defaulting to strict mode and supporting an optional default value.

Add comprehensive unittest coverage validating strict behavior, defaults,
schema-defined but unset errors, index access, and argument validation.

https://chatgpt.com/share/6985f3f5-4660-800f-9e5d-2b518ccdff80
2026-02-06 15:00:13 +01:00
kevinveenbirkenbach c9489eb5dd feat(lookup): add domain() lookup plugin with unit tests
Introduce a new Ansible lookup plugin `domain()` that resolves the primary
domain directly from the `domains` variable using only `application_id`.
Includes comprehensive unit tests covering string, list, dict, and error cases.

https://chatgpt.com/share/6985ef1e-11b8-800f-b231-52523055060b
2026-02-06 14:39:32 +01:00
kevinveenbirkenbach 9701eefe99 refactor(compose): rename compose_f_args lookup to compose_file_args
https://chatgpt.com/share/6985ed13-7c98-800f-bb5f-e5832f7c094c
2026-02-06 14:30:51 +01:00
kevinveenbirkenbach 8ba071da24 refactor(tls): rename cert_plan lookup to cert
Rename the certificate planning lookup from cert_plan to cert to better reflect
its role as the canonical certificate resolver.

This change updates:
- lookup plugin filename and error prefixes
- all lookup usages across roles and templates
- unit tests and internal documentation references
- CHANGELOG to reflect the new public lookup name

No functional behavior changed.

https://chatgpt.com/share/6985e838-488c-800f-8786-3269e587c14c
2026-02-06 14:10:03 +01:00
kevinveenbirkenbach 48237d758c Rename nginx_paths lookup to nginx and update all references
* Rename lookup plugin: lookup_plugins/nginx_paths.py -> lookup_plugins/nginx.py
* Update lookup usage from lookup('nginx_paths', ...) to lookup('nginx', ...) across roles/templates/vars
* Update unit tests accordingly (imports + patch targets)

https://chatgpt.com/share/6985e705-4040-800f-a779-347f06e46f82
2026-02-06 14:05:04 +01:00
kevinveenbirkenbach 3bb8c0ce30 refactor(tls): rename tls_resolve lookup to tls
The TLS lookup has been renamed from `tls_resolve` to `tls` to better
reflect its responsibility as a strict TLS state resolver.

This refactor updates all usages across the codebase, including:
- lookup plugins and internal helpers
- roles, vars, tasks, and templates
- tests, stubs, and error messages
- documentation and changelog references

Behavior, lookup API, and semantics remain unchanged.

https://chatgpt.com/share/6985e635-5a94-800f-b794-937e566ee308
2026-02-06 14:01:32 +01:00
kevinveenbirkenbach 208e3788d2 refactor(web-app-desktop): switch docker_cards to positional want-path for tls_resolve
Update docker_cards lookup to use the strict positional want-path API when
calling tls_resolve. Adjust unit tests and test stubs accordingly, removing
legacy want= kwargs while keeping behavior unchanged.

https://chatgpt.com/share/6985d642-b40c-800f-9cdf-ed54fc484a92
2026-02-06 13:48:13 +01:00
kevinveenbirkenbach 228ed1db0e refactor(database lookup): enforce strict positional want-path and drop want= kwarg
- Switch database lookup to strict positional want-path API
- Reject legacy want= keyword usage with hard error
- Update unit tests to cover strict term validation and projections

https://chatgpt.com/share/6985d642-b40c-800f-9cdf-ed54fc484a92
2026-02-06 13:14:13 +01:00
kevinveenbirkenbach b487134028 nginx_paths: restore cache directories and update unit tests for strict want-path API
Reintroduce directories.cache (general/image) in nginx_paths and use named
cache variables consistently in ensure. Update unit tests to validate cache
paths and projections under the new strict positional want-path API, and
adjust the tls_resolve fake to the new call style.

https://chatgpt.com/share/6985d642-b40c-800f-9cdf-ed54fc484a92
2026-02-06 13:01:36 +01:00
kevinveenbirkenbach fe04692f1f tests: switch tls_resolve and cert_plan unit tests to positional want-path
Update lookup calls to pass the want-path as the second positional term
(e.g. ["web-app-a", "files.cert"] / ["web-app-a", "url.base"]) and rename the
affected test methods accordingly.

https://chatgpt.com/share/6985d337-0c44-800f-9d79-d0922077abe0
2026-02-06 12:44:30 +01:00
kevinveenbirkenbach e1e1f3eb11 chore(vars): rename PATH_* to DIR_/BIN_/FILE_ conventions
https://chatgpt.com/share/6985cf49-3c74-800f-af97-f68b1969ab01
2026-02-06 12:23:46 +01:00
kevinveenbirkenbach 0cb620ef54 Revert "Removed unused run.py"
This reverts commit a9ac29c0c9.

It is used by CSP healthcheck. Additional:

refactor container execution to container wrapper and add unit tests

https://chatgpt.com/share/6985cba4-b410-800f-bedb-7e63d70fe4a6
2026-02-06 12:07:12 +01:00
kevinveenbirkenbach 1db08dbb79 Renamed DOCKER_COMPOSE to COMPOSE 2026-02-06 10:33:50 +01:00
kevinveenbirkenbach 7bb15d1b5e refactor(container): rename docker-container/docker services to sys-svc-container and update all references, schedules, tests, and templates
https://chatgpt.com/share/6985b09d-8ff8-800f-800c-7a694c0983e2
2026-02-06 10:12:31 +01:00
kevinveenbirkenbach 51239968fd refactor: rename docker-compose roles to sys-svc-compose and update paths
Renamed docker-compose and docker-compose-ca roles to sys-svc-compose and sys-svc-compose-ca, updated template includes, handlers, lookups, tests, and variables, and moved compose instances to /opt/compose.

https://chatgpt.com/share/6985ab2c-8344-800f-9e9a-768f562d138d
2026-02-06 09:49:42 +01:00
kevinveenbirkenbach a9ac29c0c9 Removed unused run.py 2026-02-06 09:10:01 +01:00
kevinveenbirkenbach 2d64920444 Removed comments 2026-02-05 20:45:23 +01:00
kevinveenbirkenbach 92182f6f8b refactor(docker-compose): migrate compose_ca_inject_cmd to docker lookup and update tests
- Remove dependency on docker_compose variable in compose_ca_inject_cmd lookup
- Resolve compose paths via lookup('docker', ...) consistently
- Simplify lookup by dropping YAML coercion and templating helpers
- Add dedicated unit tests under tests/unit/roles/docker-compose/lookup_plugins
- Update tests to reflect new lookup contract and CA_TRUST validation

https://chatgpt.com/share/6984f2e7-8390-800f-ac7b-938adc3738e3
2026-02-05 20:43:08 +01:00