diff --git a/defaults/main.yml b/defaults/main.yml index e2b4152..035f408 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -278,7 +278,7 @@ zun_services: group: zun_compute service_name: zun-compute init_config_overrides: "{{ zun_compute_init_overrides }}" - start_order: 4 + start_order: 5 execstarts: "{{ zun_bin }}/zun-compute --config-dir /etc/zun" zun-wsproxy: group: zun_api @@ -290,7 +290,7 @@ zun_services: group: zun_compute service_name: zun-docker-cleanup init_config_overrides: "{{ zun_docker_cleanup_init_overrides }}" - start_order: 5 + start_order: 6 execstarts: "{{ zun_bin }}/zun-docker-cleanup" timer: state: started @@ -298,6 +298,13 @@ zun_services: OnBootSec: 30min OnCalendar: "{{ (zun_docker_prune_frequency == 'day') | ternary('daily', zun_docker_prune_frequency+'ly') }}" Persistent: true + docker: + group: zun_compute + service_name: docker + init_config_overrides: {} + start_order: 4 + systemd_overrides_only: True + systemd_overrides: "{{ zun_docker_init_defaults | combine(zun_docker_init_overrides) }}" # Common pip packages zun_pip_packages: @@ -347,10 +354,18 @@ zun_kuryr_init_defaults: Group: "{{ zun_kuryr_system_group_name }}" User: "{{ zun_kuryr_system_user_name }}" +## Default zun+docker options used within the systemd unit file. +zun_docker_init_defaults: + Service: + ExecStart: + - "" + - "/usr/bin/dockerd --group {{ zun_system_group_name }} -H tcp://{{ zun_docker_bind_host }}:{{ zun_docker_bind_port }} -H unix:///var/run/docker.sock --cluster-store etcd://{% for item in groups['zun_api'] %}{{ hostvars[item]['ansible_host'] }}:2379{% if not loop.last %},{% endif %}{% endfor %} --add-runtime kata=/usr/bin/kata-runtime" + ## Tunable overrides for service unit files. zun_api_paste_ini_overrides: {} zun_api_init_overrides: {} zun_wsproxy_init_overrides: {} zun_compute_init_overrides: {} zun_kuryr_init_overrides: {} +zun_docker_init_overrides: {} zun_docker_cleanup_init_overrides: {} diff --git a/tasks/zun_compute.yml b/tasks/zun_compute.yml index 302eee3..57b11dd 100644 --- a/tasks/zun_compute.yml +++ b/tasks/zun_compute.yml @@ -216,7 +216,6 @@ mode: "0750" owner: "{{ zun_kuryr_system_user_name }}" group: "{{ zun_kuryr_system_group_name }}" - - path: "/etc/systemd/system/docker.service.d" - path: "/etc/docker/plugins" tags: - zun-kuryr-dirs @@ -235,10 +234,6 @@ dest: "/etc/kuryr/kuryr.conf" config_overrides: "{{ zun_kuryr_conf_overrides }}" config_type: "ini" - - src: "systemd-docker-override.conf.j2" - dest: "/etc/systemd/system/docker.service.d/zun-docker.conf" - config_overrides: "{{ zun_kuryr_conf_overrides }}" - config_type: "ini" notify: - Manage LB - Restart docker @@ -299,3 +294,8 @@ owner: "root" group: "root" mode: "0755" + +- name: Remove legacy systemd docker override + file: + path: "/etc/systemd/system/docker.service.d/zun-docker.conf" + state: absent diff --git a/templates/systemd-docker-override.conf.j2 b/templates/systemd-docker-override.conf.j2 deleted file mode 100644 index 125bebc..0000000 --- a/templates/systemd-docker-override.conf.j2 +++ /dev/null @@ -1,3 +0,0 @@ -[Service] -ExecStart= -ExecStart=/usr/bin/dockerd --group {{ zun_system_group_name }} -H tcp://{{ zun_docker_bind_host }}:{{ zun_docker_bind_port }} -H unix:///var/run/docker.sock --cluster-store etcd://{% for item in groups['zun_api'] %}{{ hostvars[item]['ansible_host'] }}:2379{% if not loop.last %},{% endif %}{% endfor %} --add-runtime kata=/usr/bin/kata-runtime