Browse Source

lay down a systemd dropin instead of the /run/flannel_docker_opts.env symlink

pull/461/head
Spencer Smith 8 years ago
parent
commit
b74c2f89f0
2 changed files with 9 additions and 5 deletions
  1. 12
      roles/network_plugin/flannel/tasks/main.yml
  2. 2
      roles/network_plugin/flannel/templates/docker-systemd

12
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

2
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 %}"
Loading…
Cancel
Save