File tree 7 files changed +69
-18
lines changed
7 files changed +69
-18
lines changed Original file line number Diff line number Diff line change
1
+ - name : create new worker node
2
+ hosts : localhost
3
+ connection : local
4
+ gather_facts : false
5
+
6
+ vars_files :
7
+ - " vm_vars/credentials.yaml"
8
+ - " vm_vars/settings.yaml"
9
+ vars :
10
+ # redefine any VM variables that you want to override
11
+ worker_name : node4
12
+ ip : " {{ base_net }}.137" # # Important to set this up to a non taken ip within the vlan
13
+
14
+ tasks :
15
+
16
+ - name : worker creation
17
+ gandi_vps :
18
+ gandi_api_key : " {{ gandi_api_key }}"
19
+ name : " {{ worker_name }}"
20
+ image : " {{ image }}"
21
+ machine_type : custom
22
+ datacenter : " {{ datacenter }}"
23
+ sshkey_ids :
24
+ - " {{ gandi_ssh_key_id }}"
25
+ cores : " {{ node_cpu }}"
26
+ memory : " {{ node_mem }}"
27
+ disk : " {{ node_disk }}"
28
+ interfaces : {'privates': [{'vlan': "{{ vlan_name }}", 'ipv4': "{{ ip }}"}]}
29
+ state : running
30
+ farm : worker
31
+ tags :
32
+ - worker
33
+
34
+ - name : bootstrap kubernetes worker
35
+ vars :
36
+ # kube_token: # Generate a token
37
+ # kubernetes_version: #if the version differs from the global one
38
+ hosts : node4 # Rename to ${worker_name}
39
+ roles :
40
+ - common
41
+ - docker
42
+ - kube
43
+ - worker
44
+
Original file line number Diff line number Diff line change @@ -26,7 +26,8 @@ kubeadm_reset: true
26
26
ansible_user: root
27
27
28
28
# Versions
29
- node_exporter_version: 0.17.0
29
+ kubernetes_version: "1.13.2-00"
30
+ docker_version: "17.03.3~ce-0~ubuntu-xenial"
30
31
alertmanager_version: 0.15.3
31
32
docker_version: TBD #not used
32
33
Original file line number Diff line number Diff line change 1
1
---
2
-
3
- - include : node_exporter.yml
4
-
5
2
- name : copy ssh keys
6
3
copy :
7
4
src : files/ssh_authorized_keys
22
19
apt :
23
20
update_cache : yes
24
21
upgrade : dist
25
-
26
-
Original file line number Diff line number Diff line change 1
1
- name : install dependencies
2
2
apt :
3
- package : {{ item }}
3
+ package : " {{ item }}"
4
4
state : installed
5
5
update_cache : yes
6
6
with_items :
22
22
23
23
- name : install docker ce
24
24
apt :
25
- package : {{ item }}
25
+ package : " {{ item }}"
26
26
update_cache : yes
27
27
with_items :
28
- - docker-ce=17.03.3~ce-0~ubuntu-xenial
28
+ - docker-ce={{ docker_version }}
29
29
30
30
- name : add user to group docker
31
31
command : usermod -aG docker {{ ansible_user }}
Original file line number Diff line number Diff line change 1
1
- name : install dependencies
2
- apt : package={{ item }} state=installed update_cache=yes
2
+ apt :
3
+ package : " {{ item }}"
4
+ state : installed
5
+ update_cache : yes
3
6
with_items :
4
7
- apt-transport-https
5
8
- curl
16
19
state : present
17
20
18
21
- name : install kube utilities
19
- apt : package={{ item }} update_cache=yes
22
+ apt :
23
+ package : " {{ item }}"
24
+ update_cache : yes
20
25
with_items :
21
- - kubectl
26
+ - kubectl={{ kubernetes_version }}
Original file line number Diff line number Diff line change 2
2
command : swapoff -a
3
3
4
4
- name : install kube utilities
5
- apt : package={{ item }} update_cache=yes
5
+ apt :
6
+ package : " {{ item }}"
7
+ update_cache : yes
6
8
with_items :
7
- - kubelet
8
- - kubeadm
9
+ # - kubernetes-cni=0.6.0-00 # Temporary requirement if using kubernetes version 1.13.2
10
+ - kubelet={{ kubernetes_version }}
11
+ - kubeadm={{ kubernetes_version }}
9
12
10
13
- name : reset kubeadm
11
14
command : kubeadm reset --force
Original file line number Diff line number Diff line change 2
2
command : swapoff -a
3
3
4
4
- name : install kube utilities
5
- apt : package={{ item }} update_cache=yes
5
+ apt :
6
+ package : " {{ item }}"
7
+ update_cache : yes
6
8
with_items :
7
- - kubelet
8
- - kubeadm
9
+ # - kubernetes-cni=0.6.0-00 # Temporary requirement if using kubernetes version 1.13.2
10
+ - kubeadm={{ kubernetes_version }}
11
+ - kubelet={{ kubernetes_version }}
9
12
10
13
- name : reset before join
11
14
command : kubeadm reset --force
You can’t perform that action at this time.
0 commit comments