Issue #15777 has been updated by R.I. Pienaar.

This is a very long standing bug, this top scope statement gets auto imported 
first time any node reference this class - or any manual import statements.  
From that point onward its seen as top scope for the life of the puppet master 
process and gets applied to all nodes.

I definitely recall a ticket about disallowing any top scope resources in 
modules but cant find it now


----------------------------------------
Bug #15777: When a class init.pp manifest includes itself, the class may leak 
out in unexpected ways.
https://projects.puppetlabs.com/issues/15777#change-69462

Author: Ken Johnson
Status: Unreviewed
Priority: Normal
Assignee: 
Category: autoloader
Target version: 
Affected Puppet version: 2.7.12
Keywords: 
Branch: 


If we have the following init.pp for the class 'test'.
<pre>
class test {
  file { 'test.txt':
    path => '/tmp/test.txt',
    ensure => file, 
    owner => "root",
    group => "root",
    mode => 0644,
    source => 'puppet:///modules/test/test.txt',
  }
}

class {'test':}

--
</pre>

and you have a population of nodes where only *some* of them have the class 
'test' assigned to them, then the following unexpected behavior occurs.

If only agents who don't have this class included in their node definition run, 
then the class will not be applied.

However, if an agent runs against that puppet master process who *does* have 
that class assigned, then subsequent runs by agents who do not have it assigned 
will have the class applied anyway.

In short, this is a malformed manifest, but we should be more defensive here.


-- 
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