[Puppet Users] Re: Puppet and installing packages from source

2013-01-03 Thread magic . rh
I understand the points you mentioned, but as long as software is still 
being distributed as source packages I think it should be supported at some 
level by Puppet.
That being said, I'm off to learn some packaging techniques.

Thanks for all the help.
Magic.

On Wednesday, January 2, 2013 7:30:01 PM UTC+2, jcbollinger wrote:
>
>
>
> On Wednesday, January 2, 2013 3:32:55 AM UTC-6, magi...@gmail.com wrote:
>>
>> Hello Everyone,
>>
>> I'm looking for a way to install packages from source via puppet, I was 
>> able to locate maybe 5 posts on this subject which is very strange, as I 
>> would expect people to still use ./configure with their own customized 
>> options.
>>
>
>
> Why would you expect that?  Responsible sysadmins use packages wherever 
> possible.  The alternative is madness.
>
> Moreover, if you continue with the puppet-controlled build approach, you 
> will find that you have to go to a fair amount of effort to ensure that the 
> program is built and installed only at need.  Then, eventually you may find 
> that it's even trickier to fit updates into the picture.  And you may 
> discover that you need to explicitly manage dependencies -- hopefully 
> before something breaks unexpectedly.  Relying on your package manager 
> makes all this a lot easier to deal with.
>
>
> John
>
>

-- 
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/-/8TpS7e3N-aIJ.
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.



[Puppet Users] Re: Puppet and installing packages from source

2013-01-04 Thread magic . rh
I understand exactly what source packages do, if it makes it easier for you 
I'll call them tar.gz files.
Also, I don't find your comparison valid, as the result of package 
installation be it yum or ./configure && make && make install is the same: 
software being installed.

My meaning is that compiling from source will always be with us, and it's 
the prominent way of releasing new software.

Thanks,
Magic.

On Wednesday, January 2, 2013 11:32:55 AM UTC+2, magi...@gmail.com wrote:
>
> Hello Everyone,
>
> I'm looking for a way to install packages from source via puppet, I was 
> able to locate maybe 5 posts on this subject which is very strange, as I 
> would expect people to still use ./configure with their own customized 
> options.
> For example, I need to compile Curl with c-ares support, for that I need 
> to set an option for ./configure but can't find a way to do it.
>
> Here's the manifest, it works up to the point of "configure" which fails:
>
> file { "/usr/local/src": ensure => directory }
> file { "/usr/local/src/c-ares-1.9.1.tar.gz":
> source => "puppet:///modules/web_dev/c-ares-1.9.1.tar.gz",
> alias => "ares-source-tgz",
> before => Exec["untar-ares-source"]
> }
>
> exec { "tar xzf /usr/local/src/c-ares-1.9.1.tar.gz":
> cwd => "/usr/local/src",
> path => "/bin",
> creates => "/usr/local/src/c-ares-1.9.1",
> alias => "untar-ares-source",
> subscribe => File["ares-source-tgz"]
> }
>
> exec { "configure":
> command => "./configure",
> cwd => "/usr/local/src/c-ares-1.9.1",
> path => "/usr/local/src/c-ares-1.9.1",
> require => Exec[untar-ares-source],
> creates => "/usr/local/src/c-ares-1.9.1/config.h",
> }
>
> The ERROR:
>
> Debug: Exec[configure](provider=posix): Executing './configure'
> Debug: Executing './configure'
> Notice: /Stage[main]/Web_dev/Exec[configure]/returns: ./configure: 1: 
> ./configure: expr: not found
> Notice: /Stage[main]/Web_dev/Exec[configure]/returns: ./configure: 1: 
> ./configure: expr: not found
> Notice: /Stage[main]/Web_dev/Exec[configure]/returns: ./configure: 95: 
> ./configure: as_fn_error: not found
> Notice: /Stage[main]/Web_dev/Exec[configure]/returns: ./configure: line 
> 83: expr: command not found
> Notice: /Stage[main]/Web_dev/Exec[configure]/returns: ./configure: line 
> 90: expr: command not found
> Notice: /Stage[main]/Web_dev/Exec[configure]/returns: ./configure: line 
> 95: as_fn_error: command not found
> Notice: /Stage[main]/Web_dev/Exec[configure]/returns: ./configure: line 
> 465: sed: command not found
> Notice: /Stage[main]/Web_dev/Exec[configure]/returns: ./configure: line 
> 464: expr: command not found
> Notice: /Stage[main]/Web_dev/Exec[configure]/returns: ./configure: line 
> 465: sed: command not found
> Notice: /Stage[main]/Web_dev/Exec[configure]/returns: ./configure: line 
> 479: sed: command not found
> Notice: /Stage[main]/Web_dev/Exec[configure]/returns: : error: cannot 
> create .lineno; rerun with a POSIX shell
> Error: ./configure returned 1 instead of one of [0]
> Error: /Stage[main]/Web_dev/Exec[configure]/returns: change from notrun to 
> 0 failed: ./configure returned 1 instead of one of [0]
>
> Anyone did this or knows whats wrong ?
>
> Thanks,
> Magic.
>

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



