c12s-kubespray/roles/network_plugin/flannel/tasks/main.yml
Bogdan Dobrelya 6467451a86 Add wait for etcd for flannel network plugin
Signed-off-by: Bogdan Dobrelya <bdobrelia@mirantis.com>
2016-08-24 12:28:18 +02:00

61 lines
1.5 KiB
YAML

---
- name: Flannel | Write flannel configuration
template:
src: network.json
dest: /etc/flannel-network.json
backup: yes
- name: Flannel | Create flannel pod manifest
template:
src: flannel-pod.yml
dest: /etc/kubernetes/manifests/flannel-pod.manifest
notify: delete default docker bridge
- name: Flannel | wait for etcd
uri: url=http://localhost:2379/health
register: result
until: result.status == 200
retries: 10
delay: 5
when: inventory_hostname in groups['kube-master']
- name: Flannel | Wait for flannel subnet.env file presence
wait_for:
path: /run/flannel/subnet.env
delay: 5
timeout: 600
- name: Flannel | Get flannel_subnet from subnet.env
shell: cat /run/flannel/subnet.env | awk -F'=' '$1 == "FLANNEL_SUBNET" {print $2}'
register: flannel_subnet_output
changed_when: false
- set_fact:
flannel_subnet: "{{ flannel_subnet_output.stdout }}"
- name: Flannel | Get flannel_mtu from subnet.env
shell: cat /run/flannel/subnet.env | awk -F'=' '$1 == "FLANNEL_MTU" {print $2}'
register: flannel_mtu_output
changed_when: false
- set_fact:
flannel_mtu: "{{ flannel_mtu_output.stdout }}"
- name: Flannel | Set docker daemon options
template:
src: docker
dest: "/etc/default/docker"
owner: root
group: root
mode: 0644
notify:
- restart docker
- name: Flannel | Create docker config symlink for CoreOS
file:
src: "/etc/default/docker"
dest: "/run/flannel_docker_opts.env"
state: link
when: ansible_os_family == "CoreOS"
- meta: flush_handlers