File tree Expand file tree Collapse file tree 2 files changed +69
-1
lines changed
environments/common/inventory Expand file tree Collapse file tree 2 files changed +69
-1
lines changed Original file line number Diff line number Diff line change 1
1
---
2
2
3
+ - hosts : k3s
4
+ become : yes
5
+ tasks :
6
+ - name : Download k3s install script
7
+ ansible.builtin.get_url :
8
+ url : https://get.k3s.io/
9
+ timeout : 120
10
+ dest : /usr/local/bin/k3s-install.sh
11
+ owner : root
12
+ group : root
13
+ mode : " 0755"
14
+
15
+ - hosts : k3s_server
16
+ become : yes
17
+ tasks :
18
+ - name : Install k3s server
19
+ ansible.builtin.shell :
20
+ cmd : /usr/local/bin/k3s-install.sh
21
+ environment :
22
+ INSTALL_K3S_VERSION : " v1.31.0+k3s1"
23
+ INSTALL_K3S_EXEC : " server"
24
+ INSTALL_K3S_SKIP_START : true
25
+ changed_when : true
26
+
27
+ - hosts : k3s_agent
28
+ become : yes
29
+ tasks :
30
+ - name : Install k3s agent
31
+ ansible.builtin.shell :
32
+ cmd : /usr/local/bin/k3s-install.sh
33
+ environment :
34
+ INSTALL_K3S_VERSION : " v1.31.0+k3s1"
35
+ INSTALL_K3S_EXEC : " agent"
36
+ INSTALL_K3S_SKIP_START : true
37
+ changed_when : true
38
+
39
+ - hosts : k3s
40
+ become : yes
41
+ tasks :
42
+ - name : Creating directory on root path
43
+ ansible.builtin.file :
44
+ path : /root/bin
45
+ state : directory
46
+ owner : root
47
+ - name : Adding symlinks to k3s binaries for root
48
+ ansible.builtin.file :
49
+ src : /usr/local/bin/k3s
50
+ dest : " /root/bin/{{ item }}"
51
+ state : link
52
+ owner : root
53
+ with_items :
54
+ - k3s
55
+ - kubectl
56
+
57
+
3
58
- hosts : cluster
4
59
gather_facts : false
5
60
become : yes
Original file line number Diff line number Diff line change @@ -134,4 +134,17 @@ freeipa_client
134
134
# Hosts to run TuneD configuration
135
135
136
136
[ansible_init]
137
- # Hosts to run linux-anisble-init
137
+ # Hosts to run linux-anisble-init
138
+
139
+ [k3s_server]
140
+ # Host to run k3s server
141
+ control
142
+
143
+ [k3s_agent]
144
+ # Hosts to run as k3s agents
145
+ login
146
+ compute
147
+
148
+ [k3s:children]
149
+ k3s_server
150
+ k3s_agent
You can’t perform that action at this time.
0 commit comments