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.wal...@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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to