kubeasz/roles/calico/tasks/main.yml

39 lines
1001 B
YAML
Raw Normal View History

- name: 创建calico 相关目录
file: name={{ item }} state=directory
with_items:
- /etc/calico/ssl
- /etc/cni/net.d
2017-11-11 19:14:21 +08:00
- name: 复制CA 证书和etcd 证书
copy: src={{ item }} dest=/etc/calico/ssl/{{ item }}
with_items:
- ca.pem
- etcd.pem
- etcd-key.pem
- name: 创建 calico 的 systemd unit 文件
template: src=calico-node.service.j2 dest=/etc/systemd/system/calico-node.service
- name: daemon-reload
shell: systemctl daemon-reload
- name: enable-calico
shell: systemctl enable calico-node
- name: 重新启动calico
shell: systemctl restart calico-node
- name: 下载calico cni plugins和calicoctl 客户端
2017-11-11 19:14:21 +08:00
copy: src={{ base_dir }}/bin/{{ item }} dest={{ bin_dir }}/{{ item }} mode=0755
with_items:
- calico
- calico-ipam
- loopback
- calicoctl
2017-11-11 19:14:21 +08:00
- name: 准备 calicoctl配置文件
template: src=calicoctl.cfg.j2 dest=/etc/calico/calicoctl.cfg
2017-11-11 19:14:21 +08:00
- name: 准备 cni配置文件
template: src=cni-calico.conf.j2 dest=/etc/cni/net.d/10-calico.conf