Svc-db-redis Role¶
Description: No description available
Variables¶
author: Kevin Veen-Birchenbach
description: Provides a Docker Compose snippet for a Redis service (redis:alpine) with volume, healthcheck and logging.
license: Infinito.Nexus NonCommercial License
license_url: https://s.infinito.nexus/license
company: Kevin Veen-Birchenbach
Consulting & Coaching Solutions https://www.veen.world
galaxy_tags: [‘redis’, ‘docker’, ‘cache’]
repository: https://s.infinito.nexus/code
issue_tracker_url: https://s.infinito.nexus/issues
documentation: https://s.infinito.nexus/code/tree/main/roles/svc-db-redis
min_ansible_version: 2.9
platforms: [{‘name’: ‘Any’, ‘versions’: [‘all’]}]
README¶
Redis¶
Description¶
This Ansible role provides a Jinja2 snippet to inject a Redis service
definition into your Docker Compose setup. It renders a
service.yml.j2 template that defines a redis container with
sensible defaults.
Overview¶
The role’s service.yml.j2 template includes:
An Alpine-based Redis image (
redis:alpine)Container naming based on
application_id(defaults toredis)Restart policy
Journald logging driver
A named volume (
redis:/data) for persistenceA basic healthcheck using
redis-cli pingAttachment to the default network
Include this snippet in your top-level docker-compose.yml.j2 where
you want Redis to appear.
Features¶
- Configurable ``application_id``Sets container name (
{{ application_id }}-redis). - Restart policyControlled by
DOCKER_RESTART_POLICY. - Journald loggingEnsures logs are captured by systemd’s journal.
- Persistent storageDeclares and mounts
redis:/data. - Built-in healthcheckUses
redis-cli pingwith configurable intervals and retries.