Configuring Puppet Agent Polling Interval: Best Practices for Custom Update Frequency


2 views

Puppet agents are configured by default to check in with the Puppet master every 30 minutes (1800 seconds). This interval is defined in the agent's configuration file and affects how frequently nodes request updated catalogs.

The primary method to adjust this setting is through the puppet.conf file. Here's how to implement different interval configurations:


# For system-wide configuration (Linux/Unix)
# /etc/puppetlabs/puppet/puppet.conf

[agent]
runinterval = 3600  # Sets check-in to 1 hour (value in seconds)

For Windows systems, the configuration path is slightly different:


# Windows configuration
# C:\ProgramData\PuppetLabs\puppet\etc\puppet.conf

[agent]
runinterval = 7200  # 2 hour interval

For more dynamic control, you can use Puppet's own manifest to manage the interval:


class profile::puppet::agent {
  ini_setting { 'puppet agent runinterval':
    ensure  => present,
    path    => '/etc/puppetlabs/puppet/puppet.conf',
    section => 'agent',
    setting => 'runinterval',
    value   => '1800',  # 30 minutes
    notify  => Service['puppet'],
  }
}

When adjusting polling intervals, consider these factors:

  • Use splay and splaylimit parameters to distribute load
  • For critical environments, consider using noop mode with more frequent runs
  • Remember that certificate renewal occurs during these runs

[agent]
runinterval = 3600
splay = true
splaylimit = 1800  # Random delay up to 30 minutes

After making changes, verify the active configuration with:


puppet agent --configprint runinterval

For immediate effect, restart the Puppet service:


# On systemd systems
systemctl restart puppet

# On Windows
Restart-Service Puppet

The Puppet agent service (puppet agent) typically runs as a daemon that periodically checks in with the Puppet master server. By default, this polling occurs every 30 minutes (1800 seconds) as specified in the agent's configuration. This interval is defined in the runinterval setting within Puppet's configuration files.

There are several methods to change the polling frequency, each suitable for different deployment scenarios:

Method 1: Direct Configuration in puppet.conf

The most straightforward approach is to edit the agent's puppet.conf file:

[agent]
runinterval = 3600  # Sets polling to 1 hour (value in seconds)

Method 2: Using Puppet to Manage Itself

For managed environments, you can declare this setting in your Puppet manifests:

# In site.pp or appropriate manifest
ini_setting { 'puppet agent runinterval':
  ensure  => present,
  path    => '/etc/puppetlabs/puppet/puppet.conf',
  section => 'agent',
  setting => 'runinterval',
  value   => '900',  # 15 minutes
}

Method 3: Command Line Temporary Override

For testing purposes, you can temporarily override the interval:

puppet agent --test --runinterval=1200

When adjusting the polling interval, keep these factors in mind:

  • Shorter intervals increase server load
  • Longer intervals delay configuration updates
  • The splay and splaylimit settings affect randomization of run times

After modification, verify the active setting with:

puppet agent --configprint runinterval

For large deployments, consider these additional settings:

[agent]
runinterval = 3600
splay = true
splaylimit = 1800  # Random delay up to 30 minutes