Newbie question about installing custom software

Hello,

I’ve just started evaluating Chef - so this may be something that’s already
covered in the documentation. However, I’ve not been able to find it - so
asking here.

I’ve a set of custom software packages (let’s say that can be downloaded from a
certain location on Amazon S3) which I want to install as part of my automated
machine setup. These are not available as part of any Linux distro’s standard
repository, so apt-get/yum won’t work.

What is the fastest way to get this working? As I see it, it boils down to
running a custom script. How easy or how hard is it to do in Chef?

  • H

I will just download every package with remote_file resource and then
use package resource to install the packages on the machines, you can
specify in package_name attribute the location of the package in the
filesystem.

Hope it helps.

Jacobo García López de Araujo
blog: http://robotplaysguitar.com
http://workingwithrails.com/person/13395-jacobo-garc-a

On Fri, Mar 11, 2011 at 2:36 PM, talonx@gmail.com wrote:

Hello,

I've just started evaluating Chef - so this may be something that's already
covered in the documentation. However, I've not been able to find it - so
asking here.

I've a set of custom software packages (let's say that can be downloaded from a
certain location on Amazon S3) which I want to install as part of my automated
machine setup. These are not available as part of any Linux distro's standard
repository, so apt-get/yum won't work.

What is the fastest way to get this working? As I see it, it boils down to
running a custom script. How easy or how hard is it to do in Chef?

  • H

We do something similar. You can take a look at my cookbook here.

On Fri, Mar 11, 2011 at 8:36 AM, talonx@gmail.com wrote:

Hello,

I've just started evaluating Chef - so this may be something that's already
covered in the documentation. However, I've not been able to find it - so
asking here.

I've a set of custom software packages (let's say that can be downloaded from a
certain location on Amazon S3) which I want to install as part of my automated
machine setup. These are not available as part of any Linux distro's standard
repository, so apt-get/yum won't work.

What is the fastest way to get this working? As I see it, it boils down to
running a custom script. How easy or how hard is it to do in Chef?

  • H

I have a "cookbook_rpms" recipe I use for the purpose. Note that, as it uses
yum localinstall, it requires that your packages need to be signed (but this
is trivial -- you can just do find . -name '*.rpm' -exec rpm --addsign {} +
to sign everything in your repo, once you've set up a key pair).

See

On Fri, Mar 11, 2011 at 7:36 AM, talonx@gmail.com wrote:

Hello,

I've just started evaluating Chef - so this may be something that's already
covered in the documentation. However, I've not been able to find it - so
asking here.

I've a set of custom software packages (let's say that can be downloaded
from a
certain location on Amazon S3) which I want to install as part of my
automated
machine setup. These are not available as part of any Linux distro's
standard
repository, so apt-get/yum won't work.

What is the fastest way to get this working? As I see it, it boils down to
running a custom script. How easy or how hard is it to do in Chef?

  • H

That's pretty interesting. I wanted to avoid standing up a dedicated
yum server for our handful of packages so I stuck them in a yum like
structure in s3 and they get synced down to the clients using s3cmd
sync as part of recipes (as well as a daily cronjob)

This installs the base repo files and does some cleanup on repos that
were added before I got here.

So basically each server has a copy of our packages on the EC2 /mnt
volume. I just build them locally in a VM for each arch.

On Fri, Mar 11, 2011 at 11:57 AM, Charles Duffy charles@dyfis.net wrote:

I have a "cookbook_rpms" recipe I use for the purpose. Note that, as it uses
yum localinstall, it requires that your packages need to be signed (but this
is trivial -- you can just do find . -name '*.rpm' -exec rpm --addsign {} +
to sign everything in your repo, once you've set up a key pair).
See tippr-public-cookbooks/cookbook_rpms at master · Tippr/tippr-public-cookbooks · GitHub

On Fri, Mar 11, 2011 at 7:36 AM, talonx@gmail.com wrote:

Hello,

I've just started evaluating Chef - so this may be something that's
already
covered in the documentation. However, I've not been able to find it - so
asking here.

I've a set of custom software packages (let's say that can be downloaded
from a
certain location on Amazon S3) which I want to install as part of my
automated
machine setup. These are not available as part of any Linux distro's
standard
repository, so apt-get/yum won't work.

What is the fastest way to get this working? As I see it, it boils down to
running a custom script. How easy or how hard is it to do in Chef?

  • H

