Skip to content

Commit 4440bff

Browse files
Merge pull request #307 from puppetlabs/SOLARCH-985
Adding windows node capability
2 parents 06106cd + 67bfcfa commit 4440bff

File tree

4 files changed

+33
-4
lines changed

4 files changed

+33
-4
lines changed

Diff for: tasks/agent_install.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
"default": []
1212
}
1313
},
14-
"input_method": "environment",
1514
"implementations": [
16-
{"name": "agent_install.sh"}
15+
{"name": "agent_install.sh", "requirements": ["shell"]},
16+
{"name": "agent_install.ps1", "requirements": ["powershell"]}
1717
]
1818
}

Diff for: tasks/agent_install.ps1

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# agent_install.ps1
2+
Param(
3+
$install_flags,
4+
$server
5+
)
6+
if (Test-Path "C:\Program Files\Puppet Labs\Puppet\puppet\bin\puppet"){
7+
Write-Host "ERROR: Puppet agent is already installed. Re-install, re-configuration, or upgrade not supported. Please uninstall the agent before running this task."
8+
Exit 1
9+
}
10+
$flags=$install_flags -replace '^\["*','' -replace 's/"*\]$','' -replace '/", *"',' '
11+
try {
12+
[Net.ServicePointManager]::ServerCertificateValidationCallback = {$true}; $webClient = New-Object System.Net.WebClient; $webClient.DownloadFile("https://${server}:8140/packages/current/install.ps1", 'install.ps1'); powershell.exe -c "install.ps1 $flags"
13+
}
14+
catch {
15+
Write-Host "Installer failed with Exception: $_.Exception.Message"
16+
Exit 1
17+
}

Diff for: tasks/submit_csr.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
"description": "DNS Alternative Names to request for the certificate"
77
}
88
},
9-
"input_method": "stdin",
109
"implementations": [
11-
{"name": "submit_csr.rb"}
10+
{"name": "submit_csr.rb", "requirements": ["shell"]},
11+
{"name": "submit_csr.ps1", "requirements": ["powershell"]}
1212
]
1313
}

Diff for: tasks/submit_csr.ps1

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Param(
2+
$dns_alt_names
3+
)
4+
if ( C:\"Program Files"\"Puppet Labs"\Puppet\bin\puppet ssl verify ) {
5+
Write-Host "ERROR: Puppet agent certificate is already signed"
6+
Exit 1
7+
}else{
8+
if ($dns_alt_names) {
9+
$submit_flags = "--dns_alt_names" + ($dns_alt_names -join ',')
10+
}
11+
C:\"Program Files"\"Puppet Labs"\Puppet\bin\puppet ssl submit_request $submit_flags
12+
}

0 commit comments

Comments
 (0)