Skip to content

Traefik File Template

Overview

Generates a Traefik file template.


Deployment

sb install generate-traefik-file-template

Role Defaults

Info

Variables can be overridden in /srv/git/saltbox/inventories/host_vars/localhost.yml.

Example Override
traefik_file_template_file: "custom_value"
Avoid overriding variables ending in _default

When overriding variables that end in _default (like traefik_file_template_docker_envs_default), you replace the entire default configuration. Future updates that add new default values will not be applied to your setup, potentially breaking functionality.

Instead, use the corresponding _custom variable (like traefik_file_template_docker_envs_custom) to add your changes. Custom values are merged with defaults, ensuring you receive updates.

traefik_file_template_file
# Type: string
traefik_file_template_file: "/tmp/traefik-app.yml"
traefik_file_template_name
# Type: string
traefik_file_template_name: "{{ service_name.user_input | lower }}"
traefik_file_template_web_subdomain
# Type: string
traefik_file_template_web_subdomain: "{{ service_name.user_input | lower }}"
traefik_file_template_web_domain
# Type: string
traefik_file_template_web_domain: "{{ user.domain }}"
traefik_file_template_web_port
# Type: string
traefik_file_template_web_port: "{{ service_port.user_input }}"
traefik_file_template_web_ip
# Type: string
traefik_file_template_web_ip: "{{ service_ip.user_input }}"
traefik_file_template_web_scheme
# Type: string
traefik_file_template_web_scheme: "{{ service_scheme.user_input | lower }}"
traefik_file_template_traefik_enabled
# Type: string
traefik_file_template_traefik_enabled: "true"
traefik_file_template_traefik_sso_middleware
# Type: string
traefik_file_template_traefik_sso_middleware: "{{ traefik_default_sso_middleware if (service_sso_enabled.user_input | bool) else '' }}"
traefik_file_template_traefik_middleware_default
# Type: string
traefik_file_template_traefik_middleware_default: "{{ traefik_default_middleware }}"
traefik_file_template_traefik_api_enabled
# Type: string
traefik_file_template_traefik_api_enabled: "{{ (service_api_enabled.user_input | default(false) | bool) | default(false) }}"
traefik_file_template_traefik_api_endpoint
# Type: string
traefik_file_template_traefik_api_endpoint: "PathPrefix(`/api`)"
traefik_file_template_role_autoheal_enabled
# Enable or disable Autoheal monitoring for the container created when deploying
# Type: bool (true/false)
traefik_file_template_role_autoheal_enabled: true
traefik_file_template_role_depends_on
# List of container dependencies that must be running before the container start
# Type: string
traefik_file_template_role_depends_on: ""
traefik_file_template_role_depends_on_delay
# Delay in seconds before starting the container after dependencies are ready
# Type: string (quoted number)
traefik_file_template_role_depends_on_delay: "0"
traefik_file_template_role_depends_on_healthchecks
# Enable healthcheck waiting for container dependencies
# Type: string ("true"/"false")
traefik_file_template_role_depends_on_healthchecks:
traefik_file_template_role_diun_enabled
# Enable or disable Diun update notifications for the container created when deploying
# Type: bool (true/false)
traefik_file_template_role_diun_enabled: true
traefik_file_template_role_dns_enabled
# Enable or disable automatic DNS record creation for the container
# Type: bool (true/false)
traefik_file_template_role_dns_enabled: true
traefik_file_template_role_docker_controller
# Enable or disable Saltbox Docker Controller management for the container
# Type: bool (true/false)
traefik_file_template_role_docker_controller: true
traefik_file_template_role_traefik_autodetect_enabled
# Enable Traefik autodetect middleware for the container
# Type: bool (true/false)
traefik_file_template_role_traefik_autodetect_enabled: false
traefik_file_template_role_traefik_crowdsec_enabled
# Enable CrowdSec middleware for the container
# Type: bool (true/false)
traefik_file_template_role_traefik_crowdsec_enabled: false
traefik_file_template_role_traefik_error_pages_enabled
# Enable custom error pages middleware for the container
# Type: bool (true/false)
traefik_file_template_role_traefik_error_pages_enabled: false
traefik_file_template_role_traefik_gzip_enabled
# Enable gzip compression middleware for the container
# Type: bool (true/false)
traefik_file_template_role_traefik_gzip_enabled: false
traefik_file_template_role_traefik_middleware_http_api_insecure
# Type: bool (true/false)
traefik_file_template_role_traefik_middleware_http_api_insecure:
traefik_file_template_role_traefik_middleware_http_insecure
# Type: bool (true/false)
traefik_file_template_role_traefik_middleware_http_insecure:
traefik_file_template_role_traefik_robot_enabled
# Enable robots.txt middleware for the container
# Type: bool (true/false)
traefik_file_template_role_traefik_robot_enabled: true
traefik_file_template_role_traefik_tailscale_enabled
# Enable Tailscale-specific Traefik configuration for the container
# Type: bool (true/false)
traefik_file_template_role_traefik_tailscale_enabled: false
traefik_file_template_role_traefik_wildcard_enabled
# Enable wildcard certificate for the container
# Type: bool (true/false)
traefik_file_template_role_traefik_wildcard_enabled: true
traefik_file_template_role_web_fqdn_override
# Override the Traefik fully qualified domain name (FQDN) for the container
# Type: list
traefik_file_template_role_web_fqdn_override:

Example Override

traefik_file_template_role_web_fqdn_override:
  - "{{ traefik_host }}"
  - "traefik_file_template2.{{ user.domain }}"
  - "traefik_file_template.otherdomain.tld"

Note: Include {{ traefik_host }} to preserve the default FQDN alongside your custom entries

traefik_file_template_role_web_host_override
# Override the Traefik web host configuration for the container
# Type: string
traefik_file_template_role_web_host_override:

Example Override

traefik_file_template_role_web_host_override: "Host(`{{ traefik_host }}`) || Host(`{{ 'traefik_file_template2.' + user.domain }}`)"

Note: Use {{ traefik_host }} to include the default host configuration in your custom rule

traefik_file_template_role_web_scheme
# URL scheme to use for web access to the container
# Type: string ("http"/"https")
traefik_file_template_role_web_scheme: