Hello all, I''ve been banging my head against the wall trying to get this "make" to run and I was hoping to get some opinions as to why this might not be working. The module in question looks like this: class install-lei_chelsio_driver { # This will place the chelsio tarball locally in /usr/src. File is pulled from puppet. file { "/usr/src/ChelsioUwire-1.0.2.26.tar.gz" : source => "puppet:///install-lei_chelsio_driver/ChelsioUwire-1.0.2.26.tar.gz" , ensure => present , } # Untar the tarball exec { "/bin/tar -xvf /usr/src/ChelsioUwire-1.0.2.26.tar.gz" : cwd => "/usr/src/" , creates => "/usr/src/ChelsioUwire-1.0.2.26" , } # This will run the make which will line up everything to install the drivers from source. exec { "/usr/src/ChelsioUwire-1.0.2.26 make KDIR=/usr/src/linux-headers-2.6.32-41" : path => "/usr/src/ChelsioUwire-1.0.2.26" , } } This is the error I get upon running a machine against the manifest: err: /Stage[main]/Install-lei_chelsio_driver/Exec[/usr/src/ChelsioUwire-1.0.2.26 make KDIR=/usr/src/linux-headers-2.6.32-41]/returns: change from notrun to 0 failed: /usr/src/ChelsioUwire-1.0.2.26 make KDIR=/usr/src/linux-headers-2.6.32-41 returned 1 instead of one of [0] at /etc/puppet/modules/install-lei_chelsio_driver/manifests/init.pp:20 I added the "path" parameter for good measure and still no dice. Any suggestions as to why this one won''t properly fire? As always, the help and support are much appreciated. Cheers, Mike -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/x2zv2n4k4b8J. 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 Berghold
2012-Aug-01 20:05 UTC
Re: [Puppet Users] Running "make" via puppet manifest
On Wed, Aug 1, 2012 at 3:56 PM, Mike Reed <mjohn.reed@gmail.com> wrote:> > # This will run the make which will line up everything to install > the drivers from source. > exec { "/usr/src/ChelsioUwire-1.0.2.26 make > KDIR=/usr/src/linux-headers-2.6.32-41" : > path => "/usr/src/ChelsioUwire-1.0.2.26" , > } > } > > T >Is that a space between the directory path and the "make?" That line is confusing me. Perhaps you wanted it to say exec { thing: cwd => "/usr/src/ChelsioUwire-1.0.2.26", path=> "{path with system specific directories in it}", command => "make KDIR=/usr/src/linux-headers-2.6.32-41" : } It occurs to me that just having the path set to where you are doing your build is going to leave out the places where things like gcc, ld and friends live. You path should be colon delimited with all the directory paths that contain commands your build is dependant on. The other thought I had (and maybe I''m missing something here) is I usually put things like file and exec in this sort of format: file { ''some-sort-of-tag'': path => ..., souirce => ... (or content => ...) } and exec { some-other-tag: ... etc } -- Peter L. Berghold Salty.Cowdawg@gmail.com http://blog.berghold.net “"Don''t wait until everything is just right. It will never be perfect. There will always be challenges, obstacles and less than perfect conditions. So what. Get started now. With each step you take, you will grow stronger and stronger, more and more skilled, more and more self-confident and more and more successful." - Mark Victor Hansen<http://www.quotesdaddy.com/quote/1041647/mark-victor-hansen/dont-wait-until-everything-is-just-right-it-will-never> ” Get this email app! <http://www.wisestamp.com/apps/quotes?utm_source=extension&utm_medium=email&utm_term=quotes&utm_campaign=apps> Want a signature like mine? <http://r1.wisestamp.com/r/landing?promo=16&dest=http%3A%2F%2Fwww.wisestamp.com%2Femail-install%3Futm_source%3Dextension%26utm_medium%3Demail%26utm_campaign%3Dpromo_16> Click here.<http://r1.wisestamp.com/r/landing?promo=16&dest=http%3A%2F%2Fwww.wisestamp.com%2Femail-install%3Futm_source%3Dextension%26utm_medium%3Demail%26utm_campaign%3Dpromo_16> -- 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.
I have some similar manifests, and I usually deploy a script (via a file type) and then use an exec to run the script. This seems cleaner to me (rather then a chain of exec statements) and insulates the scripting from Puppet. Ben On Wednesday, August 1, 2012 2:56:11 PM UTC-5, Mike Reed wrote:> > Hello all, > > I''ve been banging my head against the wall trying to get this "make" to > run and I was hoping to get some opinions as to why this might not be > working. The module in question looks like this: > > class install-lei_chelsio_driver { > # This will place the chelsio tarball locally in /usr/src. File > is pulled from puppet. > file { "/usr/src/ChelsioUwire-1.0.2.26.tar.gz" : > source => > "puppet:///install-lei_chelsio_driver/ChelsioUwire-1.0.2.26.tar.gz" , > ensure => present , > } > > # Untar the tarball > exec { "/bin/tar -xvf /usr/src/ChelsioUwire-1.0.2.26.tar.gz" : > cwd => "/usr/src/" , > creates => "/usr/src/ChelsioUwire-1.0.2.26" , > } > > # This will run the make which will line up everything to install > the drivers from source. > exec { "/usr/src/ChelsioUwire-1.0.2.26 make > KDIR=/usr/src/linux-headers-2.6.32-41" : > path => "/usr/src/ChelsioUwire-1.0.2.26" , > } > } > > This is the error I get upon running a machine against the manifest: > > err: > /Stage[main]/Install-lei_chelsio_driver/Exec[/usr/src/ChelsioUwire-1.0.2.26 > make KDIR=/usr/src/linux-headers-2.6.32-41]/returns: change from notrun to > 0 failed: /usr/src/ChelsioUwire-1.0.2.26 make > KDIR=/usr/src/linux-headers-2.6.32-41 returned 1 instead of one of [0] at > /etc/puppet/modules/install-lei_chelsio_driver/manifests/init.pp:20 > > I added the "path" parameter for good measure and still no dice. > > Any suggestions as to why this one won''t properly fire? > > As always, the help and support are much appreciated. > > Cheers, > > Mike >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/VMYP9vrLnJwJ. 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.
Darren Chamberlain
2012-Aug-01 21:13 UTC
Re: [Puppet Users] Running "make" via puppet manifest
* Mike Reed <mjohn.reed at gmail.com> [2012/08/01 12:56]:> # This will run the make which will line up everything to install > the drivers from source. > exec { "/usr/src/ChelsioUwire-1.0.2.26 make > KDIR=/usr/src/linux-headers-2.6.32-41" : > path => "/usr/src/ChelsioUwire-1.0.2.26" , > } > }You''re running the command: /usr/src/ChelsioUwire-1.0.2.26 make KDIR=/usr/src/linux-headers-2.6.32-41 Which doesn''t make any sense, as the error message says:> err: > /Stage[main]/Install-lei_chelsio_driver/Exec[/usr/src/ChelsioUwire-1.0.2.26 > make KDIR=/usr/src/linux-headers-2.6.32-41]/returns: change from notrun to > 0 failed: /usr/src/ChelsioUwire-1.0.2.26 make > KDIR=/usr/src/linux-headers-2.6.32-41 returned 1 instead of one of [0] at > /etc/puppet/modules/install-lei_chelsio_driver/manifests/init.pp:20-- Darren Chamberlain <darren@boston.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.
On Wed, 2012-08-01 at 12:56 -0700, Mike Reed wrote:> Hello all, > > I''ve been banging my head against the wall trying to get this "make" to run > and I was hoping to get some opinions as to why this might not be working. > The module in question looks like this:Lets take a look in order:> class install-lei_chelsio_driver { > # This will place the chelsio tarball locally in /usr/src. File is pulled from puppet. > file { "/usr/src/ChelsioUwire-1.0.2.26.tar.gz" : > source => "puppet:///install-lei_chelsio_driver/ChelsioUwire-1.0.2.26.tar.gz" , > ensure => present , > } > > # Untar the tarball > exec { "/bin/tar -xvf /usr/src/ChelsioUwire-1.0.2.26.tar.gz" : > cwd => "/usr/src/" , > creates => "/usr/src/ChelsioUwire-1.0.2.26" , > }You don''t have any dependencies specified here, so puppet doesn''t know that it has to copy over the tar file before untarring. It''s possible that this worked previously by chance... but it could just as easily fail later. Add a requires => File[''/usr/src/ChelsioUwire-1.0.2.26.tar.gz''], to this exec resource.> # This will run the make which will line up everything to install the drivers from source. > exec { "/usr/src/ChelsioUwire-1.0.2.26 make KDIR=/usr/src/linux-headers-2.6.32-41" : > path => "/usr/src/ChelsioUwire-1.0.2.26" , > }There''s a few things wrong here; it''s quite confused. The correct exec syntax would look like this: exec { ''make KDIR=/usr/src/linux-headers-2.6.32-41'': path => [''/usr/bin'', ''/bin'' ], cwd => ''/usr/src/ChelsioUwire-1.0.2.26'', requires => Exec[''/bin/tar -xvf /usr/src/ChelsioUwire-1.0.2.26.tar.gz''], } The ''requires'' ensures that the file is untarred before the make command is run. Take a look at http://docs.puppetlabs.com/references/latest/type.html#exec for descriptions of the parameters being passed to the exec.> }You should really give the rest of the puppet documentation a read through as well; http://docs.puppetlabs.com/learning/ordering.html talks about ordering and dependencies. -- Calvin Walton <calvin.walton@kepstin.ca> -- 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.
Thank you all for the responses. I think the solution of scripting the install and calling the script via puppet is an interesting thought. Thanks as well for the suggested reading. Cheers, Mike On Wednesday, August 1, 2012 12:56:11 PM UTC-7, Mike Reed wrote:> > Hello all, > > I''ve been banging my head against the wall trying to get this "make" to > run and I was hoping to get some opinions as to why this might not be > working. The module in question looks like this: > > class install-lei_chelsio_driver { > # This will place the chelsio tarball locally in /usr/src. File > is pulled from puppet. > file { "/usr/src/ChelsioUwire-1.0.2.26.tar.gz" : > source => > "puppet:///install-lei_chelsio_driver/ChelsioUwire-1.0.2.26.tar.gz" , > ensure => present , > } > > # Untar the tarball > exec { "/bin/tar -xvf /usr/src/ChelsioUwire-1.0.2.26.tar.gz" : > cwd => "/usr/src/" , > creates => "/usr/src/ChelsioUwire-1.0.2.26" , > } > > # This will run the make which will line up everything to install > the drivers from source. > exec { "/usr/src/ChelsioUwire-1.0.2.26 make > KDIR=/usr/src/linux-headers-2.6.32-41" : > path => "/usr/src/ChelsioUwire-1.0.2.26" , > } > } > > This is the error I get upon running a machine against the manifest: > > err: > /Stage[main]/Install-lei_chelsio_driver/Exec[/usr/src/ChelsioUwire-1.0.2.26 > make KDIR=/usr/src/linux-headers-2.6.32-41]/returns: change from notrun to > 0 failed: /usr/src/ChelsioUwire-1.0.2.26 make > KDIR=/usr/src/linux-headers-2.6.32-41 returned 1 instead of one of [0] at > /etc/puppet/modules/install-lei_chelsio_driver/manifests/init.pp:20 > > I added the "path" parameter for good measure and still no dice. > > Any suggestions as to why this one won''t properly fire? > > As always, the help and support are much appreciated. > > Cheers, > > Mike >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/AihRUzCvjQ0J. 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.
Kristof Willaert
2012-Aug-02 18:09 UTC
Re: [Puppet Users] Re: Running "make" via puppet manifest
Hi, On Thu, Aug 2, 2012 at 6:25 PM, Mike Reed <mjohn.reed@gmail.com> wrote:> Thank you all for the responses. I think the solution of scripting the > install and calling the script via puppet is an interesting thought. > Thanks as well for the suggested reading.just my thoughts on this: if you are going to perform this procedure on a few hosts, why not go the extra mile and create a package (deb, RPM, ...) on a buildhost, and just distribute the package through the normal mechanism (yum, apt repo) ? That way, your manifests will be reduced to the nearly trivial package { ''ChelsioUwire'': ensure => ''1.0.2.**26'', } Kind regards, k -- 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.