Thank you all for the responses and apologies for the late reply. The
packages I am installing are not RPMs or any standard installers. As I
mentioned, they're .jar or zip files that have custom installation
processes. Anyways, I'll see if I can modify your approaches to suit my
requirements.

Thanks!

  • H

On 11 March 2011 22:42, John E. Vincent (lusis) <lusis.org+
chef-list@gmail.com> wrote:

That's pretty interesting. I wanted to avoid standing up a dedicated
yum server for our handful of packages so I stuck them in a yum like
structure in s3 and they get synced down to the clients using s3cmd
sync as part of recipes (as well as a daily cronjob)

yum-repos-recipe.rb · GitHub

This installs the base repo files and does some cleanup on repos that
were added before I got here.

So basically each server has a copy of our packages on the EC2 /mnt
volume. I just build them locally in a VM for each arch.

On Fri, Mar 11, 2011 at 11:57 AM, Charles Duffy charles@dyfis.net wrote:

I have a "cookbook_rpms" recipe I use for the purpose. Note that, as it
uses
yum localinstall, it requires that your packages need to be signed (but
this
is trivial -- you can just do find . -name '*.rpm' -exec rpm --addsign {}

to sign everything in your repo, once you've set up a key pair).
See
tippr-public-cookbooks/cookbook_rpms at master · Tippr/tippr-public-cookbooks · GitHub

On Fri, Mar 11, 2011 at 7:36 AM, talonx@gmail.com wrote:

Hello,

I've just started evaluating Chef - so this may be something that's
already
covered in the documentation. However, I've not been able to find it -
so
asking here.

I've a set of custom software packages (let's say that can be downloaded
from a
certain location on Amazon S3) which I want to install as part of my
automated
machine setup. These are not available as part of any Linux distro's
standard
repository, so apt-get/yum won't work.

What is the fastest way to get this working? As I see it, it boils down
to
running a custom script. How easy or how hard is it to do in Chef?

  • H

Here's a fragment from a recipe that installs nginx from source:

nginx = "nginx-#{node[:evite][:nginx_version]}"
nginx_pkg = "#{nginx}.tar.gz"
nginx_upstream = "nginx-upstream-fair.tar.gz"
nginx_upload = "nginx_upload_module-2.2.0.tar.gz"

downloads = [
"#{nginx_pkg}",
"#{nginx_upstream}",
"#{nginx_upload}",
]

downloads.each do |file|
remote_file "/tmp/#{file}" do
source "http://my.site.com/download/nginx/#{file}"
end
end

script "install_nginx_from_src" do
interpreter "bash"
user "root"
cwd "/tmp"
not_if "test -f /usr/local/nginx/conf/nginx.conf"
code <<-EOH
tar xvfz #{nginx_upstream}
tar xvfz #{nginx_upload}
tar xvfz #{nginx_pkg}
cd #{nginx}
./configure --with-http_ssl_module --with-http_stub_status_module
--add-module=/tmp/nginx-upstream-fair/
--add-module=/tmp/nginx_upload_module-2.2.0/; make; make install
EOH
end

(we also have this attribute in cookbooks/evite/attributes/default.rb:
default[:evite][:nginx_version] = '0.8.20')

HTH

Grig

On Tue, Mar 15, 2011 at 9:30 PM, Hrishikesh Barua talonx@gmail.com wrote:

Thank you all for the responses and apologies for the late reply. The
packages I am installing are not RPMs or any standard installers. As I
mentioned, they're .jar or zip files that have custom installation
processes. Anyways, I'll see if I can modify your approaches to suit my
requirements.

Thanks!

  • H

On 11 March 2011 22:42, John E. Vincent (lusis)
lusis.org+chef-list@gmail.com wrote:

That's pretty interesting. I wanted to avoid standing up a dedicated
yum server for our handful of packages so I stuck them in a yum like
structure in s3 and they get synced down to the clients using s3cmd
sync as part of recipes (as well as a daily cronjob)

yum-repos-recipe.rb · GitHub

This installs the base repo files and does some cleanup on repos that
were added before I got here.

So basically each server has a copy of our packages on the EC2 /mnt
volume. I just build them locally in a VM for each arch.

On Fri, Mar 11, 2011 at 11:57 AM, Charles Duffy charles@dyfis.net wrote:

I have a "cookbook_rpms" recipe I use for the purpose. Note that, as it
uses
yum localinstall, it requires that your packages need to be signed (but
this
is trivial -- you can just do find . -name '*.rpm' -exec rpm --addsign
{} +
to sign everything in your repo, once you've set up a key pair).

See tippr-public-cookbooks/cookbook_rpms at master · Tippr/tippr-public-cookbooks · GitHub

On Fri, Mar 11, 2011 at 7:36 AM, talonx@gmail.com wrote:

Hello,

I've just started evaluating Chef - so this may be something that's
already
covered in the documentation. However, I've not been able to find it -
so
asking here.

I've a set of custom software packages (let's say that can be
downloaded
from a
certain location on Amazon S3) which I want to install as part of my
automated
machine setup. These are not available as part of any Linux distro's
standard
repository, so apt-get/yum won't work.

What is the fastest way to get this working? As I see it, it boils down
to
running a custom script. How easy or how hard is it to do in Chef?

  • H

Thanks a lot Grig - that does help.

On 16 March 2011 21:57, Grig Gheorghiu grig.gheorghiu@gmail.com wrote:

Here's a fragment from a recipe that installs nginx from source:

nginx = "nginx-#{node[:evite][:nginx_version]}"
nginx_pkg = "#{nginx}.tar.gz"
nginx_upstream = "nginx-upstream-fair.tar.gz"
nginx_upload = "nginx_upload_module-2.2.0.tar.gz"

downloads = [
"#{nginx_pkg}",
"#{nginx_upstream}",
"#{nginx_upload}",
]

downloads.each do |file|
remote_file "/tmp/#{file}" do
source "http://my.site.com/download/nginx/#{file}"
end
end

script "install_nginx_from_src" do
interpreter "bash"
user "root"
cwd "/tmp"
not_if "test -f /usr/local/nginx/conf/nginx.conf"
code <<-EOH
tar xvfz #{nginx_upstream}
tar xvfz #{nginx_upload}
tar xvfz #{nginx_pkg}
cd #{nginx}
./configure --with-http_ssl_module --with-http_stub_status_module
--add-module=/tmp/nginx-upstream-fair/
--add-module=/tmp/nginx_upload_module-2.2.0/; make; make install
EOH
end

(we also have this attribute in cookbooks/evite/attributes/default.rb:
default[:evite][:nginx_version] = '0.8.20')

HTH

Grig

On Tue, Mar 15, 2011 at 9:30 PM, Hrishikesh Barua talonx@gmail.com
wrote:

Thank you all for the responses and apologies for the late reply. The
packages I am installing are not RPMs or any standard installers. As I
mentioned, they're .jar or zip files that have custom installation
processes. Anyways, I'll see if I can modify your approaches to suit my
requirements.

Thanks!

  • H

On 11 March 2011 22:42, John E. Vincent (lusis)
lusis.org+chef-list@gmail.com wrote:

That's pretty interesting. I wanted to avoid standing up a dedicated
yum server for our handful of packages so I stuck them in a yum like
structure in s3 and they get synced down to the clients using s3cmd
sync as part of recipes (as well as a daily cronjob)

yum-repos-recipe.rb · GitHub

This installs the base repo files and does some cleanup on repos that
were added before I got here.

So basically each server has a copy of our packages on the EC2 /mnt
volume. I just build them locally in a VM for each arch.

On Fri, Mar 11, 2011 at 11:57 AM, Charles Duffy charles@dyfis.net
wrote:

I have a "cookbook_rpms" recipe I use for the purpose. Note that, as
it
uses
yum localinstall, it requires that your packages need to be signed
(but
this
is trivial -- you can just do find . -name '*.rpm' -exec rpm --addsign
{} +
to sign everything in your repo, once you've set up a key pair).

See
tippr-public-cookbooks/cookbook_rpms at master · Tippr/tippr-public-cookbooks · GitHub

On Fri, Mar 11, 2011 at 7:36 AM, talonx@gmail.com wrote:

Hello,

I've just started evaluating Chef - so this may be something that's
already
covered in the documentation. However, I've not been able to find it

so
asking here.

I've a set of custom software packages (let's say that can be
downloaded
from a
certain location on Amazon S3) which I want to install as part of my
automated
machine setup. These are not available as part of any Linux distro's
standard
repository, so apt-get/yum won't work.

What is the fastest way to get this working? As I see it, it boils
down
to
running a custom script. How easy or how hard is it to do in Chef?

  • H