diff --git a/roles/network_plugin/flannel/tasks/main.yml b/roles/network_plugin/flannel/tasks/main.yml index 9588559f6..1dea800be 100644 --- a/roles/network_plugin/flannel/tasks/main.yml +++ b/roles/network_plugin/flannel/tasks/main.yml @@ -42,12 +42,14 @@ mode: 0644 notify: - restart docker + when: ansible_os_family != "CoreOS" -- name: Flannel | Create docker config symlink for CoreOS - file: - src: "/etc/default/docker" - dest: "/run/flannel_docker_opts.env" - state: link +- name: Flannel | Create docker dropin for CoreOS + template: + src: docker-dropin + dest: "/etc/systemd/system/docker.service.d/flannel-options.conf" + notify: + - restart docker when: ansible_os_family == "CoreOS" - meta: flush_handlers diff --git a/roles/network_plugin/flannel/templates/docker-systemd b/roles/network_plugin/flannel/templates/docker-systemd new file mode 100644 index 000000000..8d7d6ad83 --- /dev/null +++ b/roles/network_plugin/flannel/templates/docker-systemd @@ -0,0 +1,2 @@ +[Service] +Environment="DOCKER_OPTS=--bip={{ flannel_subnet }} --mtu={{ flannel_mtu }} {% if docker_options is defined %}{{ docker_options }}{% endif %}"