ncantor
2010-Oct-05 07:16 UTC
[Puppet Users] Puppetd attempting to install packages that aren''t required
For some reason, puppet is attempting to install ruby-enterprise on all my puppet clients. The only reason I can find for this behaviour is that I''ve defined a package to install ruby-enterprise. However, by default, the package isn''t called by anything. In order to get the package to only install on the systems that I wanted to have it, I had to move it from a general package definition to be inside a class. Is this normal behaviour? -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Peter Meier
2010-Oct-05 07:45 UTC
Re: [Puppet Users] Puppetd attempting to install packages that aren''t required
> For some reason, puppet is attempting to install ruby-enterprise on > all my puppet clients. The only reason I can find for this behaviour > is that I''ve defined a package to install ruby-enterprise. However, by > default, the package isn''t called by anything. > In order to get the package to only install on the systems that I > wanted to have it, I had to move it from a general package definition > to be inside a class. Is this normal behaviour?Yes. I would recommend you to have a look at modules and how you can organize your manifests with classes and modules to group code together and include it to the appropriate nodes. ~pete -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Bruce Richardson
2010-Oct-05 19:32 UTC
Re: [Puppet Users] Puppetd attempting to install packages that aren''t required
On Tue, Oct 05, 2010 at 12:16:28AM -0700, ncantor wrote:> In order to get the package to only install on the systems that I > wanted to have it, I had to move it from a general package definition > to be inside a class. Is this normal behaviour?Yes. If you do want packages to be visible at the top level, to absolutely everything, but only installed when you want them, then you should make them virtual resources and then realize them where you need them. What is your motive for defining packages at the top level? As with most resources, it''s usually better to define them within the classes/modules which need them and just include the class. This allows you to concentrate on high level function (e.g. "This node should get its user and group data from an ldap server at $uri") in your main config and keep the low level details ("On Debian, the nss_ldap config file is ''/etc/libnss-ldap.conf''") hidden within the module. -- Bruce I object to intellect without discipline. I object to power without constructive purpose. -- Spock -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Jeff McCune
2010-Oct-06 03:07 UTC
Re: [Puppet Users] Puppetd attempting to install packages that aren''t required
On Tue, Oct 5, 2010 at 12:16 AM, ncantor <ncantor@gmail.com> wrote:> For some reason, puppet is attempting to install ruby-enterprise on > all my puppet clients.You told puppet to do so. =) I don''t mean to be a jerk, but this really is the simple answer.> The only reason I can find for this behaviour > is that I''ve defined a package to install ruby-enterprise. However, by > default, the package isn''t called by anything.Unless you put the declaration inside of a defined resource type, or a class, then it will be included in the configuration catalog of all nodes. In this case, the package has been declared at top scope.> In order to get the package to only install on the systems that I > wanted to have it, I had to move it from a general package definition > to be inside a class. Is this normal behaviour?Yep, a class is a collection and intended to bundle together a set of resources into something you can easily add or remove from nodes. This is generally called node classification as in "I''ve classified this node as a web server." or "This node is classified as a ruby-enterprise node." Nodes may have many classes. Hope this helps, -- Jeff McCune http://www.puppetlabs.com/ -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Jeff McCune
2010-Oct-06 03:14 UTC
Re: [Puppet Users] Puppetd attempting to install packages that aren''t required
On Tue, Oct 5, 2010 at 12:16 AM, ncantor <ncantor@gmail.com> wrote:> However, by default, the package isn''t called by anything.There''s also a subtle shift in thinking that may help you work with puppet. In the puppet language, resources are "declared" rather than "called" It''s a bit strange because many resources actually look like function calls, especially when you start defining your own resources, but they really do not behave much like functions, procedures or methods in other languages. If you shift your thinking to "I am declaring the configuration of this package resource" rather than "I am calling this package resource" the language might make more sense. In puppet, the idea is not to write procedures and actions but rather to declare the desired state. In most cases declaring the desired state is enough for puppet to "figure out" the actions to carry out to get the system into that state. This is why puppet was able to, and did, take action on your systems without you actually telling it to install the package. Instead, you told it you wanted the package installed. See the subtle difference? Hope this helps, -- Jeff McCune http://www.puppetlabs.com/ -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
ncantor
2010-Oct-07 20:29 UTC
[Puppet Users] Re: Puppetd attempting to install packages that aren''t required
Thanks guys. Your feedback is much appreciated. Looks like I''ll need to build a ruby-enterprise class, put the package inside it, and call it from other classes when there''s a dependency. On Oct 6, 4:14 am, Jeff McCune <j...@puppetlabs.com> wrote:> On Tue, Oct 5, 2010 at 12:16 AM, ncantor <ncan...@gmail.com> wrote: > > However, by default, the package isn''t called by anything. > > There''s also a subtle shift in thinking that may help you work with > puppet. In the puppet language, resources are "declared" rather than > "called" It''s a bit strange because many resources actually look like > function calls, especially when you start defining your own resources, > but they really do not behave much like functions, procedures or > methods in other languages. > > If you shift your thinking to "I am declaring the configuration of > this package resource" rather than "I am calling this package > resource" the language might make more sense. In puppet, the idea is > not to write procedures and actions but rather to declare the desired > state. In most cases declaring the desired state is enough for puppet > to "figure out" the actions to carry out to get the system into that > state. > > This is why puppet was able to, and did, take action on your systems > without you actually telling it to install the package. Instead, you > told it you wanted the package installed. See the subtle difference? > > Hope this helps, > -- > Jeff McCunehttp://www.puppetlabs.com/-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.