From b74c2f89f05558b49745e45740a6f6ae2c3903af Mon Sep 17 00:00:00 2001 From: Spencer Smith Date: Tue, 30 Aug 2016 09:17:41 -0700 Subject: [PATCH] lay down a systemd dropin instead of the /run/flannel_docker_opts.env symlink --- roles/network_plugin/flannel/tasks/main.yml | 12 +++++++----- .../network_plugin/flannel/templates/docker-systemd | 2 ++ 2 files changed, 9 insertions(+), 5 deletions(-) create mode 100644 roles/network_plugin/flannel/templates/docker-systemd 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 %}"