-
Notifications
You must be signed in to change notification settings - Fork 10
/
boot.yml
31 lines (30 loc) · 886 Bytes
/
boot.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
---
- hosts: master
vars:
init_token: foobar.1234
tasks:
- name: Start Docker
service: enabled=yes state=started name=docker
become: true
- name: Start Kubelet
service: enabled=yes state=started name=kubelet
become: true
- name: Run Kubeadm master
command: kubeadm init --token {{ init_token }}
become: true
- hosts: nodes
vars:
init_token: foobar.1234
tags: nodes
tasks:
- name: Start Docker
service: enabled=yes state=started name=docker
become: true
- name: Start Kubelet
service: enabled=yes state=started name=kubelet
become: true
- name: Debug master_node IP
debug: msg='master node IP is {{ hostvars['master_node'].ansible_default_ipv4.address }}'
- name: Run Kubeadm nodes
command: kubeadm join --token {{ init_token }} {{ hostvars['master_node'].ansible_default_ipv4.address }}
become: true