36 lines
908 B
YAML
36 lines
908 B
YAML
- name: prepare some dirs
|
|
file: name={{ item }} state=directory
|
|
with_items:
|
|
- "{{ bin_dir }}"
|
|
- "{{ ca_dir }}"
|
|
- /root/.kube
|
|
- "{{data_dir}}/log/kubelet/"
|
|
- "{{data_dir}}/log/kube-proxy/"
|
|
|
|
- name: 写入环境变量$PATH
|
|
lineinfile:
|
|
dest: ~/.bashrc
|
|
state: present
|
|
regexp: 'greatwall(path)'
|
|
line: 'export PATH={{ bin_dir }}:$PATH # generated by greatwall(path)'
|
|
|
|
- name: 下载kubectl
|
|
copy: src={{ base_dir }}/bin/kubernetes/kubectl dest={{ bin_dir }}/kubectl mode=0755
|
|
|
|
- name: 下载cfssl
|
|
copy: src={{ base_dir }}/bin/cfssl/{{ item }} dest={{ bin_dir }}/ mode=0755
|
|
with_items:
|
|
- cfssl
|
|
- cfssljson
|
|
|
|
- name: 分发CA 证书
|
|
copy: src={{ ca_dir }}/{{ item }} dest={{ ca_dir }}/{{ item }} mode=0644
|
|
with_items:
|
|
- ca.pem
|
|
- ca-key.pem
|
|
- ca.csr
|
|
- ca-config.json
|
|
|
|
- name: 安装kubeconfig配置文件
|
|
copy: src=/root/.kube/config dest=/root/.kube/config
|