docker-framework
Ansible role that deploys my preferred docker setup that is accessible and writable by multiple users.
yannick
README
Docker Framework Role
A minimal, reusable Ansible role that creates the base Docker directory structure with proper permissions and ownership for all service deployments.
Single Responsibility
This role follows the KISS principle and has one job: create /docker directory with correct permissions. Nothing more, nothing less.
What it does
- Creates
/dockerdirectory withansible:usersownership - Sets permissions to
0775 - Applies group sticky bit (
g+s) for permission inheritance - Ensures the ansible user is in the users group
- Validates the setup
Usage
Include this role in your playbooks before any service roles that need Docker directories:
roles:
- role: geerlingguy.docker
tags: docker
- role: docker-framework
tags: [docker-framework, docker]
- role: connectivity # or storage, runner, etc.
tags: services
Variables
All variables have sensible defaults and rarely need to be overridden:
| Variable | Default | Description |
|---|---|---|
docker_framework_base_path |
/docker |
Base Docker directory path |
docker_framework_owner |
ansible |
Directory owner |
docker_framework_group |
users |
Directory group |
docker_framework_mode |
0775 |
Directory permissions |
docker_framework_sgid |
true |
Enable group sticky bit |
Directory Structure Created
/docker/
âââ owner: ansible
âââ group: users
âââ mode: 0775 + g+s
âââ (service-specific subdirectories created by service roles)
Dependencies
- None (minimal by design)
Tags
docker-framework: All tasksdirectories: Directory creationpermissions: Permission setupusers: User group managementvalidate: Validation tasks
Philosophy
This role embodies the Unix philosophy: "Do one thing and do it well." It provides a solid, reusable foundation that all service deployment roles can depend on without complexity or bloat.
Repository Statistics
0
Stars
0
Forks
1
Watchers
0
Issues
Default Branch:main
Created:September 3, 2025
Last Updated:October 2, 2025
Repository Size:0.02 KB