Hi
I have been trying to use class dependency and had no luck so far.
following are the two classes i am trying to use
[root@puppet]#cat libreoffice.pp
class libreoffice {
  case $hostname {
  "foo": { package { "libreoffice": ensure => present,
require =>
Class["foo1"] } }
}
}
[root@puppet]#cat foo.pp
class foo1 {
  package { "openoffice.org-core":
    ensure => absent,
  }
}
When i run puppetd on client i get the error message
 Could not retrieve catalog from remote server: Error 400 on SERVER:
Could not find class foo1 at /etc/puppet/manifests/classes/
libreoffice.pp:18 on node
Do i need to do anything else in order to use require => Class?
Any help would be appreciated
Thanks
Brijesh
Do i need
-- 
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 also have to have a
include foo1
somewhere.
Note that your require is a dependency,
not an instantiation.  require just says
that foo1 has to be installed first,
before libreoffice package can be installed.
-- 
vagn
class libreoffice {
         case $hostname {
                 "foo": {
                         include foo1
                         package { "libreoffice":
                                 ensure => present,
                                 require => Class["foo1"]
                         }
                 }
         }
}
-- 
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.
Are both of the .pp files being imported in site.pp / init.pp? -- Nathan Clemons http://www.livemocha.com The worlds largest online language learning community On Thu, Jun 30, 2011 at 5:19 PM, brijesh <bridgepatel@gmail.com> wrote:> Hi > > I have been trying to use class dependency and had no luck so far. > following are the two classes i am trying to use > > [root@puppet]#cat libreoffice.pp > > class libreoffice { > > case $hostname { > "foo": { package { "libreoffice": ensure => present, require => > Class["foo1"] } } > } > } > > [root@puppet]#cat foo.pp > > class foo1 { > package { "openoffice.org-core": > ensure => absent, > } > } > > When i run puppetd on client i get the error message > Could not retrieve catalog from remote server: Error 400 on SERVER: > Could not find class foo1 at /etc/puppet/manifests/classes/ > libreoffice.pp:18 on node > > Do i need to do anything else in order to use require => Class? > > Any help would be appreciated > > Thanks > > Brijesh > > > > Do i need > > -- > 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.
thanks that worked i didn''t realise i need to include it first. Brijesh On Jul 1, 1:18 pm, vagn scott <vagnsc...@gmail.com> wrote:> you also have to have a > > include foo1 > > somewhere. > > Note that your require is a dependency, > not an instantiation. require just says > that foo1 has to be installed first, > before libreoffice package can be installed. > > -- > vagn > > class libreoffice { > > case $hostname { > "foo": { > > include foo1 > > package { "libreoffice": > ensure => present, > require => Class["foo1"] > } > } > } > > }-- 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.
yes i have *.pp in my site.pp file but adding include foo1 fixed the issue. On Jul 1, 3:02 pm, brijesh <bridgepa...@gmail.com> wrote:> thanks > that worked i didn''t realise i need to include it first. > > Brijesh > > On Jul 1, 1:18 pm, vagn scott <vagnsc...@gmail.com> wrote: > > > you also have to have a > > > include foo1 > > > somewhere. > > > Note that your require is a dependency, > > not an instantiation. require just says > > that foo1 has to be installed first, > > before libreoffice package can be installed. > > > -- > > vagn > > > class libreoffice { > > > case $hostname { > > "foo": { > > > include foo1 > > > package { "libreoffice": > > ensure => present, > > require => Class["foo1"] > > } > > } > > } > > > }-- 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.