If I have a package { "foo": ensure => installed; require =>
something
} in a module, AND I also have a Package { require =>
Class[''yum::client'']} in site.pp, what happens in the module?
Does the
package in the module require both ''something'' and the
yum::client
class, or does the fact I specified a package{} with a require in the
module mean that only the yum::client class is required?
Doug.
--
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.
On 1 July 2010 00:32, Douglas Garstang <doug.garstang@gmail.com> wrote:> If I have a package { "foo": ensure => installed; require => something > } in a module, AND I also have a Package { require => > Class[''yum::client'']} in site.pp, what happens in the module? Does the > package in the module require both ''something'' and the yum::client > class, or does the fact I specified a package{} with a require in the > module mean that only the yum::client class is required? >The latter will happen. The default will be replaced by the explicit statement in package{"foo"}. You might want to look into plusignment (+>) to do this, but there are some caveats to it''s usage. Such as feature #2825. -- 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.
On Thu, Jul 1, 2010 at 11:22 AM, Dan Carley <dan.carley@gmail.com> wrote:> On 1 July 2010 00:32, Douglas Garstang <doug.garstang@gmail.com> wrote: >> >> If I have a package { "foo": ensure => installed; require => something >> } in a module, AND I also have a Package { require => >> Class[''yum::client'']} in site.pp, what happens in the module? Does the >> package in the module require both ''something'' and the yum::client >> class, or does the fact I specified a package{} with a require in the >> module mean that only the yum::client class is required? > > The latter will happen. The default will be replaced by the explicit > statement in package{"foo"}. You might want to look into plusignment (+>) to > do this, but there are some caveats to it''s usage. Such as feature #2825.Yeah. You sort of have to be careful. I had a Package {} resource defined in site.pp, and then in various modules where needed, I had more Package defaults. I''ve only just realised (I must have gotten lucky) that the one in site.pp was being skipped because of the local modules ones. Doug -- 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.
Hey, this is sort of hijacking the thread, so if need be, please, I can
start another thread for it, but could someone explain the code from the
OP here. I feel like this is sort of the next step in puppet
functionality that I need to learn (I''m still new).
I''ll start by pointing out three things that tripped me up:
1. I''ve read about the difference between Package (capitalized), and
package (lowercase), but in practice I don''t understand it.
2. In the Package { require => Class[''yum::client'']}, why
isn''t there a
name?
3. ''yum::client'' is a reference to a nested class, right? So
what are
the use cases for nested classes? I''m wondering if maybe I should/could
be taking advantage of this to clean up my code a bit.
Thanks,
Chris
On 07/01/2010 08:56 PM, Douglas Garstang wrote:> On Thu, Jul 1, 2010 at 11:22 AM, Dan Carley<dan.carley@gmail.com>
wrote:
>
>> On 1 July 2010 00:32, Douglas Garstang<doug.garstang@gmail.com>
wrote:
>>
>>> If I have a package { "foo": ensure => installed;
require => something
>>> } in a module, AND I also have a Package { require =>
>>> Class[''yum::client'']} in site.pp, what happens in
the module? Does the
>>> package in the module require both ''something''
and the yum::client
>>> class, or does the fact I specified a package{} with a require in
the
>>> module mean that only the yum::client class is required?
>>>
>> The latter will happen. The default will be replaced by the explicit
>> statement in package{"foo"}. You might want to look into
plusignment (+>) to
>> do this, but there are some caveats to it''s usage. Such as
feature #2825.
>>
> Yeah. You sort of have to be careful. I had a Package {} resource
> defined in site.pp, and then in various modules where needed, I had
> more Package defaults. I''ve only just realised (I must have gotten
> lucky) that the one in site.pp was being skipped because of the local
> modules ones.
>
> Doug
>
>
--
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.
On Jul 1, 2010, at 9:05 PM, christopher floess wrote:> Hey, this is sort of hijacking the thread, so if need be, please, I can start another thread for it, but could someone explain the code from the OP here. I feel like this is sort of the next step in puppet functionality that I need to learn (I''m still new). > > I''ll start by pointing out three things that tripped me up: > > 1. I''ve read about the difference between Package (capitalized), and package (lowercase), but in practice I don''t understand it.When declaring a resource, use the lowercase one. When referring to an existing resource, use the uppercase one.> 2. In the Package { require => Class[''yum::client'']}, why isn''t there a name?This says take care of the whole yum::client class before installing any package. (Technically this is only almost true. There are exceptions.)> 3. ''yum::client'' is a reference to a nested class, right? So what are the use cases for nested classes? I''m wondering if maybe I should/could be taking advantage of this to clean up my code a bit.Mostly it''s just to reduce the amount of classes you have. The same answer applies to the question, "Why do people want sub-folders? Why not just put all folders in the filesystem''s root?"> > On 07/01/2010 08:56 PM, Douglas Garstang wrote: >> On Thu, Jul 1, 2010 at 11:22 AM, Dan Carley<dan.carley@gmail.com> wrote: >> >>> On 1 July 2010 00:32, Douglas Garstang<doug.garstang@gmail.com> wrote: >>> >>>> If I have a package { "foo": ensure => installed; require => something >>>> } in a module, AND I also have a Package { require => >>>> Class[''yum::client'']} in site.pp, what happens in the module? Does the >>>> package in the module require both ''something'' and the yum::client >>>> class, or does the fact I specified a package{} with a require in the >>>> module mean that only the yum::client class is required? >>>> >>> The latter will happen. The default will be replaced by the explicit >>> statement in package{"foo"}. You might want to look into plusignment (+>) to >>> do this, but there are some caveats to it''s usage. Such as feature #2825. >>> >> Yeah. You sort of have to be careful. I had a Package {} resource >> defined in site.pp, and then in various modules where needed, I had >> more Package defaults. I''ve only just realised (I must have gotten >> lucky) that the one in site.pp was being skipped because of the local >> modules ones. >> >> Doug >> >> > > -- > 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. >-- 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.
On Thu, Jul 1, 2010 at 9:11 PM, Patrick Mohr <kc7zzv@gmail.com> wrote:> > On Jul 1, 2010, at 9:05 PM, christopher floess wrote: > > Hey, this is sort of hijacking the thread, so if need be, please, I can > start another thread for it, but could someone explain the code from the OP > here. I feel like this is sort of the next step in puppet functionality that > I need to learn (I''m still new). > > I''ll start by pointing out three things that tripped me up: > > 1. I''ve read about the difference between Package (capitalized), and package > (lowercase), but in practice I don''t understand it. > > When declaring a resource, use the lowercase one. When referring to an > existing resource, use the uppercase one. > > 2. In the Package { require => Class[''yum::client'']}, why isn''t there a > name? > > This says take care of the whole yum::client class before installing > any package. (Technically this is only almost true. There are exceptions.)Eeeek! What are the exceptions? -- 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.
On Jul 1, 2010, at 10:45 PM, Douglas Garstang wrote:> On Thu, Jul 1, 2010 at 9:11 PM, Patrick Mohr <kc7zzv@gmail.com> wrote: >> >> On Jul 1, 2010, at 9:05 PM, christopher floess wrote: >> >> Hey, this is sort of hijacking the thread, so if need be, please, I can >> start another thread for it, but could someone explain the code from the OP >> here. I feel like this is sort of the next step in puppet functionality that >> I need to learn (I''m still new). >> >> I''ll start by pointing out three things that tripped me up: >> >> 1. I''ve read about the difference between Package (capitalized), and package >> (lowercase), but in practice I don''t understand it. >> >> When declaring a resource, use the lowercase one. When referring to an >> existing resource, use the uppercase one. >> >> 2. In the Package { require => Class[''yum::client'']}, why isn''t there a >> name? >> >> This says take care of the whole yum::client class before installing >> any package. (Technically this is only almost true. There are exceptions.) > > Eeeek! What are the exceptions?First, if you set a require on the resource using "=>" it overrides the global. Use "+>" to add a require. I also remember hearing something about overriding resources using inheritance, but I don''t remember that. Second, I assume, but I''m not sure, that declaring two dependencies like the example below, overrides instead of stacking, but I''m not sure. site.pp Package { require => Exec["global-package-setup"] } node ''test-node'' { include install-stuff-class } class install-stuff-class { Package { require => Exec["extra-package-setup"] } package { firefox: ensure => present } } In this example, I don''t know if both execs are guaranteed to run before firefox is installed. -- 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.