Add support for container devices
This commit is contained in:
@@ -3,6 +3,7 @@ container_command: []
|
|||||||
container_entrypoint: ""
|
container_entrypoint: ""
|
||||||
container_user: ""
|
container_user: ""
|
||||||
container_mounts: []
|
container_mounts: []
|
||||||
|
container_devices: []
|
||||||
container_publish_ports: []
|
container_publish_ports: []
|
||||||
container_networks: []
|
container_networks: []
|
||||||
container_ip: ""
|
container_ip: ""
|
||||||
|
|||||||
@@ -92,6 +92,21 @@ argument_specs:
|
|||||||
required: false
|
required: false
|
||||||
default: []
|
default: []
|
||||||
|
|
||||||
|
container_devices:
|
||||||
|
description: List of devices to be added inside the container.
|
||||||
|
type: list
|
||||||
|
required: false
|
||||||
|
default: []
|
||||||
|
elements: dict
|
||||||
|
options:
|
||||||
|
source:
|
||||||
|
description: Device path on host
|
||||||
|
type: str
|
||||||
|
required: true
|
||||||
|
destination:
|
||||||
|
description: Device path inside the container. Defaults to same as host.
|
||||||
|
type: str
|
||||||
|
required: false
|
||||||
container_publish_ports:
|
container_publish_ports:
|
||||||
description: "A list of published ports in docker format (<host listen address>:<host port>:<container port>)"
|
description: "A list of published ports in docker format (<host listen address>:<host port>:<container port>)"
|
||||||
type: list
|
type: list
|
||||||
|
|||||||
@@ -48,6 +48,7 @@
|
|||||||
entrypoint: "{{ container_entrypoint or omit }}"
|
entrypoint: "{{ container_entrypoint or omit }}"
|
||||||
user: "{{ container_user or omit }}"
|
user: "{{ container_user or omit }}"
|
||||||
mount: "{{ _container_mounts | map('items') | map('map', 'join', '=') | map('join', ',') }}"
|
mount: "{{ _container_mounts | map('items') | map('map', 'join', '=') | map('join', ',') }}"
|
||||||
|
device: "{{ _container_devices }}"
|
||||||
network: "{{ _container_networks_with_ip }}"
|
network: "{{ _container_networks_with_ip }}"
|
||||||
publish: "{{ container_publish_ports }}"
|
publish: "{{ container_publish_ports }}"
|
||||||
secrets: "{{ _container_secrets }}"
|
secrets: "{{ _container_secrets }}"
|
||||||
|
|||||||
@@ -49,6 +49,25 @@ _container_mounts: >-
|
|||||||
| zip(_container_volume_mount_sources) | map('combine')
|
| zip(_container_volume_mount_sources) | map('combine')
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
_container_devices_withdefaults: >-
|
||||||
|
{{
|
||||||
|
container_devices
|
||||||
|
| map(attribute='source')
|
||||||
|
| map('community.general.dict_kv', 'destination')
|
||||||
|
| zip(container_devices)
|
||||||
|
| map('combine')
|
||||||
|
}}
|
||||||
|
_container_devices: >-
|
||||||
|
{{
|
||||||
|
_container_devices_withdefaults
|
||||||
|
| map(attribute='source')
|
||||||
|
| zip(
|
||||||
|
_container_devices_withdefaults
|
||||||
|
| map(attribute='destination')
|
||||||
|
)
|
||||||
|
| map('join', ':')
|
||||||
|
}}
|
||||||
|
|
||||||
_container_secrets: >-
|
_container_secrets: >-
|
||||||
{{
|
{{
|
||||||
container_secrets
|
container_secrets
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ service_container_additional_networks: []
|
|||||||
service_container_user: ""
|
service_container_user: ""
|
||||||
service_container_publish_ports: []
|
service_container_publish_ports: []
|
||||||
service_container_mounts: []
|
service_container_mounts: []
|
||||||
|
service_container_devices: []
|
||||||
service_container_secrets: []
|
service_container_secrets: []
|
||||||
service_container_env: {}
|
service_container_env: {}
|
||||||
|
|
||||||
|
|||||||
@@ -169,6 +169,21 @@ argument_specs:
|
|||||||
elements: str
|
elements: str
|
||||||
required: false
|
required: false
|
||||||
default: []
|
default: []
|
||||||
|
service_container_devices:
|
||||||
|
description: List of devices to be added inside the service main container.
|
||||||
|
type: list
|
||||||
|
required: false
|
||||||
|
default: []
|
||||||
|
elements: dict
|
||||||
|
options:
|
||||||
|
source:
|
||||||
|
description: Device path on host
|
||||||
|
type: str
|
||||||
|
required: true
|
||||||
|
destination:
|
||||||
|
description: Device path inside the container. Defaults to same as host.
|
||||||
|
type: str
|
||||||
|
required: false
|
||||||
service_container_secrets:
|
service_container_secrets:
|
||||||
description:
|
description:
|
||||||
- >
|
- >
|
||||||
|
|||||||
@@ -32,6 +32,7 @@
|
|||||||
container_entrypoint: "{{ service_container_entrypoint }}"
|
container_entrypoint: "{{ service_container_entrypoint }}"
|
||||||
container_user: "{{ service_container_user }}"
|
container_user: "{{ service_container_user }}"
|
||||||
container_mounts: "{{ _service_container_mounts }}"
|
container_mounts: "{{ _service_container_mounts }}"
|
||||||
|
container_devices: "{{ service_container_devices }}"
|
||||||
container_publish_ports: "{{ service_container_publish_ports }}"
|
container_publish_ports: "{{ service_container_publish_ports }}"
|
||||||
container_networks: "{{ _service_container_networks }}"
|
container_networks: "{{ _service_container_networks }}"
|
||||||
container_ip: "{{ service_container_ip }}"
|
container_ip: "{{ service_container_ip }}"
|
||||||
|
|||||||
Reference in New Issue
Block a user