Don Jackson
2010-Dec-15 06:45 UTC
[Puppet Users] having trouble with puppet 0.25.5 on openbsd 4.8 on amd64
My manifest includes this snippet class app_client_openbsd { $app_client_pkgs_obsd = [ ''glib2-2.24.1p2'', ''gtar-1.23p1'' ] package { "${app_client_pkgs_obsd}": ensure => ''installed'', source => "http://${installserver}/openbsd/${operatingsystemrelease}/packages/${hardwaremodel}/${name}.tgz", } This doesn''t work. debug: Puppet::Type::Package::ProviderOpenbsd: Executing ''/usr/sbin/pkg_info glib2-2.24.1p2gtar-1.23p1'' debug: /app_client_openbsd/Package[glib2-2.24.1p2gtar-1.23p1]: Changing ensure debug: //app_client_openbsd/Package[glib2-2.24.1p2gtar-1.23p1]: 1 change(s) debug: Puppet::Type::Package::ProviderOpenbsd: Executing ''/usr/sbin/pkg_add http://svr.example.net/openbsd/4.8/packages/amd64/app_client_openbsd.tgz'' notice: //app_client_openbsd/Package[glib2-2.24.1p2gtar-1.23p1]/ensure: created So why do the two strings of the two package names get smushed together instead of being run separately? -- 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.
Daniel Pittman
2010-Dec-15 07:04 UTC
Re: [Puppet Users] having trouble with puppet 0.25.5 on openbsd 4.8 on amd64
On Wed, Dec 15, 2010 at 17:45, Don Jackson <puppet-users@clark-communications.com> wrote:> > My manifest includes this snippet > class app_client_openbsd { > $app_client_pkgs_obsd = [ ''glib2-2.24.1p2'', ''gtar-1.23p1'' ] > package { "${app_client_pkgs_obsd}": > ensure => ''installed'', > source => > "http://${installserver}/openbsd/${operatingsystemrelease}/packages/${hardwaremodel}/${name}.tgz", > } > This doesn''t work. > > debug: Puppet::Type::Package::ProviderOpenbsd: Executing ''/usr/sbin/pkg_info > glib2-2.24.1p2gtar-1.23p1'' > debug: /app_client_openbsd/Package[glib2-2.24.1p2gtar-1.23p1]: Changing > ensure > debug: //app_client_openbsd/Package[glib2-2.24.1p2gtar-1.23p1]: 1 change(s) > debug: Puppet::Type::Package::ProviderOpenbsd: Executing ''/usr/sbin/pkg_add > http://svr.example.net/openbsd/4.8/packages/amd64/app_client_openbsd.tgz'' > notice: //app_client_openbsd/Package[glib2-2.24.1p2gtar-1.23p1]/ensure: > created > > So why do the two strings of the two package names get smushed together > instead of being run separately?Because the behaviour of puppet when an array is converted to a string is to concatenate. What you want is something like this: package { $array: ... } ...rather than... package { "$array": ... } I think you will then run into the issue that $name can''t be expanded at that point, though, which would require writing an extra define to make it available. :( Regards, Daniel -- ✣ Daniel Pittman ✉ daniel@rimspace.net ☎ +61 401 155 707 ♽ made with 100 percent post-consumer electrons -- 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.
Eric Sorenson
2010-Dec-15 07:23 UTC
Re: [Puppet Users] having trouble with puppet 0.25.5 on openbsd 4.8 on amd64
On Dec 14, 2010, at 11:04 PM, Daniel Pittman wrote:> I think you will then run into the issue that $name can''t be expanded > at that point, though, which would require writing an extra define to > make it available. :(I really thought that would work too and mocked it up but apparently it ain''t so. I tried ''$name'' ''$namevar'' ''$title'' to no avail. https://projects.puppetlabs.com/issues/5259 seemed germane so I updated it with this discussion. [eric@recury ~/sandbox/dotmac/puppet]% cat packages.pp $installserver = "localhost" package { [ ''glib2-2.24.1p2'', ''gtar-1.23p1'' ]: provider => ''pkgdmg'', ensure => ''installed'', source => "http://${installserver}/openbsd/${operatingsystemrelease}/packages/${hardwaremodel}/${name}.dmg", } info: Applying configuration version ''1292396816'' debug: //Package[glib2-2.24.1p2]: Changing ensure debug: //Package[glib2-2.24.1p2]: 1 change(s) debug: Puppet::Type::Package::ProviderPkgdmg: Executing ''/usr/bin/curl -o /tmp/glib2-2.24.1p2 -C - -k -s --url http://localhost/openbsd/10.5.0/packages/i386/.dmg'' debug: Success: curl transfered [glib2-2.24.1p2] debug: Puppet::Type::Package::ProviderPkgdmg: Executing ''/usr/bin/hdiutil mount -plist -nobrowse -readonly -noidme -mountrandom /tmp /tmp/glib2-2.24.1p2'' err: //Package[glib2-2.24.1p2]/ensure: change from absent to present failed: Execution of ''/usr/bin/hdiutil mount -plist -nobrowse -readonly -noidme -mountrandom /tmp /tmp/glib2-2.24.1p2'' returned 1: hdiutil: mount failed - not recognized debug: //Package[gtar-1.23p1]: Changing ensure debug: //Package[gtar-1.23p1]: 1 change(s) debug: Puppet::Type::Package::ProviderPkgdmg: Executing ''/usr/bin/curl -o /tmp/gtar-1.23p1 -C - -k -s --url http://localhost/openbsd/10.5.0/packages/i386/.dmg'' debug: Success: curl transfered [gtar-1.23p1] debug: Puppet::Type::Package::ProviderPkgdmg: Executing ''/usr/bin/hdiutil mount -plist -nobrowse -readonly -noidme -mountrandom /tmp /tmp/gtar-1.23p1'' err: //Package[gtar-1.23p1]/ensure: change from absent to present failed: Execution of ''/usr/bin/hdiutil mount -plist -nobrowse -readonly -noidme -mountrandom /tmp /tmp/gtar-1.23p1'' returned 1: hdiutil: mount failed - not recognized debug: Finishing transaction 2169486380 with 2 changes - Eric Sorenson - N37 17.255 W121 55.738 - http://twitter.com/ahpook - -- 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.
Daniel Pittman
2010-Dec-15 11:21 UTC
Re: [Puppet Users] having trouble with puppet 0.25.5 on openbsd 4.8 on amd64
On Wed, Dec 15, 2010 at 18:23, Eric Sorenson <eric.sorenson@me.com> wrote:> On Dec 14, 2010, at 11:04 PM, Daniel Pittman wrote: > >> I think you will then run into the issue that $name can''t be expanded >> at that point, though, which would require writing an extra define to >> make it available. :( > > I really thought that would work too and mocked it up but apparently it ain''t so. I tried ''$name'' ''$namevar'' ''$title'' to no avail. > > https://projects.puppetlabs.com/issues/5259 seemed germane so I updated it with this discussion.Sad but true - and thanks for updating the bug report. It helps communicate what is hurting folks. You can "fix" this like so: define foo () { package { $name: source => "http:/.../$name" } } class bar { foo { ["one", "two"]: } } Not as nice, but at least you can do the array expansion stuff - and where you needs lots of similar parameters it makes some sense to do it that way. Regards, Daniel -- ✣ Daniel Pittman ✉ daniel@rimspace.net ☎ +61 401 155 707 ♽ made with 100 percent post-consumer electrons -- 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.
Apparently Analagous Threads
- Installing Virtualbox on Mac osx with pkg dmg provider
- Image checksum error while booting Isolinux
- OpenSolaris+ZFS+RAIDZ+VirtualBox - ready for production systems?
- Eclipse (Java) locking issues after upgrade (3.6.23 -> 4.4.3)
- rsync time machine backup permissions