Hi, I''m trying to write a class to install MS Office on Mac (I know, why? ''cus I have to). I''m missing something simple, I''m sure. here''s the class: class install_ms_office { # unfortunately there are a number of updates as well as the base install case $operatingsystem { Darwin: { pkgdmg_install { "Office_2008.dmg": alias => ms_office_base, dirpath => "iasw/msoffice/", before => Pkgdmg_install["Office2008-1210UpdateEN.dmg"] } pkgdmg_install { "Office2008-1210UpdateEN.dmg": alias => ms_office_sp1, dirpath => "iasw/msoffice/", before => Pkgdmg_install["Office2008-1220UpdateEN.dmg"] } pkgdmg_install { "Office2008-1220UpdateEN.dmg": alias => ms_office_sp2, dirpath => "iasw/msoffice/", before => Pkgdmg_install["Office2008-1211UpdateEN.dmg"] } pkgdmg_install { "Office2008-1221UpdateEN.dmg": alias => ms_office_update_1221, dirpath => "iasw/msoffice/", before => Pkgdmg_install["EWS-1300- EN.dmg"] } pkgdmg_install { "EWS-1300-EN.dmg": alias => ms_office_EWS, dirpath => "iasw/msoffice/", } } } } when I run this I get: warning: Configuration could not be instantiated: Could not find dependent Pkgdmg_install[Office2008-1211UpdateEN.dmg] for Package[Office2008-1220UpdateEN.dmg] at /var/puppet/environments/ development/modules/lanl-baseline/manifests/definitions/pkg_install.pp: 31; using cached catalog pkgdmg_install is a definition that looks like this: { $sourcedir_real = $sourcedir ? { false => "http://puppet.lanl.gov", default => $sourcedir } $dirpath_real = $dirpath ? { false => "", default => $dirpath } package { $name: ensure => installed, provider => pkgdmg, source => "$sourcedir_real/${dirpath_real}${name}" } } what simple little stupid thing am I missing? --- Thanks, Allan Marcus 505-667-5666 --~--~---------~--~----~------------~-------~--~----~ 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 Sep 16, 4:55 pm, Allan Marcus <al...@lanl.gov> wrote:> warning: Configuration could not be instantiated: Could not find > dependent Pkgdmg_install[Office2008-1211UpdateEN.dmg] for > Package[Office2008-1220UpdateEN.dmg] at /var/puppet/environments/ > development/modules/lanl-baseline/manifests/definitions/pkg_install.pp: > 31; using cached catalog > > pkgdmg_install is a definition that looks like this: > > { > $sourcedir_real = $sourcedir ? { > false => "http://puppet.lanl.gov", > default => $sourcedir > } > $dirpath_real = $dirpath ? { > false => "", > default => $dirpath > } > package { $name: > ensure => installed, > provider => pkgdmg, > source => "$sourcedir_real/${dirpath_real}${name}" > } > > } > > what simple little stupid thing am I missing?I don''t think puppet supports dependencies between defined type invocations -- at least, not the way you seem to expect. This makes sense to me when I consider that although defined types look a lot like classes, they are not singletons and they function essentially as macros. If you look closely at your error message, in fact, you will see that the relationship that puppet cannot satisfy has a Package resource at one end, even though you did not explicitly specify such a relationship. Puppet is doing its best for you, but what you''re asking cannot be satisfied in its model. I think you can solve your problem by making the targets of your relationships be the appropriate Package resources. For example: pkgdmg_install { "Office2008-1220UpdateEN.dmg": alias => ms_office_sp2, dirpath => "iasw/msoffice/", before => Package["Office2008-1211UpdateEN.dmg"] } That does rely a bit on knowledge of the implementation of pkgdmg_install. If you don''t like that (and perhaps you shouldn''t), or if that suggestion doesn''t work, then the next refinement would be to update the definition to accept an optional "before-package" (or similarly named) parameter, which you then use to directly set the Package - Package dependency, instead of using the ''before'' parameter on the defined type. Good Luck, John --~--~---------~--~----~------------~-------~--~----~ 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. I tried that and it doesn''t work That said, I redid it with "require" instead of "before" and it seems to work now. --- Thanks, Allan Marcus 505-667-5666 On Sep 17, 2009, at 7:24 AM, jcbollinger wrote:> > > > On Sep 16, 4:55 pm, Allan Marcus <al...@lanl.gov> wrote: > >> warning: Configuration could not be instantiated: Could not find >> dependent Pkgdmg_install[Office2008-1211UpdateEN.dmg] for >> Package[Office2008-1220UpdateEN.dmg] at /var/puppet/environments/ >> development/modules/lanl-baseline/manifests/definitions/ >> pkg_install.pp: >> 31; using cached catalog >> >> pkgdmg_install is a definition that looks like this: >> >> { >> $sourcedir_real = $sourcedir ? { >> false => "http://puppet.lanl.gov", >> default => $sourcedir >> } >> $dirpath_real = $dirpath ? { >> false => "", >> default => $dirpath >> } >> package { $name: >> ensure => installed, >> provider => pkgdmg, >> source => "$sourcedir_real/${dirpath_real}${name}" >> } >> >> } >> >> what simple little stupid thing am I missing? > > I don''t think puppet supports dependencies between defined type > invocations -- at least, not the way you seem to expect. This makes > sense to me when I consider that although defined types look a lot > like classes, they are not singletons and they function essentially as > macros. If you look closely at your error message, in fact, you will > see that the relationship that puppet cannot satisfy has a Package > resource at one end, even though you did not explicitly specify such a > relationship. Puppet is doing its best for you, but what you''re > asking cannot be satisfied in its model. > > I think you can solve your problem by making the targets of your > relationships be the appropriate Package resources. For example: > > pkgdmg_install { "Office2008-1220UpdateEN.dmg": > alias => ms_office_sp2, > dirpath => "iasw/msoffice/", > before => Package["Office2008-1211UpdateEN.dmg"] > } > > That does rely a bit on knowledge of the implementation of > pkgdmg_install. If you don''t like that (and perhaps you shouldn''t), > or if that suggestion doesn''t work, then the next refinement would be > to update the definition to accept an optional "before-package" (or > similarly named) parameter, which you then use to directly set the > Package - Package dependency, instead of using the ''before'' parameter > on the defined type. > > Good Luck, > > John > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
jcbollinger wrote:> I don''t think puppet supports dependencies between defined type > invocations -- at least, not the way you seem to expect. This makes > sense to me when I consider that although defined types look a lot > like classes, they are not singletons and they function essentially as > macros.You are wrong. Puppet *does* allow you to do ''before => Foo[x]'', where ''foo'' is a definition. No problem at all. No, the real problem Allan Marcus has, is that he has specified a dependency for a pkgdmg_install resource that is never defined. There is no pkgdmg_install stansa for Office2008-1211UpdateEN.dmg. I suspect he really meant Office2008-1221UpdateEN.dmg instead (note: 1221, not 1211). /Bellman --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
doh! 1221 1211 - they look so similar! thanks. --- Thanks, Allan Marcus 505-667-5666 On Sep 17, 2009, at 4:02 PM, Thomas Bellman wrote:> > jcbollinger wrote: > >> I don''t think puppet supports dependencies between defined type >> invocations -- at least, not the way you seem to expect. This makes >> sense to me when I consider that although defined types look a lot >> like classes, they are not singletons and they function essentially >> as >> macros. > > You are wrong. Puppet *does* allow you to do ''before => Foo[x]'', > where ''foo'' is a definition. No problem at all. > > No, the real problem Allan Marcus has, is that he has specified > a dependency for a pkgdmg_install resource that is never defined. > There is no pkgdmg_install stansa for Office2008-1211UpdateEN.dmg. > I suspect he really meant Office2008-1221UpdateEN.dmg instead > (note: 1221, not 1211). > > > /Bellman > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---