8000 Configurable base directories for storage and Ansible content by bamhm182 · Pull Request #1 · bamhm182/AnsiBlaster · GitHub
[go: up one dir, main page]

Skip to content
< 8000 div class="height-full">

Configurable base directories for storage and Ansible content - #1

Merged
bamhm182 merged 2 commits into
mainfrom
claude/ansiblaster-configurable-dirs-zo1qe4
Aug 26, 2026
Merged

bamhm182 merged 2 commits into
mainfrom
claude/ansiblaster-configurable-dirs-zo1qe4

Conversation

@bamhm182
Copy link
Copy Markdown
Owner

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/ansible paths:

  • ANSIBLASTER_DIR (top-level, or dir: in config.yaml) — relocates the SQLite database and ansible-runner job artifacts together, as ${dir}/ansiblaster.db and ${dir}/artifacts, instead of the hardcoded /opt/ansiblaster. Useful for a non-root uv run checkout on a host where /opt isn't writable.
  • ANSIBLASTER_ANSIBLE__PATH (or ansible.path: under the ansible: section) — relocates roles_path/playbooks_path together, as sibling ${path}/roles and ${path}/playbooks directories, 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_path always wins over the corresponding base-dir override.

Also makes JobManager create its artifacts_path directory eagerly at construction (app startup), matching database.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.path deliberately does not create any directories itself: roles_path/playbooks_path are expected to already hold real Ansible content (often a read-only bind mount), not app-owned storage.

Testing

  • uv run pytest — 215 passed
  • uv run ruff check . — clean
  • uv run ruff format --check . — clean

🤖 Generated with Claude Code


Generated by Claude Code

claude added 2 commits August 26, 2026 17:29
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.
@bamhm182
bamhm182 merged commit 76faf55 into main Aug 26, 2026
1 check 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.

2 participants

0