forked from zhangguanzhang/Kubernetes-ansible
-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy.yml
78 lines (67 loc) · 1.41 KB
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
---
- hosts: Allnode
gather_facts: yes
tasks:
- stat:
path: /usr/bin/docker
register: docker_cmd
tags:
- docker
- include_role:
name : docker
apply:
tags:
- docker
when: not docker_cmd.stat.exists
tags:
- docker
# down_file
- hosts: localhost
gather_facts: no
tasks:
- stat:
path: /usr/local/bin/kubectl
register: kubectl_file
- fail: msg='请下载文件,运行脚本`bash get-binaries.sh all`或者自行下载后再运行deploy.yml'
when: not kubectl_file.stat.exists
- hosts: localhost
gather_facts: no
roles:
- tls
tags:
- tls
- hosts: etcd
gather_facts: yes
roles:
- etcd
tags:
- etcd
- hosts: master
gather_facts: yes
roles:
- { role: HA, tags: HA, when: "groups['master'] | length != 1" }
- hosts: master
gather_facts: yes
roles:
- master
tags:
- master
- hosts: localhost
gather_facts: no
roles:
- bootstrap
tags:
- bootstrap
- hosts: localhost
gather_facts: no
tasks:
- stat:
path: /usr/local/bin/flanneld
register: flanneld_file
- fail: msg='请下载文件,运行脚本`bash get-binaries.sh flanneld`或者自行下载后再运行deploy.yml --tags addon'
when: not flanneld_file.stat.exists
- hosts: Allnode
gather_facts: no
roles:
- { role: node, tags: node }
- { role: KubernetesCoreAddons, tags: addon }