6163fe166e
variables. 1. AWS has issues with ext4 (use xfs instead for CentOS only) 2. Make sure all the centos config files are include in the systemd config 3. Make sure that network options are set in the correct file by os family This allows downstream items like opencontrail and others change variables in expected locations.
30 lines
888 B
YAML
30 lines
888 B
YAML
---
|
|
- name: "Test if network plugin is defined"
|
|
fail: msg="ERROR, One network_plugin variable must be defined (Flannel or Calico)"
|
|
when: ( kube_network_plugin is defined and kube_network_plugin == "calico" and kube_network_plugin == "flannel" ) or
|
|
kube_network_plugin is not defined
|
|
|
|
- include: flannel.yml
|
|
when: kube_network_plugin == "flannel"
|
|
|
|
- name: Set docker daemon options
|
|
template:
|
|
src: docker
|
|
dest: "{{ '/etc/sysconfig/docker-network' if ansible_os_family == 'RedHat' else '/etc/default/docker' }}"
|
|
owner: root
|
|
group: root
|
|
mode: 0644
|
|
notify:
|
|
- restart docker
|
|
|
|
- name: Write docker.service systemd file
|
|
template:
|
|
src: systemd-docker.service
|
|
dest: /lib/systemd/system/docker.service
|
|
notify: restart docker
|
|
when: init_system == "systemd"
|
|
|
|
- meta: flush_handlers
|
|
|
|
- include: calico.yml
|
|
when: kube_network_plugin == "calico"
|