Last active
June 4, 2019 15:50
-
-
Save Jnchi/ddfdcb654bd23ff48ecf264a932ef685 to your computer and use it in GitHub Desktop.
Install Puppet Agent on Windows 10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Installs Puppet Agent on Windows 10 | |
# https://puppet.com/docs/puppet/6.4/install_agents.html#install-unattended-from-the-command-line | |
# SPDX-License-Identifier: GPL-3.0-or-later | |
$arch = "x64" | |
$puppet_version = "puppet6" | |
$version = "latest" | |
$installer = "puppet-agent-$($arch)-$($version).msi" | |
$server = "puppet.localdomain" | |
$port = "8140" | |
if (-Not (Test-Path .\$installer -PathType Leaf)) { | |
echo "Fetching installer..." | |
Invoke-WebRequest "https://downloads.puppetlabs.com/windows/$($puppet_version)/$($installer)" -OutFile $installer | |
} | |
echo "Installing Puppet Agent..." | |
$ret = (Start-Process -FilePath "msiexec.exe" -ArgumentList "/qn /norestart /i $installer PUPPET_MASTER_SERVER=$server" -Wait -Passthru).ExitCode | |
if ($ret -eq 0) { | |
echo "OK" | |
} else { | |
echo "Error: $ret" | |
} | |
echo "Configuring Puppet Agent..." | |
$ret = (Start-Process -FilePath "C:\Program Files\Puppet Labs\Puppet\bin\puppet.bat" -ArgumentList "config set masterport $port" -Wait -Passthru).ExitCode | |
if ($ret -eq 0) { | |
echo "OK" | |
} else { | |
echo "Error: $ret" | |
} |
Warning: SSL_connect returned=1 errno=0 state=error: certificate verify failed: [unable to get issuer certificate for /CN=Puppet CA: puppet.localdomain]
puppet agent --server puppet.localdomain --waitforcert 60 -t --verbose --debug
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The system cannot find the file specified.
Even though puppet agent was installed, the following directory was not in the PATH: