Skip to main content

Building Windows Server with Puppet and Chocolatey

·192 words·1 min
FTC Disclosure: As an Amazon Associate, I earn from qualifying purchases. Some links on this site are affiliate links.
Ben Piper
Author
Ben Piper
Wiley bestselling author — 100k+ copies, AWS Solutions Architect Associate (SAA) & Cloud Practitioner (CLF) bestsellers, 7+ books. 45 Pluralsight courses (4.7-star, 3,003 ratings). 10+ yrs 100% remote, solo CCNP ENCOR.

Forget using scripts and group policies to configure a new Windows Server machine. Using Chocolatey and Puppet, you can do it faster & easier than ever (and it’s more fun too). This is especially true if you’re using a Server Core installation and don’t have a GUI to help you along. Oh, and if you don’t know Puppet, you really should watch my course Puppet Fundamentals for System Administrators on Pluralsight 🙂

Assign IP address using PowerShell:
#

$ New-NetIPAddress InterfaceAlias "Ethernet" IPAddress "192.168.51.29" PrefixLength 24 -DefaultGateway 192.168.51.8

$ Set-DnsClientServerAddress -InterfaceAlias "Ethernet" -ServerAddresses 192.168.50.20, 192.168.50.21

Install Chocolatey:
#

$ set-executionpolicy unrestricted<br />
$ iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))

Restart PowerShell
#

Install VMware tools
#

$ choco install vmware-tools
The server will automatically restart.

Rename server
#

$ rename-computer -newname newservername

Reboot
#

restart-computer
Join to domain
add-computer -domain benpiper.com
Reboot again
restart-computer
Install Puppet
choco install puppet
Configure Puppet
Configure c:\programdata\puppetlabs\puppet\etc\puppet.conf
Generate puppet certificate
puppet_interactive
Sign puppet certificate on puppet master
puppet cert sign newservername
Apply appropriate profiles to server. Remember to restart the Puppet master if you change your Hiera configuration.

Run Puppet agent

puppet_interactive
Verify
puppet resource dism
puppet resource package