Skip to content

Adding windows node capability #307

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tasks/agent_install.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"default": []
}
},
"input_method": "environment",
"implementations": [
{"name": "agent_install.sh"}
{"name": "agent_install.sh", "requirements": ["shell"]},
{"name": "agent_install.ps1", "requirements": ["powershell"]}
]
}
17 changes: 17 additions & 0 deletions tasks/agent_install.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# agent_install.ps1
Param(
$install_flags,
$server
)
if (Test-Path "C:\Program Files\Puppet Labs\Puppet\puppet\bin\puppet"){
Write-Host "ERROR: Puppet agent is already installed. Re-install, re-configuration, or upgrade not supported. Please uninstall the agent before running this task."
Exit 1
}
$flags=$install_flags -replace '^\["*','' -replace 's/"*\]$','' -replace '/", *"',' '
try {
[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"
}
catch {
Write-Host "Installer failed with Exception: $_.Exception.Message"
Exit 1
}
4 changes: 2 additions & 2 deletions tasks/submit_csr.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"description": "DNS Alternative Names to request for the certificate"
}
},
"input_method": "stdin",
"implementations": [
{"name": "submit_csr.rb"}
{"name": "submit_csr.rb", "requirements": ["shell"]},
{"name": "submit_csr.ps1", "requirements": ["powershell"]}
]
}
12 changes: 12 additions & 0 deletions tasks/submit_csr.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Param(
$dns_alt_names
)
if ( C:\"Program Files"\"Puppet Labs"\Puppet\bin\puppet ssl verify ) {
Write-Host "ERROR: Puppet agent certificate is already signed"
Exit 1
}else{
if ($dns_alt_names) {
$submit_flags = "--dns_alt_names" + ($dns_alt_names -join ',')
}
C:\"Program Files"\"Puppet Labs"\Puppet\bin\puppet ssl submit_request $submit_flags
}