[Puppet Users] Re: Puppet and installing packages from source

2013-01-07 Thread magic . rh
Thanks Hans, great answer.
I'll definitely get into customized packaging, demystify their magics.

Regards,
Magic.

On Friday, January 4, 2013 3:35:20 PM UTC+2, Hans van der Made wrote:
>
>
>
> On Friday, January 4, 2013 10:39:53 AM UTC+1, magi...@gmail.com wrote:
>>
>> I understand exactly what source packages do, if it makes it easier for 
>> you I'll call them tar.gz files.
>> Also, I don't find your comparison valid, as the result of package 
>> installation be it yum or ./configure && make && make install is the same: 
>> software being installed.
>>
>> My meaning is that compiling from source will always be with us, and it's 
>> the prominent way of releasing new software.
>>
>
> When all the required features of a source build & install environment are 
> met, like uninstalling, upgrading, listing, you end up with a new type of 
> package provider. As you don't want a split between OS-provided software 
> (libraries your source file depends on), it's easier to use the provider 
> your OS comes with.
>
> The requirements for building source are often many. You'll need a 
> compiler and a toolchain, at least. Many don't want all of these tools 
> installed on their (virtual) production servers, because they consume 
> space, require updates, and because they facilitate exploits. Less software 
> means less work and less risk. 
>
> Building software on a separate system and deploying the resulting 
> binaries and documentation to production systems is one step up from 
> compiling on your production systems.
>
> Many of us used to compile from source earlier in our careers, so don't 
> asume we don't know about anything but ready made packages ;-)
>
> Now for a quick hack to address your problem:
>
> Why don't you try to do a ./configure --prefix=/usr/local --specialopts && 
> make && make install on a clean system and create a tar file of /usr/local/ 
> afterwards?  Missing dependencies can be met by installing OS packages on 
> your test system. The installation on your target system can be a hack like 
> this:
>
> # dependencies
> package { [ "dep1", "dep2", "dep3", ]: ensure => installed, }
>
> file { "/var/tmp/curl-custom-version.tar.gz":
>   ensure => file,
>   source => "puppet:///module/curl-custom-version.tar.gz",
>   notify => Exec["unpackcurl"],
> }
>
> exec { "unpackcurl": 
>   command => "tar -C /usr/local -xzf /var/tmp/curl-custom-version.tar.gz",
>   creates => "/usr/local/bin/curl",
>   path => "/usr/sbin:/usr/bin:/sbin:/bin",
>   logoutput => true,
>   refreshonly => false,
> }
>
> If possible, use packages, but if you can't meet your deadline this way, 
> try the above (and discover the wonderful world of packaging anyway at a 
> later time).
>
> Best,
>
> Hans
>
>

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



[Puppet Users] Puppet and installing packages from source

2013-01-02 Thread magic . rh
Hello Everyone,

I'm looking for a way to install packages from source via puppet, I was 
able to locate maybe 5 posts on this subject which is very strange, as I 
would expect people to still use ./configure with their own customized 
options.
For example, I need to compile Curl with c-ares support, for that I need to 
set an option for ./configure but can't find a way to do it.

Here's the manifest, it works up to the point of "configure" which fails:

file { "/usr/local/src": ensure => directory }
file { "/usr/local/src/c-ares-1.9.1.tar.gz":
source => "puppet:///modules/web_dev/c-ares-1.9.1.tar.gz",
alias => "ares-source-tgz",
before => Exec["untar-ares-source"]
}

exec { "tar xzf /usr/local/src/c-ares-1.9.1.tar.gz":
cwd => "/usr/local/src",
path => "/bin",
creates => "/usr/local/src/c-ares-1.9.1",
alias => "untar-ares-source",
subscribe => File["ares-source-tgz"]
}

exec { "configure":
command => "./configure",
cwd => "/usr/local/src/c-ares-1.9.1",
path => "/usr/local/src/c-ares-1.9.1",
require => Exec[untar-ares-source],
creates => "/usr/local/src/c-ares-1.9.1/config.h",
}

The ERROR:

Debug: Exec[configure](provider=posix): Executing './configure'
Debug: Executing './configure'
Notice: /Stage[main]/Web_dev/Exec[configure]/returns: ./configure: 1: 
./configure: expr: not found
Notice: /Stage[main]/Web_dev/Exec[configure]/returns: ./configure: 1: 
./configure: expr: not found
Notice: /Stage[main]/Web_dev/Exec[configure]/returns: ./configure: 95: 
./configure: as_fn_error: not found
Notice: /Stage[main]/Web_dev/Exec[configure]/returns: ./configure: line 83: 
expr: command not found
Notice: /Stage[main]/Web_dev/Exec[configure]/returns: ./configure: line 90: 
expr: command not found
Notice: /Stage[main]/Web_dev/Exec[configure]/returns: ./configure: line 95: 
as_fn_error: command not found
Notice: /Stage[main]/Web_dev/Exec[configure]/returns: ./configure: line 
465: sed: command not found
Notice: /Stage[main]/Web_dev/Exec[configure]/returns: ./configure: line 
464: expr: command not found
Notice: /Stage[main]/Web_dev/Exec[configure]/returns: ./configure: line 
465: sed: command not found
Notice: /Stage[main]/Web_dev/Exec[configure]/returns: ./configure: line 
479: sed: command not found
Notice: /Stage[main]/Web_dev/Exec[configure]/returns: : error: cannot 
create .lineno; rerun with a POSIX shell
Error: ./configure returned 1 instead of one of [0]
Error: /Stage[main]/Web_dev/Exec[configure]/returns: change from notrun to 
0 failed: ./configure returned 1 instead of one of [0]

