On Friday, October 26, 2012 2:31:56 PM UTC-4, Tim Mooney wrote:
>
> In regard to: [Puppet Users] Have Class Only Perform Actions When There 
> Is...: 
>
> I would highly recommend you just package your custom python and install 
> it using a package management system, rather than doing what you're doing. 
> Depending on what host OS you're using, it's not too difficult, and it 
> works a lot better with puppet *and* you get all the benefits of having 
> the package installed through a more coherent means. 
>
> As you're discovering, these kind of exec chains, where the first part 
> of the chain involves temporary files, don't really fit into the puppet 
> paradigm very well.  About the best you can do is something like 
>
>          exec { '/usr/local/sbin/install-python-if-necessary.sh': 
>                  source  => '
> http://your_module/install-python-if-necessary.sh', 
>                  creates => '/your/python/lib/dir', 
>          } 
>
> and then bury all the fetch/extract/configure/compile/install logic 
> in the shell script, which puppet will make certain is always present 
> on the system.  It will only execute it if /your/python/lib/dir is not 
> present. 
>
> But if you're going to build fetch/extract/configure/compile/install logic 
> into a shell script, you're probably 85% of the way to packaging the 
> software appropriately anyway. 
>
>
Interesting. It sounds like you're actually advocating _for_ the bash 
script approach. I wanted to avoid package management systems only because 
they are way more complicated than a basic install of python requires:

  wget python.tgz
  tar -xzvf python.tgz
  cd python
  ./configure --prefix=/install/path
  make
  make test
  make install

I wanted to make (I have made?) a simple "python" class that accepts a 
python version number, downloads it, and runs those steps, irrespective of 
the base Linux flavor. I don't know much of anything about deb or rpm files 
other than that they are more complicated than that; and I don't want to 
have to package up and maintain several different python versions for 
several different package managers. 

-- 
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/-/mAWFxrBz_kYJ.
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