forked from shahar-klein/poorspray
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cluster.yaml
58 lines (48 loc) · 1.32 KB
/
cluster.yaml
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
#roles/<role>/task/main
#-install
#-config
#-triger handlers
#roles/defaults/main
#- many vars - use namespace. i.e. role_varname
---
- hosts: all
gather_facts: True
become: True
become_user: root
tasks:
- debug:
msg: "DEBUG {{ playbook_dir }} {{ inventory_hostname }} {{ inventory_hostname_short }} {{ hostvars[inventory_hostname].ansible_host }} {{ hostvars[inventory_hostname].ansible_distribution }} {{ ansible_os_family }}"
tags: foo2
#when: ansible_distribution == "CentOS"
- hosts: all
gather_facts: false
roles:
- role: kubernetes/host-common
tags: install-stuff
- hosts: kube-master
gather_facts: false
roles:
- role: kubernetes/master
vars:
pod_network_cidr: "{{ pods_network_cidr }}"
service_cidr: "{{ cluster_service_cidr }}"
tags: set-master
- hosts: kube-node
gather_facts: false
roles:
- role: kubernetes/node
tags: set-nodes
#- hosts: kube-master
#gather_facts: false
#roles:
# - role: kubernetes/install-kubevirt
#tags: install-kubevirt
- hosts: k8s-cluster
gather_facts: false
roles:
- role: kubernetes/network-plugin
vars:
K8S_apiserver_address: "{{ hostvars[groups['kube-master'][0]].ansible_host }}"
net_cidr: "{{ pods_network_cidr }}"
svc_cidr: "{{ cluster_service_cidr }}"
tags: network