Fix calico with systemd

This commit is contained in:
Jean-Christophe Sirot 2016-01-08 10:32:43 +01:00
parent d5320961e9
commit 6f9148e994
3 changed files with 4 additions and 5 deletions

View file

@ -51,7 +51,7 @@
- name: Calico | Write calico-node systemd init file - name: Calico | Write calico-node systemd init file
template: src=calico/calico-node.service.j2 dest=/etc/systemd/system/calico-node.service template: src=calico/calico-node.service.j2 dest=/etc/systemd/system/calico-node.service
when: init_system == "systemd" when: init_system == "systemd"
notify: restart calico-node notify: restart systemd-calico-node
- name: Calico | Write calico-node initd script - name: Calico | Write calico-node initd script
template: src=calico/deb-calico.initd.j2 dest=/etc/init.d/calico-node owner=root mode=755 template: src=calico/deb-calico.initd.j2 dest=/etc/init.d/calico-node owner=root mode=755

View file

@ -8,9 +8,9 @@ After=docker.service etcd2.service
User=root User=root
PermissionsStartOnly=true PermissionsStartOnly=true
{% if inventory_hostname in groups['kube-node'] and peer_with_router|default(false)%} {% if inventory_hostname in groups['kube-node'] and peer_with_router|default(false)%}
ExecStart={{ bin_dir }}/calicoctl node --kubernetes --ip=${DEFAULT_IPV4} --as={{ local_as }} --detach=false ExecStart={{ bin_dir }}/calicoctl node --kubernetes --ip={{ip | default(ansible_default_ipv4.address) }} --as={{ local_as }} --detach=false
{% else %} {% else %}
ExecStart={{ bin_dir }}/calicoctl node --kubernetes --ip=${DEFAULT_IPV4} --detach=false ExecStart={{ bin_dir }}/calicoctl node --kubernetes --ip={{ip | default(ansible_default_ipv4.address) }} --detach=false
{% endif %} {% endif %}
Restart=always Restart=always
Restart=10 Restart=10

View file

@ -1,6 +1,5 @@
[config] [config]
CALICO_IPAM=true CALICO_IPAM=true
DEFAULT_IPV4={{ip | default(ansible_default_ipv4.address) }}
# Location of etcd cluster used by Calico. By default, this uses the etcd # Location of etcd cluster used by Calico. By default, this uses the etcd
# instance running on the Kubernetes Master # instance running on the Kubernetes Master