This guide provides a full Ansible playbook to deploy Spoolman with Docker Compose on Debian 10+, Ubuntu LTS, and RHEL 9+ compatible hosts.
- name: Deploy Spoolman
hosts: spoolman
become: true
vars:
app_root: /opt/spoolman
app_port: 8000
spoolman_image: ghcr.io/donkie/spoolman:latest
spoolman_database_url: sqlite:////data/spoolman.sqlite3
tasks:
- name: Install Docker on Debian/Ubuntu
apt:
name:
- docker.io
- docker-compose-plugin
state: present
update_cache: true
when: ansible_os_family == "Debian"
- name: Install Docker on RHEL family
dnf:
name:
- docker
- docker-compose-plugin
state: present
when: ansible_os_family == "RedHat"
- name: Enable and start Docker
service:
name: docker
state: started
enabled: true
- name: Create application directory
file:
path: "{{ app_root }}"
state: directory
mode: "0755"
- name: Create data directory
file:
path: "{{ app_root }}/data"
state: directory
mode: "0755"
- name: Write Docker Compose file
copy:
dest: "{{ app_root }}/docker-compose.yml"
mode: "0644"
content: |
version: '3.8'
services:
spoolman:
image: {{ spoolman_image }}
restart: unless-stopped
ports:
- "{{ app_port }}:8000"
volumes:
- ./data:/data
environment:
- SPOOLMAN_DATABASE_URL={{ spoolman_database_url }}
- SPOOLMAN_HOST=0.0.0.0
- SPOOLMAN_PORT=8000
- name: Start application stack
command: docker compose up -d
args:
chdir: "{{ app_root }}"
latest in production environmentsAny questions?
Feel free to contact us. Find all contact information on our contact page.