container: Add support for specifying secret type (untested)
This commit is contained in:
@@ -114,7 +114,14 @@ argument_specs:
|
||||
description: Length of randomly generated string
|
||||
type: int
|
||||
required: false
|
||||
defalut: 128
|
||||
default: 128
|
||||
type:
|
||||
description: How the secret will be exposed to the container
|
||||
type: str
|
||||
choices:
|
||||
- mount
|
||||
- env
|
||||
default: mount
|
||||
|
||||
container_env:
|
||||
description: A dict of environment variables for the container
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
mount: "{{ _container_mounts | map('items') | map('map', 'join', '=') | map('join', ',') }}"
|
||||
network: "{{ container_networks | map('regex_replace', '$', '.network') }}"
|
||||
publish: "{{ container_publish_ports }}"
|
||||
secrets: "{{ container_secrets | map(attribute='name') }}"
|
||||
secrets: "{{ _container_secrets }}"
|
||||
env: "{{ container_env.keys() | zip(container_env.values() | map('quote')) | community.general.dict }}"
|
||||
state: quadlet
|
||||
quadlet_file_mode: "0600"
|
||||
|
||||
@@ -22,6 +22,18 @@ _container_mounts: >-
|
||||
| zip(_container_volume_mount_sources) | map('combine')
|
||||
}}
|
||||
|
||||
_container_secrets: >-
|
||||
{{
|
||||
container_secrets
|
||||
| map(attribute='name')
|
||||
| zip(
|
||||
container_secrets
|
||||
| map(attribute='type', default='mount')
|
||||
| map('regex_replace', '^', 'type=')
|
||||
)
|
||||
| map('join', ',')
|
||||
}}
|
||||
|
||||
_container_quadlet_unit_options: |
|
||||
[Unit]
|
||||
Description=Container {{ container_name }}
|
||||
|
||||
@@ -138,6 +138,13 @@ argument_specs:
|
||||
type: int
|
||||
required: false
|
||||
default: 128
|
||||
type:
|
||||
description: How the secret will be exposed to the container
|
||||
type: str
|
||||
choices:
|
||||
- mount
|
||||
- env
|
||||
default: mount
|
||||
service_container_env:
|
||||
description: A dict of environment variables for the service container(s)
|
||||
type: dict
|
||||
|
||||
Reference in New Issue
Block a user