Ask Your Question
0

add key with puppetlabs-apt

asked 2014-01-16 14:08:03 -0500

Thynan gravatar image

updated 2014-01-17 02:20:03 -0500

Hi!

I want to install varnish on ubuntu with this package: puppet module: https://forge.puppetlabs.com/netmanagers/varnish .

But I don't want to use the standard ubuntu package. Instead I want to install the package provided from varnish-cache.org .

According to their website i have to do the following:

1. curl http://repo.varnish-cache.org/debian/GPG-key.txt | sudo apt-key add -
2. echo "deb http://repo.varnish-cache.org/ubuntu/ precise varnish-3.0" | sudo tee -a /etc/apt/sources.list
3. sudo apt-get update
4. sudo apt-get install varnish

But how do I do that with the puppetlabs/apt ... (more)

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2014-01-17 04:47:54 -0500

Thynan gravatar image

Ok, I figured it out:

I added this (in hiera)

apt::sources:
    varnish-3.0:
        location: http://repo.varnish-cache.org/ubuntu/
        release: %{::lsbdistcodename}
        repos: varnish-3.0

  apt::keys:
      varnish-3.0:
        key: C4DEFFEB
        key_source: http://repo.varnish-cache.org/debian/GPG-key.txt

They "key:" attribute can really be anything, however, when i named it "varnish-3.0", the key was added every puppet run, because the unless of the apt::key execute didn't find the already added key. So I did an "apt-key list" and copied the name of the key (C4DEFEB). This is discussed here: https://groups.google.com/forum/#!topic/puppet-users/jDeSFdNLeYA

edit flag offensive delete link more
1

answered 2014-01-16 16:54:03 -0500

lavaman gravatar image

The key parameter is simply the name of the key, which defaults to the title (in your case, varnish-3.0). You don't have to specify the key parameter at all. key_source is sufficient.

edit flag offensive delete link more

Comments

Ok, thanks! Do you also know how i can handle the second command? (echo "deb http://repo.varnish-cache.org....."?

Thynan gravatar imageThynan ( 2014-01-17 02:21:45 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2014-01-16 14:08:03 -0500

Seen: 3,818 times

Last updated: Jan 17 '14