Anyone did this or knows whats wrong ?

Thanks,
Magic.

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



Re: [Puppet Users] Puppet and installing packages from source

2013-01-02 Thread magic . rh
Thanks for the reply Matt and Jesse,

I accept the reasons (Matt) mentioned for not using source files.
I guess the 1st reason I didn't go with rolling up my own .deb fie is that 
I lack the knowledge to do so, and I'm under a tight schedule for this 
project so I thought to stick with what I know.
The 2nd reason is that I could not believe that Puppet does not support 
working with source files with a built in mechanism (provider), digging 
through documentation I realized it does not provide any means to handle 
source.

I guess I wanted to emulate my current installation method which mixes both 
apt and compiling packages.

I fixed the configure part with adding the path to the binaries mentioned 
in the error (/bin, /usr/bin).

Thanks for all the help,
Magic.

On Wednesday, January 2, 2013 1:36:29 PM UTC+2, Matthew Burgess wrote:
>
> On Wed, Jan 2, 2013 at 9:32 AM,  > wrote: 
> > Hello Everyone, 
> > 
> > I'm looking for a way to install packages from source via puppet, I was 
> able 
> > to locate maybe 5 posts on this subject which is very strange, as I 
> would 
> > expect people to still use ./configure with their own customized 
> options. 
> > For example, I need to compile Curl with c-ares support, for that I need 
> to 
> > set an option for ./configure but can't find a way to do it. 
>
> I'll get to your actual errors in a moment, but first, I have to ask 
> 'why'? 
>
> Compiling everything from source on every host just seems really 
> inefficient.  It also will require a compiler and other development 
> tools on all servers, which isn't generally recommended in a 
> production environment. 
>
> What is preventing you from compiling your special flavour of Curl on 
> a development box, and packaging it up using your operating system's 
> native package management tools (.deb, .rpm, etc.)?  Then you can use 
> puppet to manage the package, rather than as a glorified script 
> execution mechanism. 
>
> > Debug: Exec[configure](provider=posix): Executing './configure' 
> > Debug: Executing './configure' 
> > Notice: /Stage[main]/Web_dev/Exec[configure]/returns: ./configure: 1: 
> > ./configure: expr: not found 
> > Notice: /Stage[main]/Web_dev/Exec[configure]/returns: ./configure: 1: 
> > ./configure: expr: not found 
> > Notice: /Stage[main]/Web_dev/Exec[configure]/returns: ./configure: 95: 
> > ./configure: as_fn_error: not found 
> > Notice: /Stage[main]/Web_dev/Exec[configure]/returns: ./configure: line 
> 83: 
> > expr: command not found 
> > Notice: /Stage[main]/Web_dev/Exec[configure]/returns: ./configure: line 
> 90: 
> > expr: command not found 
> > Notice: /Stage[main]/Web_dev/Exec[configure]/returns: ./configure: line 
> 95: 
> > as_fn_error: command not found 
> > Notice: /Stage[main]/Web_dev/Exec[configure]/returns: ./configure: line 
> 465: 
> > sed: command not found 
> > Notice: /Stage[main]/Web_dev/Exec[configure]/returns: ./configure: line 
> 464: 
> > expr: command not found 
> > Notice: /Stage[main]/Web_dev/Exec[configure]/returns: ./configure: line 
> 465: 
> > sed: command not found 
> > Notice: /Stage[main]/Web_dev/Exec[configure]/returns: ./configure: line 
> 479: 
> > sed: command not found 
> > Notice: /Stage[main]/Web_dev/Exec[configure]/returns: : error: cannot 
> create 
> > .lineno; rerun with a POSIX shell 
> > Error: ./configure returned 1 instead of one of [0] 
> > Error: /Stage[main]/Web_dev/Exec[configure]/returns: change from notrun 
> to 0 
> > failed: ./configure returned 1 instead of one of [0] 
> > 
> > Anyone did this or knows whats wrong ? 
>
> Yes, the environment that puppet runs 'exec' statements under is 
> restricted.  You need to set the 'path' parameter to include all the 
> paths in which those 'missing' executables can be found.  See 
> http://docs.puppetlabs.com/references/3.0.latest/type.html#exec. 
>
> Regards, 
>
> Matt. 
>

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