Skip to content

Handle inventory symlinks - #91

Open
hazzuk wants to merge 2 commits into
reusefrom
inventory-custom-symlinks
Open

hazzuk wants to merge 2 commits into
reusefrom
inventory-custom-symlinks

Conversation

@hazzuk

@hazzuk hazzuk commented Sep 5, 2026

Copy link
Copy Markdown
Owner

Description

Allows for the inventory directory to be used with symbolic links. Both the directory itself, and when applicable any custom directories present within.

Notes

The primary purpose of this PR is to serve as a middle ground for users wanting to deploy existing 'manual' Docker compose stack files via Ansible.

Due to the way the compose role works, allowing users to add their own standard compose.yml files would require a meaningful amount of new code. Code which would work counter to the existing system, add further complexity, and wouldn't provide any meaningful control over the deployed stacks.

However, there is still a valid need for 'personal' Docker compose stacks.


Users can now utilise their karo-inventory repo to create the appropriate directories for custom stacks (like they would inside a karo-custom repo). I feel this is now a valid option as one, the karo-cli tool makes creating the directory structure and required files easy. And two, the required defaults files can be extremely minimal.

See the following example:

karo-compose/defaults/main/inventory_adhoc/main.yml

inventory_adhoc_stacks:
  - busybox

karo-compose/defaults/main/inventory_adhoc/busybox.yml

inventory_adhoc_busybox_enabled: false

inventory_adhoc_busybox_stack_defaults:
  busybox:
    image: docker.io/busybox
    version: 1.37.0-glibc@sha256:3f9777e7e82e8591542f72b965ec7db7e8b3bdb59692976af1bb9b2850b05a4e

host_vars/homeserver/vault.yml

# stacks
# ---

inventory_adhoc_busybox_enabled: true

This new functionality achieves the following:

  • Allows users who already have a public karo-custom repo to create separate private stacks
  • Stacks inherit all the benefits of the existing compose role deployment system (ordering of deployments, stack enabled/disabled control, option for templated variables)
  • Stacks are tracked in Git
  • Introduces the user to the karo-custom system more gradually

There is now three separate approaches for Docker compose stacks:

  1. Want to share the stack with others? Create a public karo-custom repo.

  2. Want to deploy a private stack while still using Ansible? Use your existing karo-inventory repo.

  3. Want to deploy a standard compose.yml file without making changes? Create the file within /srv/docker/local, and run standard Docker compose commands.

Checklist

  • Written documentation
  • [n/a] Linked relevant issues

Allows an inventory repo to be used as a private karo-custom repo.
@hazzuk hazzuk added the Kind/Feature New functionality label Sep 5, 2026
@hazzuk

hazzuk commented Sep 5, 2026

Copy link
Copy Markdown
Owner Author

This change may require updates to be made to the karo-custom documentation. As users may become overwhelmed when trying to implement a simple custom stack. Or perhaps a new quick start guide would help, which could link to further docs pages.

@hazzuk
hazzuk requested a review from mosslocker September 6, 2026 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Kind/Feature New functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant