23 lines
1.0 KiB
YAML
23 lines
1.0 KiB
YAML
- hosts: [{{host}}]
|
|
become: yes
|
|
tasks:
|
|
- get_url:
|
|
url: https://github.com/Metaswitch/calico-docker/releases/download/{{version}}/calicoctl
|
|
dest: /usr/bin/calicoctl-{{version}}
|
|
- shell: chmod +x /usr/bin/calicoctl-{{version}}
|
|
- file: dest=/usr/bin/calicoctl src=/usr/bin/calicoctl-{{version}} state=link
|
|
- template:
|
|
src: {{templates_dir}}/calico-etcd.manifest
|
|
dest: /etc/kubernetes/manifests/calico-etcd.manifest
|
|
- template:
|
|
src: {{templates_dir}}/calico-node.service
|
|
dest: /etc/systemd/system/calico-node.service
|
|
# wait for docker images ... mostly
|
|
# TODO(jnowak): fix it by pulling image in advance
|
|
- wait_for: host=0.0.0.0 port={{etcd_port}} connect_timeout=5 state=started timeout=300
|
|
- shell: systemctl daemon-reload
|
|
- service: name=calico-node.service enabled=yes state=restarted
|
|
{% if options %}
|
|
- shell: ETCD_AUTHORITY={{etcd_authority_internal}} calicoctl pool add {{network}}/{{prefix}} {{options}}
|
|
{% endif %}
|