Do something to the client

  1. apprentice@puppet:~$ sudo mkdir modules/puppet_agent
      apprentice@puppet:~$ sudo mkdir modules/puppet_agent/{files,templates,manifests}

    Edit /etc/puppet/modules/puppet_agent/manifests/init.pp:

    class puppet_agent {
    file { "/etc/puppet/puppet.conf":
    owner  => root, group  => root, mode => 0644,
    #content => template("${module_name}/puppet.conf.erb"),                                                                                                            
    source  => "puppet:///modules/${module_name}/puppet.conf"


    Yes, that path is: puppet:///modules/${module_name}/puppet.conf. The triple slash expands to the server name. And don't be tempted to put ${module_name}/files/puppet.conf in there. The file/ is in the path to the file in the filesystem of the server, but it is not in the path when being accessed through the Puppet protocol.

    So far for configuration logic.

    ... and /srv/puppet/envs/production/modules/puppet_agent/files/puppet.conf:

    # WARNING: This file maintained by Puppet.
    # Editing is no use unless you avoid running the Puppet agent
    report = false
    splay = true

  2. Edit /srv/puppet/envs/production/manifests/nodes/nodes.pp:

    class base {
    include puppet_agent
    node '' {
    include puppet_agent

    ... and /srv/puppet/envs/production/manifests/site.pp:

    $puppetserver = ''
    import 'nodes/*'

  3. apprentice@client:~$ sudo puppet agent --no-daemonize --verbose --waitforcert 10

    (And see that /etc/puppet/puppet.conf has changed.)