Windows
Step 1.
- Press
Win + R, typenotepad C:\Windows\System32\drivers\etc\hostsand press Enter (better to run Notepad as Administrator). - At the very bottom, add this line:
192.168.0.14 puppet(Now, if Windows asks “Where is puppet?”, it will go via the internal network to 192.168.0.14). 3. Save the file. 4. Check connectivity. Open PowerShell (on Windows Server) and type:
ping puppetA reply from 192.168.0.14 should come. If ping works — we’re ready to install the Agent.
Step 2. Turning Windows into a Managed Computer (Agent) 🖥️
Since you have a powerful Windows Server, let’s make it the first “client” of Puppet! You’ll be able to manage its settings right from the Linux server. For this, Windows needs to know where to find the “puppet” server. On Windows:
- Press
Win + R, typenotepad C:\Windows\System32\drivers\etc\hostsand press Enter (better to run Notepad as Administrator). - At the very bottom, add this line:
192.168.0.14 puppet(Now, if Windows asks “Where is puppet?”, it will go via the internal network to 192.168.0.14). 3. Save the file. 4. Check connectivity. Open PowerShell (on Windows Server) and type:
ping puppetA reply from 192.168.0.14 should come. If ping works — we’re ready to install the Agent.
Step 3. Installing the Agent on Windows 📦
Now the fun part. Installing the agent program on Windows Server.
- Download the official installer (MSI) for Windows x64: Puppet Agent Download (Download it directly on Windows Server).
- Start the installation.
- In the wizard, proceed to the Puppet Server field.
- Type just the word:
puppet. (Leave everything else as is). - Click Install.
Step 4. “The Wedding” (Signing the Certificate) 💍
The agent on Windows will knock on the Linux server’s door. The server will see it but won’t let it in until you (the Administrator) allow it.
- On Linux (Puppet Server): Check if the request came in:
sudo /opt/puppetlabs/bin/puppetserver ca list`You should see something like: "win-server-2022.local" (SHA256: ...) — that’s your Windows requesting to be managed.
2. Allow access (sign the certificate):
sudo /opt/puppetlabs/bin/puppetserver ca sign --all(Will output: Successfully signed certificate...).
sudo ln -s /opt/puppetlabs/bin/puppetserver /usr/local/bin/puppetserversudo rm -rf /etc/puppetlabs/puppet/sslFinal: Connectivity Check 🚀
Back to Windows Server, open PowerShell as Administrator and enter the manual sync command:
puppet agent -tChanging the Agent Interval
Method 1. Quick (Via Command Line) ⚡
This is the safest method, as Puppet itself writes the setting to the correct file and won’t make syntax errors.
- On Windows Server open PowerShell (Admin).
- To set the interval to, e.g., 10 minutes, type:
puppet config set runinterval 10m --section agent
(You can use s — seconds, m — minutes, h — hours).
3. Important: For the change to take effect, restart the service (otherwise it’ll finish the current 30 minutes by the old schedule):
Restart-Service puppet
Done! Now it will check in every 10 minutes.
Method 2. “Surgical” (Via Config File) 📝
If you want to see where this setting lives physically:
- Open Notepad as Administrator.
- Open file:
C:\ProgramData\PuppetLabs\puppet\etc\puppet.conf(The ProgramData folder is usually hidden — just paste the path into the open dialog). - Find the
[agent]section. - Add or change this line:
[agent]
server = puppet
runinterval = 10m
- Save and restart the service (
Restart-Service puppet).
⚠️ Pro Tip
Don’t set an interval below 5-10 minutes in real production. Right now you have 1 server and Puppet can handle even 1 minute. But when there are 100 servers all hammering the master every minute — it will simply collapse under the load (self-inflicted DDoS).
Recommended:
- For tests/development: 5m or 10m.
- For production (live servers): 30m or 1h.
Method 3.
We need the puppetlabs-inifile module. It can surgically change one line in text files.
Type on the server:
sudo /opt/puppetlabs/bin/puppet module install puppetlabs-inifileNow we’ll tell Puppet:
- Find your config file.
- Find the
runintervalparameter there. - Set it to
5m(5 minutes). - Important: If you changed something, restart yourself so changes take effect.
Open
site.pp:
sudo nano /etc/puppetlabs/code/environments/production/manifests/site.ppAdd this code inside the node 'srv-dc01.vbo.local' block:
# --- Block 5: Configuring the Agent itself (Puppet configures Puppet) ---
# 1. Declare the Puppet service so we can reload it
service { 'puppet':
ensure => running,
enable => true,
}
# 2. Change run frequency in the config file
ini_setting { 'change_interval':
ensure => present,
path => 'C:/ProgramData/PuppetLabs/puppet/etc/puppet.conf',
section => 'agent',
setting => 'runinterval',
value => '5m', # Set to 5 minutes
notify => Service['puppet'], # MAGIC: If file changed -> restart service!
}Note the notify line. This is an event mechanism. The service restarts ONLY if the file changes. If the file is already correct — no unnecessary restart.
Back to Windows and run the agent (one last time manually to apply this setting):
puppet agent -t