Peter Berghold
2010-May-19 19:30 UTC
[Puppet Users] Using a set of recipes to build stuff from source...
Hi folks,
I''m a newbie to this wonderful tool called puppet and so far
I''m loving it.
One of the first set of recipes (classes?) I wrote for my environment was to
build some packages from source and install them. Stuff like apache httpd,
nagios and others I prefer to build from source because the distro i''m
forced to use lags behind version wise (CloudLinux, a form of CentOS) and
I''d like certain of my tools to be more recent vintages than the distro
provides.
Is there a way to wrap a set of exec { } statement in a conditional such as:
if [ file_or_directory_does_not_exist ]
then
exec { thing1}
exec {thing2}
etc...
or is there a better way that I''m not seeing?
Peter L. Berghold
Owner, Shark River Technical Solutions LLC
--
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.
Steven VanDevender
2010-May-19 20:08 UTC
[Puppet Users] Using a set of recipes to build stuff from source...
Peter Berghold writes:
> Hi folks,
>
> I''m a newbie to this wonderful tool called puppet and so far
I''m loving it.
>
> One of the first set of recipes (classes?) I wrote for my environment was
to
> build some packages from source and install them. Stuff like apache httpd,
> nagios and others I prefer to build from source because the distro
i''m
> forced to use lags behind version wise (CloudLinux, a form of CentOS) and
> I''d like certain of my tools to be more recent vintages than the
distro
> provides.
>
> Is there a way to wrap a set of exec { } statement in a conditional such
as:
>
>
> if [ file_or_directory_does_not_exist ]
> then
> exec { thing1}
> exec {thing2}
>
> etc...
>
> or is there a better way that I''m not seeing?
You''re probably going to be better off making custom RPM packages for
things that you want to have locally-built, place them in a local
repository that your systems are configured to access, and then using
the Puppet "package" resource type to install them.
In general, the "exec" resource type should be a last resort for
things
that you can''t use an existing Puppet resource type to manage.
--
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.
Peter Berghold
2010-May-19 20:17 UTC
Re: [Puppet Users] Using a set of recipes to build stuff from source...
On Wed, May 19, 2010 at 4:08 PM, Steven VanDevender <stevev@uoregon.edu>wrote:> P > > You''re probably going to be better off making custom RPM packages for > things that you want to have locally-built, place them in a local > repository that your systems are configured to access, and then using > the Puppet "package" resource type to install them. > >I thought that as well, but didn''t really want to just yet. If I go that route I guess it will mean I''ll have to get around to doing something I''ve been putting off.. I''ve been planning to build a custom yum repository but that was not going to happen right way. -- Peter L. Berghold Owner, Shark River Technical Solutions LLC -- 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.
Al @ Lab42
2010-May-19 22:05 UTC
[Puppet Users] Re: Using a set of recipes to build stuff from source...
On 19 Mag, 22:17, Peter Berghold <salty.cowd...@gmail.com> wrote:> On Wed, May 19, 2010 at 4:08 PM, Steven VanDevender <ste...@uoregon.edu>wrote: > > > P > > > You''re probably going to be better off making custom RPM packages for > > things that you want to have locally-built, place them in a local > > repository that your systems are configured to access, and then using > > the Puppet "package" resource type to install them. > > I thought that as well, but didn''t really want to just yet. > > If I go that route I guess it will mean I''ll have to get around to doing > something I''ve been putting off.. I''ve been planning to build a custom yum > repository but that was not going to happen right way.You might find interesting (also to see how to manage dependencies among different execs) the custom define I made to manage downloads of tarballs, extract and compilation / installation commands: netinstall define http://git.example42.com/?p=example42modules/.git;a=blob;f=common/manifests/defines/netinstall.pp an example of usage: http://git.example42.com/?p=example42modules/.git;a=blob_plain;f=mailscanner/manifests/classes/netinstall.pp Al -- 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.
Patrick
2010-May-20 02:51 UTC
Re: [Puppet Users] Using a set of recipes to build stuff from source...
On May 19, 2010, at 12:30 PM, Peter Berghold wrote:> Hi folks, > > I''m a newbie to this wonderful tool called puppet and so far I''m loving it. > > One of the first set of recipes (classes?) I wrote for my environment was to build some packages from source and install them. Stuff like apache httpd, nagios and others I prefer to build from source because the distro i''m forced to use lags behind version wise (CloudLinux, a form of CentOS) and I''d like certain of my tools to be more recent vintages than the distro provides. > > Is there a way to wrap a set of exec { } statement in a conditional such as: > > if [ file_or_directory_does_not_exist ] > then > exec { thing1} > exec {thing2} > > etc... > > > or is there a better way that I''m not seeing? > > Peter L. Berghold > Owner, Shark River Technical Solutions LLCAs other people have said, it sounds like you are doing it wrong, but you can do that using the creates parameter on exec like this: exec { "/usr/bin/wget http://puppet.local/OaksSecureBrowser3.0.tar.gz -O - | /bin/tar -xvz": cwd => "/usr", creates => "/usr/OaksSecureBrowser3.0", require => Package["wget"], } -- 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.
Dan Carley
2010-May-20 08:42 UTC
Re: [Puppet Users] Using a set of recipes to build stuff from source...
On 19 May 2010 21:17, Peter Berghold <salty.cowdawg@gmail.com> wrote:> I thought that as well, but didn''t really want to just yet. > > If I go that route I guess it will mean I''ll have to get around to doing > something I''ve been putting off.. I''ve been planning to build a custom yum > repository but that was not going to happen right way.I suspect you''ll find that the initial install is quite easy. It''s the subsequent upgrades that will be a tangled mess of exec{}, require and onlyif. Seriously, roll your own packages and use the package{} type now. You''ll thank yourself later. -- 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.