Repository navigation
Configurable base directories for storage and Ansible content - #1
Merged
Merged
Conversation
Adds a top-level `dir` setting (env var ANSIBLASTER_DIR, or a top-level `dir:` key in config.yaml) that relocates AnsiBlaster's own persistent storage -- the SQLite database and ansible-runner job artifacts -- to a directory of the user's choosing, instead of the hardcoded /opt/ansiblaster default. It only fills in database.path/ ansible.artifacts_path when those aren't separately overridden, so either can still be pointed elsewhere independently. Also makes JobManager create its artifacts_path directory eagerly at construction (app startup), matching database.path's existing eager parent-directory creation in make_engine() -- so a freshly configured directory (via ANSIBLASTER_DIR or otherwise) is created before it's used rather than assumed to already exist, regardless of whether a job has run yet. Updates CLAUDE.md/README with the new setting and adds test coverage in test_settings.py and test_jobs.py.
Adds ansible.path (env var ANSIBLASTER_ANSIBLE__PATH, or a `path:` key under this section's config.yaml block) that relocates roles_path and playbooks_path together, as sibling <path>/roles and <path>/playbooks directories, instead of the hardcoded /opt/ansible default -- mirrors the ANSIBLASTER_DIR/database.path+artifacts_path pattern one level down. It only fills in whichever of roles_path/playbooks_path is still at its built-in default, so either can still be pointed elsewhere independently. Unlike ANSIBLASTER_DIR, this does not create any directories -- roles/ playbooks are expected to already hold real Ansible content (often a read-only bind mount), not app-owned storage the app should create on first use. Updates CLAUDE.md/README with the new setting and adds test coverage in test_settings.py.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds two new base-directory overrides so AnsiBlaster's storage and Ansible content no longer have to live at the hardcoded
/opt/ansiblaster//opt/ansiblepaths:ANSIBLASTER_DIR(top-level, ordir:inconfig.yaml) — relocates the SQLite database and ansible-runner job artifacts together, as${dir}/ansiblaster.dband${dir}/artifacts, instead of the hardcoded/opt/ansiblaster. Useful for a non-rootuv runcheckout on a host where/optisn't writable.ANSIBLASTER_ANSIBLE__PATH(oransible.path:under theansible:section) — relocatesroles_path/playbooks_pathtogether, as sibling${path}/rolesand${path}/playbooksdirectories, instead of the hardcoded/opt/ansible.Both only fill in whichever underlying setting is still at its built-in default — an explicitly-set
database.path/ansible.artifacts_path/ansible.roles_path/ansible.playbooks_pathalways wins over the corresponding base-dir override.Also makes
JobManagercreate itsartifacts_pathdirectory eagerly at construction (app startup), matchingdatabase.path's existing eager parent-directory creation — so a freshly configured storage directory is created before it's used rather than assumed to already exist.ansible.pathdeliberately does not create any directories itself:roles_path/playbooks_pathare expected to already hold real Ansible content (often a read-only bind mount), not app-owned storage.Testing
uv run pytest— 215 passeduv run ruff check .— cleanuv run ruff format --check .— clean🤖 Generated with Claude Code
Generated by Claude Code