container, service: Support reloading containers on template file change
This commit is contained in:
@@ -18,6 +18,8 @@ service_container_devices: []
|
||||
service_container_secrets: []
|
||||
service_container_env: {}
|
||||
service_container_add_capabilities: []
|
||||
service_container_reload_method: none
|
||||
service_container_reload_command: ""
|
||||
|
||||
service_database_type: none
|
||||
service_database_additional_networks: []
|
||||
|
||||
@@ -298,6 +298,26 @@ argument_specs:
|
||||
default: []
|
||||
elements: str
|
||||
|
||||
service_container_reload_method:
|
||||
description: |
|
||||
How to reload configuration when systemctl reload is called
|
||||
kill: Sends SIGHUP to the container
|
||||
command: Runs the specified command inside the container
|
||||
type: str
|
||||
required: false
|
||||
default: none
|
||||
choices:
|
||||
- kill
|
||||
- command
|
||||
- none
|
||||
service_container_reload_command:
|
||||
description: >-
|
||||
Command to run inside container when systemctl reload is called.
|
||||
Required if container_reload_method is command, ignored otherwise.
|
||||
type: str
|
||||
required: false
|
||||
default: ""
|
||||
|
||||
service_database_type:
|
||||
description:
|
||||
- Database type to set up.
|
||||
@@ -553,6 +573,25 @@ argument_specs:
|
||||
type: list
|
||||
required: false
|
||||
elements: str
|
||||
reload_method:
|
||||
description: |
|
||||
How to reload configuration when systemctl reload is called
|
||||
kill: Sends SIGHUP to the container
|
||||
command: Runs the specified command inside the container
|
||||
type: str
|
||||
required: false
|
||||
default: none
|
||||
choices:
|
||||
- kill
|
||||
- command
|
||||
- none
|
||||
reload_command:
|
||||
description: >-
|
||||
Command to run inside container when systemctl reload is called.
|
||||
Required if container_reload_method is command, ignored otherwise.
|
||||
type: str
|
||||
required: false
|
||||
default: ""
|
||||
secrets:
|
||||
description:
|
||||
- >
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
container_secrets: "{{ _service_additional_container_secrets }}"
|
||||
container_env: "{{ _service_additional_container.env }}"
|
||||
container_add_capabilities: "{{ _service_additional_container.add_capabilities }}"
|
||||
container_reload_method: "{{ _service_additional_container.reload_method }}"
|
||||
container_reload_command: "{{ _service_additional_container.reload_command }}"
|
||||
container_requires: "{{ _service_additional_container_requires }}"
|
||||
container_wants: "{{ _service_additional_container_wants }}"
|
||||
container_auto_update: "{{ service_auto_update }}"
|
||||
|
||||
@@ -24,7 +24,9 @@
|
||||
dest: "{{ item[1] }}"
|
||||
mode: "{{ item[0].mode | default('0644') }}"
|
||||
validate: "{{ validate if item[0].template_validate_command is defined else omit }}"
|
||||
notify: Restart container service {{ service_name }}
|
||||
notify: >-
|
||||
{{ 'Reload' if service_container_reload_method != 'none' else 'Restart' }}
|
||||
container service {{ service_name }}
|
||||
loop: "{{ _service_all_template_mounts | zip(_service_all_template_mount_host_files) }}"
|
||||
vars:
|
||||
validate: >-
|
||||
|
||||
@@ -48,6 +48,8 @@
|
||||
container_secrets: "{{ _service_container_secrets }}"
|
||||
container_env: "{{ service_container_env }}"
|
||||
container_add_capabilities: "{{ service_container_add_capabilities }}"
|
||||
container_reload_method: "{{ service_container_reload_method }}"
|
||||
container_reload_command: "{{ service_container_reload_command }}"
|
||||
container_requires: "{{ _service_container_requires }}"
|
||||
container_wants: "{{ _service_container_wants }}"
|
||||
container_auto_update: "{{ service_auto_update }}"
|
||||
|
||||
@@ -18,6 +18,8 @@ _service_additional_container_same_image_defaults:
|
||||
devices: "{{ service_container_devices }}"
|
||||
env: "{{ service_container_env }}"
|
||||
add_capabilities: "{{ service_container_add_capabilities }}"
|
||||
reload_method: "{{ service_container_reload_method }}"
|
||||
reload_command: "{{ service_container_reload_command }}"
|
||||
|
||||
_service_additional_container_different_image_defaults:
|
||||
user: ""
|
||||
@@ -28,6 +30,8 @@ _service_additional_container_different_image_defaults:
|
||||
publish_ports: []
|
||||
env: {}
|
||||
add_capabilities: []
|
||||
reload_method: none
|
||||
reload_command: ""
|
||||
secrets: []
|
||||
|
||||
_service_additional_same_image_containers: >-
|
||||
|
||||
Reference in New Issue
Block a user