feat: add option to add custom unit override options #5

Merged
xoxys merged 5 commits from unit-override into main 2023-06-05 20:55:26 +00:00
2 changed files with 13 additions and 5 deletions
Showing only changes of commit 537ef1c2fc - Show all commits

View File

@ -18,7 +18,16 @@ dockerengine_ansible_deps:
- docker
dockerengine_service: docker
dockerengine_service_override_unit: []
# @var dockerengine_service_override_unit:description: >
# Multiline string of options to add to the `systemd` service override unit section.
# @end
# @var dockerengine_service_override_unit: $ "_unset_"
# @var dockerengine_service_override_unit:example: >
# dockerengine_service_override_unit: |
# After=time-sync.target
# Requires=time-sync.target
# @end
dockerengine_docker_group_enabled: False

View File

@ -1,10 +1,9 @@
#jinja2: lstrip_blocks: True
{{ ansible_managed | comment }}
{% if dockerengine_service_override_unit | default([]) | length > 0 %}
{% if dockerengine_service_override_unit is defined %}
[Unit]
{% for item in dockerengine_service_override_unit %}
{{ item }}
{% endfor %}
{{ dockerengine_service_override_unit }}
{% endif %}
[Service]
EnvironmentFile=-/etc/sysconfig/docker
ExecStart=