diff --git a/roles/network_plugin/tasks/calico.yml b/roles/network_plugin/tasks/calico.yml index 6e269c5ebee9e167ca614c5478074916a1d50656..748d044a220b8a492c666912ee05b1e67785a253 100644 --- a/roles/network_plugin/tasks/calico.yml +++ b/roles/network_plugin/tasks/calico.yml @@ -55,6 +55,10 @@ template: src=calico/calico.conf.j2 dest=/usr/libexec/kubernetes/kubelet-plugins/net/exec/calico/calico_kubernetes.ini notify: restart calico-node +- name: Calico | Write /etc/network-environment + template: src=calico/network-environment.j2 dest=/etc/network-environment + when: init_system == "sysvinit" + - name: Calico | Write calico-node systemd init file template: src=calico/calico-node.service.j2 dest=/etc/systemd/system/calico-node.service when: init_system == "systemd" diff --git a/roles/network_plugin/templates/calico/deb-calico.initd.j2 b/roles/network_plugin/templates/calico/deb-calico.initd.j2 index cd66de53f15764f699217ef863560f40a58e4ad9..ddbc22959a2c67fed147d84d462d154e6a660e5a 100644 --- a/roles/network_plugin/templates/calico/deb-calico.initd.j2 +++ b/roles/network_plugin/templates/calico/deb-calico.initd.j2 @@ -10,6 +10,7 @@ # Description: # Runs calico as a docker container ### END INIT INFO +set -a PATH=/sbin:/usr/sbin:/bin:/usr/bin DESC="Calico-node Docker" diff --git a/roles/network_plugin/templates/calico/network-environment.j2 b/roles/network_plugin/templates/calico/network-environment.j2 new file mode 100644 index 0000000000000000000000000000000000000000..3d3f87b65f3effb1bc8e7dc4b11d1d663b22679a --- /dev/null +++ b/roles/network_plugin/templates/calico/network-environment.j2 @@ -0,0 +1,2 @@ +DEFAULT_IPV4={{ip | default(ansible_default_ipv4.address) }} +ETCD_AUTHORITY=127.0.0.1:2379 diff --git a/roles/network_plugin/templates/calico/rh-calico.initd.j2 b/roles/network_plugin/templates/calico/rh-calico.initd.j2 index d4f798f5652d0a9632b6d0204bd5c43fbc015db2..6fb870652948d76d2caa8eda09955a675faea472 100644 --- a/roles/network_plugin/templates/calico/rh-calico.initd.j2 +++ b/roles/network_plugin/templates/calico/rh-calico.initd.j2 @@ -4,6 +4,7 @@ # # chkconfig: 2345 95 95 # description: Daemon for calico-node (http://www.projectcalico.org/) +set -a ### BEGIN INIT INFO # Provides: calico-node