container: Support setting container hostname

This commit is contained in:
uumas
2026-03-12 00:12:03 +02:00
parent f721641fc6
commit ff1badbf03
3 changed files with 8 additions and 0 deletions

View File

@@ -6,6 +6,7 @@ container_mounts: []
container_devices: []
container_publish_ports: []
container_networks: []
container_hostname: ""
container_ip: ""
container_secrets: []
container_env: {}

View File

@@ -119,11 +119,17 @@ argument_specs:
required: false
default: []
elements: str
container_hostname:
description: Hostname to set inside the container. Available to other containers on the same network.
type: str
required: false
default: ""
container_ip:
description: IPv4 address for the container in the first network defined in container_networks
type: str
required: false
default: ""
container_secrets:
description: A list of secrets available to the container as file or environment variable
type: list

View File

@@ -50,6 +50,7 @@
mount: "{{ _container_mounts | map('items') | map('map', 'join', '=') | map('join', ',') }}"
device: "{{ _container_devices }}"
network: "{{ _container_networks_with_ip }}"
hostname: "{{ container_hostname or omit }}"
publish: "{{ container_publish_ports }}"
secrets: "{{ _container_secrets }}"
env: "{{ container_env }}"