Files
Kamino/roles/docker/defaults/main.yml
T
Dragonish 567e9cca7c
Build / build (pull_request) Successful in 27s
Lint / lint (pull_request) Successful in 2m15s
Molecule / molecule (pull_request) Successful in 4m17s
feat(docker): add opt-in boot and shutdown units for hosts that run Docker with live-restore
docker_start_missed installs a boot unit that starts the containers dockerd's
restore pass skipped after a reboot of the whole host. docker_stop_at_shutdown
installs a unit that ends container processes at shutdown while the network and
NFS shares are still up, so a container holding an NFS mount no longer stalls
the shutdown. Both default to false and do nothing without /usr/bin/docker.

Refs #369

Assisted-by: Claude Code
2026-11-25 17:31:37 +00:00

49 lines
2.5 KiB
YAML

---
docker_update: false
docker_remove_data: false
docker_remove: false
docker_packages:
- docker-ce
- docker-ce-cli
- containerd.io
docker_keyring_path: /etc/apt/keyrings/docker.asc
docker_apt_list_path: /etc/apt/sources.list.d/docker.list
docker_gpg_url: https://download.docker.com/linux/ubuntu/gpg
docker_repo_base_url: https://download.docker.com/linux/ubuntu
# Architecture written into the APT source. Empty (the default) derives it from the host: x86_64 gives amd64, aarch64 gives arm64, any
# other architecture fails the play, so set it here (for example armhf) when Docker publishes one for it.
docker_apt_arch: ""
docker_service: docker
docker_group: docker
# Usernames to add to the `docker` group at install time. Left empty by
# default: a role that needs Docker access but installs *after* this one in
# a host's `services:` list won't have created its run-as user yet when this
# role runs, so it must add itself to the group in its own tasks instead.
# This list only helps a role/user that already exists before `docker` runs.
docker_users: []
# Docker manipulates iptables directly for any published container port
# (`-p`), bypassing UFW rules entirely - so the role owns no UFW rule and does
# not call the ufw role.
# With live-restore Docker leaves containers running when dockerd stops, but a reboot of the whole host kills them, and dockerd's restore
# pass at the next boot sometimes skips one without trying. When true, a boot unit starts the containers that Docker left down: only
# those exited with code 255 during this boot whose restart policy is unless-stopped or always, so one stopped on purpose stays stopped.
# Off by default; set it on a host that runs Docker with live-restore.
docker_start_missed: false
# Seconds to wait after Docker answers, so dockerd's own restarts finish first.
docker_start_missed_settle_seconds: 30
# With live-restore dockerd does not stop containers at host shutdown, and systemd-shutdown signals them only after the network is gone. A
# container that holds an NFS mount then blocks in the kernel's final unmount until the SIGKILL timer, and the host takes minutes to stop.
# When true, a shutdown unit sends SIGTERM to every container process while the network and NFS are still up, waits up to
# docker_stop_at_shutdown_timeout seconds, then SIGKILL. It never uses `docker stop`, so the manually-stopped marker is not set.
# Off by default; set it on a host whose containers mount NFS shares.
docker_stop_at_shutdown: false
docker_stop_at_shutdown_timeout: 30