Issue #8750 has been updated by Yuri Arabadji.

As is 3.0.1. How do you develop your manifests if you can't even have the 
master pick up the new changes? 

touch'ing site.pp makes it re-scan the files, but maybe you could use inotify 
feature to watch for newly added files? Or maybe even scan for new files when 
it can't find newly added classes?

<pre>
Dec  8 09:28:44 dev2 puppet-master[22577]: Could not find class global::sysdirs 
for xxx on node xxx

-rw-r--r--. 1 root root 186 Dec  8 09:20 modules/global/manifests/sysdirs.pp
</pre>

----------------------------------------
Bug #8750: puppetmaster needs restart to pick up on changes in types/providers 
in modules
https://projects.puppetlabs.com/issues/8750#change-78511

Author: Stijn Hoop
Status: Accepted
Priority: High
Assignee: Nigel Kersten
Category: modules
Target version: 
Affected Puppet version: 2.6.9
Keywords: 
Branch: 2.6.x


Unexpectedly to me, it seems that my puppet master is NOT reloading changed 
code in modules, resulting in a failed run on the agents even though they do 
receive the new code.

Given the following configuration on the master:

    [unixhelp@pclinvir027] </etc/puppet> sudo puppet master --configprint 
modulepath
    /etc/puppet/modules:/usr/share/puppet/modules

    [unixhelp@pclinvir027] </etc/puppet> sudo puppet master --configprint 
manifest
    /etc/puppet/manifests/site.pp

    [unixhelp@pclinvir027] </etc/puppet> cat puppet.conf
    [main]
    logdir = /var/log/puppet
    rundir = /var/run/puppet
    ssldir = $vardir/ssl
    # Enable syncing of plugin code
    pluginsync = true
    [agent]
    classfile = $vardir/classes.txt
    localconfig = $vardir/localconfig
    [master]
    certname = pclinvir027.win.tue.nl

    [unixhelp@pclinvir027] </etc/puppet> tree manifests modules
    manifests
    `-- site.pp
    modules
    `-- foo
    |-- lib
    |   `-- puppet
    |       |-- provider
    |       |   `-- footype
    |       |       `-- footype.rb
    |       `-- type
    |           `-- footype.rb
    `-- manifests
    `-- init.pp

    [unixhelp@pclinvir027] </etc/puppet> cat 
modules/foo/lib/puppet/type/footype.rb
    Puppet::Type.newtype(:footype) do
      @doc = "Testing puppetmaster type reload"
      newparam(:name) do
        desc "Name of the type"
        isnamevar
      end
      newparam(:testing) do
        desc "The first parameter"
      end
    end

    [unixhelp@pclinvir027] </etc/puppet> cat 
modules/foo/lib/puppet/provider/footype
    Puppet::Type.type(:footype).provide(:footype) do
      desc "Testing puppet master reload"
    end
    [unixhelp@pclinvir027] </etc/puppet> cat modules/foo/manifests/init.pp
    class foo {
      footype { "test":
        testing => 1,
      }
    }

And this puppet.conf on the client:

    [unixhelp@pclinvir028 ~]$ cat /etc/puppet/puppet.conf
    [main]
    logdir = /var/log/puppet
    rundir = /var/run/puppet
    ssldir = $vardir/ssl
    # Enable syncing of plugin code
    pluginsync = true
    [agent]
    classfile = $vardir/classes.txt
    localconfig = $vardir/localconfig

The following sequence of events reproduces the problem:

Start the master: $ sudo puppet master --debug --no-daemonize --verbose

Start the agent for the first time: $ sudo puppet agent --debug --no-daemonize 
--verbose --onetime --server pclinvir027.win.tue.nl
Output is in agent-20110803-firstparameter.log. It works fine, code gets 
synced, etc.

Now edit the code in 
/etc/puppet/modules/foo/lib/puppet/{type/footype.rb,manifests/init.pp} to 
include a new parameter:

    [unixhelp@pclinvir027] </etc/puppet> cat 
modules/foo/lib/puppet/type/footype.rb
    Puppet::Type.newtype(:footype) do
      @doc = "Testing puppetmaster type reload"
      newparam(:name) do
        desc "Name of the type"
        isnamevar
      end
      newparam(:testing) do
        desc "The first parameter"
      end
      newparam(:testingagain) do
        desc "The second parameter"
      end
    end
    [unixhelp@pclinvir027] </etc/puppet> cat modules/foo/manifests/init.pp
    class foo {
      footype { "test":
        testing => 1,
        testingagain => 2,
      }
    }
    
Start the agent again: $ sudo puppet agent --debug --no-daemonize --verbose 
--onetime --server pclinvir027.win.tue.nl
Output is in agent-20110803-firstparameter.log. We get an error because the 
server cannot validate the catalog.


On the server console we see:

    debug: Automatically imported foo from foo into production
    err: Invalid parameter testingagain at 
/etc/puppet/modules/foo/manifests/init.pp:5 on node pclinvir028.win.tue.nl

The output from the master so far is in master-20110803-firstrun.log.

WITHOUT CHANGING ANYTHING, restart the puppet master.

Run the agent for the 3rd time, and see that it now works: 
agent-20110803-secondparameter-try2.log.

So it seems to me that types/providers in modules are not being reloaded.

This is puppet 2.6.9 on CentOS 5, installed from Todd Zulinger's RPM repository.


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to