service: Support setting container user
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
---
|
---
|
||||||
service_domains: []
|
service_domains: []
|
||||||
|
|
||||||
|
service_container_user: ""
|
||||||
service_container_publish_ports: []
|
service_container_publish_ports: []
|
||||||
service_container_mounts: []
|
service_container_mounts: []
|
||||||
service_container_env: {}
|
service_container_env: {}
|
||||||
|
|||||||
@@ -25,6 +25,11 @@ argument_specs:
|
|||||||
description: "The image to run in the service container(s), in FQIN format (registry/imagename:tag)."
|
description: "The image to run in the service container(s), in FQIN format (registry/imagename:tag)."
|
||||||
type: str
|
type: str
|
||||||
required: true
|
required: true
|
||||||
|
service_container_user:
|
||||||
|
description: The UID to run as inside the container
|
||||||
|
type: str
|
||||||
|
required: false
|
||||||
|
default: ""
|
||||||
service_container_publish_ports:
|
service_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
|
||||||
|
|||||||
@@ -21,6 +21,7 @@
|
|||||||
vars:
|
vars:
|
||||||
container_name: "{{ service_name }}"
|
container_name: "{{ service_name }}"
|
||||||
container_image: "{{ service_container_image }}"
|
container_image: "{{ service_container_image }}"
|
||||||
|
container_user: "{{ service_container_user }}"
|
||||||
container_mounts: "{{ _service_container_mounts }}"
|
container_mounts: "{{ _service_container_mounts }}"
|
||||||
container_publish_ports: "{{ service_container_publish_ports }}"
|
container_publish_ports: "{{ service_container_publish_ports }}"
|
||||||
container_networks:
|
container_networks:
|
||||||
|
|||||||
@@ -1,4 +1,9 @@
|
|||||||
---
|
---
|
||||||
|
- name: Fail if service_container_user is not string
|
||||||
|
ansible.builtin.fail:
|
||||||
|
msg: "service_container_user must be a string, not int."
|
||||||
|
when: service_container_user is not string
|
||||||
|
|
||||||
- name: Fail if service_database_type is postgres but service_postgres_tag is not set
|
- name: Fail if service_database_type is postgres but service_postgres_tag is not set
|
||||||
ansible.builtin.fail:
|
ansible.builtin.fail:
|
||||||
msg: "service_postgres_tag needs to be set when database type is postgres"
|
msg: "service_postgres_tag needs to be set when database type is postgres"
|
||||||
|
|||||||
Reference in New Issue
Block a user