File tree Expand file tree Collapse file tree 5 files changed +64
-11
lines changed Expand file tree Collapse file tree 5 files changed +64
-11
lines changed Original file line number Diff line number Diff line change 8
8
- set_fact :
9
9
kubernetes_init : " {% if kubernetes_init_host is defined and kubernetes_init_host == inventory_hostname %}yes{% else %}no{% endif %}"
10
10
11
+ - set_fact :
12
+ kubernetes_api_port : " {% if setup_vip %}{{ kubernetes_api_ha_port }}{% else %}{{ kubernetes_api_default_port }}{% endif %}"
13
+
14
+ - set_fact :
15
+ kubernetes_ip_address : " {{ item }}"
16
+ when : " item | ipaddr( kubernetes_subnet )"
17
+ with_items : " {{ ansible_all_ipv4_addresses | difference([kubernetes_vip_ip]) }}"
18
+
11
19
- block :
12
- - set_fact :
13
- kubernetes_api_port : " {% if setup_vip %}{{ kubernetes_api_ha_port }}{% else %}{{ kubernetes_api_default_port }}{% endif %}"
14
-
15
- - set_fact :
16
- kubernetes_ip_address : " {{ item }}"
17
- when : " item | ipaddr( kubernetes_subnet )"
18
- with_items : " {{ ansible_all_ipv4_addresses | difference([kubernetes_vip_ip]) }}"
19
20
20
21
- set_fact :
21
22
kubernetes_iface : " {{ hostvars[inventory_hostname]['ansible_' + item ]['device'] }}"
Original file line number Diff line number Diff line change 34
34
notify :
35
35
- reload containerd
36
36
37
- - name : reload containerd
37
+ - name : start and enable containerd
38
38
ansible.builtin.systemd :
39
39
name : containerd
40
40
state : started
41
41
enabled : yes
42
42
43
43
when : kubernetes_cri == 'containerd'
44
44
45
+ # Fedora hack
46
+ - name : Check if /opt/cni/bin directory exist
47
+ ansible.builtin.stat :
48
+ path : /opt/cni/bin
49
+ register : cni_bin_dir
50
+
51
+ - block :
52
+ - name : Install containernetworking-plugins
53
+ ansible.builtin.package :
54
+ name : containernetworking-plugins
55
+ state : present
56
+
57
+ - name : stop containerd
58
+ ansible.builtin.systemd :
59
+ name : containerd
60
+ state : stopped
61
+
62
+ - name : Create /opt/cni/ directory
63
+ ansible.builtin.file :
64
+ name : /opt/cni/
65
+ state : directory
66
+
67
+ - name : Remove /opt/cni/bin directory if exist
68
+ ansible.builtin.file :
69
+ name : /opt/cni/bin
70
+ state : removed
71
+
72
+ - name : Create symlink from /usr/libexec/cni to /opt/cni/bin
73
+ ansible.builtin.file :
74
+ src : /usr/libexec/cni
75
+ dest : /opt/cni/bin
76
+ state : link
77
+
78
+ - name : start containerd
79
+ ansible.builtin.systemd :
80
+ name : containerd
81
+ state : started
82
+ when :
83
+ - ansible_distribution == 'Fedora'
84
+ - kubernetes_cri == 'containerd'
85
+ - cni_bin_dir.stat.islnk is defined
86
+ - not cni_bin_dir.stat.islnk
87
+ # END Fedora hack
88
+
45
89
- name : Force all notified handlers to run now
46
90
meta : flush_handlers
Original file line number Diff line number Diff line change 6
6
register : kubelet_dir
7
7
8
8
- set_fact :
9
- api_server_endpoint : " {% if groups['kubemaster'] | length > 1 %}{{ kubernetes_vip_ip }}{% else %}{{ hostvars[groups['kubemaster'][0]]['ansible_default_ipv4']['address '] }}{% endif %}"
9
+ api_server_endpoint : " {% if groups['kubemaster'] | length > 1 %}{{ kubernetes_vip_ip }}{% else %}{{ hostvars[groups['kubemaster'][0]]['kubernetes_ip_address '] }}{% endif %}"
10
10
kubernetes_api_port : " {% if setup_vip %}{{ kubernetes_api_ha_port }}{% else %}{{ kubernetes_api_default_port }}{% endif %}"
11
11
12
12
- name : " wait for kubeapi server"
Original file line number Diff line number Diff line change 24
24
- " setup_repo_{{ ansible_os_family }}.yml"
25
25
tags : repo
26
26
27
+ - setup :
28
+
27
29
- include_tasks :
28
30
file : preflight.yml
29
31
apply :
Original file line number Diff line number Diff line change 10
10
when : ansible_os_family == 'Debian'
11
11
12
12
- block :
13
- - name : Install required system packages
13
+ - name : Install iptables-legacy
14
14
ansible.builtin.dnf :
15
15
name :
16
16
- iptables-legacy
17
17
state : present
18
18
19
- - name : Install required system packages
19
+ - name : Remove zram-generator-defaults
20
20
ansible.builtin.dnf :
21
21
name :
22
22
- zram-generator-defaults
39
39
state : disabled
40
40
when : ansible_os_family == 'RedHat'
41
41
42
+ - name : Install openssl
43
+ ansible.builtin.package :
44
+ name :
45
+ - openssl
46
+ state : present
47
+
42
48
- name : load overlay kernel module
43
49
ansible.builtin.command : modprobe overlay
44
50
You can’t perform that action at this time.
0 commit comments