File tree 1 file changed +8
-3
lines changed 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 7
7
Server IP of Primary server where rke2 is already installed and the worker will join.`
8
8
. Parameter Token
9
9
Token of Primary server.`
10
+ . Parameter PublicIP
11
+ Public IP of Agent server.`
10
12
. Parameter Version
11
13
Version of rke2 to download from github.`
12
14
. Parameter Commit
@@ -26,10 +28,10 @@ param (
26
28
$ServerIP ,
27
29
[Parameter ()]
28
30
[String ]
29
- $Version ,
31
+ $Token ,
30
32
[Parameter ()]
31
33
[String ]
32
- $Token ,
34
+ $Version ,
33
35
[Parameter ()]
34
36
[String ]
35
37
$Commit
@@ -60,13 +62,16 @@ function Set-Version() {
60
62
61
63
function Enable-Features () {
62
64
Enable-WindowsOptionalFeature - Online - FeatureName Containers - All
65
+ Restart-Computer - Wait - For PowerShell - Timeout 300 - Delay 2
63
66
}
64
67
65
68
function Setup-Config (){
66
69
Write-InfoLog " Creating rke2 directory..."
67
70
New-Item - Type Directory c:/ etc/ rancher/ rke2 - Force
71
+ Write-InfoLog " Fetch public IP..."
72
+ $publicIP = (Invoke-WebRequest - uri " https://api.ipify.org/" ).Content.Trim()
68
73
Write-InfoLog " Setting up rke2 config.yaml file..."
69
- Set-Content - Path c:/ etc/ rancher/ rke2/ config.yaml - Value " server: https://$ ( $ServerIP ) :9345`n token: $Token `n "
74
+ Set-Content - Path c:/ etc/ rancher/ rke2/ config.yaml - Value " server: https://$ ( $ServerIP ) :9345`n token: $Token `n node-external-ip: $publicIP ` n"
70
75
Get-Content - Path c:/ etc/ rancher/ rke2/ config.yaml
71
76
}
72
77
You can’t perform that action at this time.
0 commit comments