From e0a6bc96f16f7271f0400ff04d5b0f5b41b095b7 Mon Sep 17 00:00:00 2001 From: Spencer Smith Date: Tue, 30 Aug 2016 09:17:41 -0700 Subject: [PATCH 1/3] 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 %}" From c7bcbba17c43e091bab61cf49b233e7f41d613bf Mon Sep 17 00:00:00 2001 From: Spencer Smith Date: Tue, 30 Aug 2016 09:26:14 -0700 Subject: [PATCH 2/3] incorrect file name --- roles/network_plugin/flannel/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/network_plugin/flannel/tasks/main.yml b/roles/network_plugin/flannel/tasks/main.yml index 1dea800be..531038d1a 100644 --- a/roles/network_plugin/flannel/tasks/main.yml +++ b/roles/network_plugin/flannel/tasks/main.yml @@ -46,7 +46,7 @@ - name: Flannel | Create docker dropin for CoreOS template: - src: docker-dropin + src: docker-systemd dest: "/etc/systemd/system/docker.service.d/flannel-options.conf" notify: - restart docker From 246d4aa105a0aaaa94827eedf04ae728d46beb3a Mon Sep 17 00:00:00 2001 From: Spencer Smith Date: Tue, 30 Aug 2016 09:34:34 -0700 Subject: [PATCH 3/3] ensure docker.service.d exists --- roles/network_plugin/flannel/tasks/main.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/roles/network_plugin/flannel/tasks/main.yml b/roles/network_plugin/flannel/tasks/main.yml index 531038d1a..a6fa183ef 100644 --- a/roles/network_plugin/flannel/tasks/main.yml +++ b/roles/network_plugin/flannel/tasks/main.yml @@ -44,6 +44,10 @@ - restart docker when: ansible_os_family != "CoreOS" +- name: Flannel | Create docker service path for CoreOS + file: path=/etc/systemd/system/docker.service.d state=directory + when: ansible_os_family == "CoreOS" + - name: Flannel | Create docker dropin for CoreOS template: src: docker-systemd