Ask Your Question

Convert `apt-key add` with gpg for use with `apt` module

asked 2018-05-14 15:29:38 -0600

tylerecouture gravatar image

I have some install instructions from Play on Linux:

wget -q "" -O- | sudo apt-key add -
sudo wget -O /etc/apt/sources.list.d/playonlinux.list
sudo apt-get update
sudo apt-get install playonlinux

Which I'm trying to install using puppet's apt module:

  include apt

  apt::source { 'play_on_linux_repo':
    location => '',
    repos    => 'main',
    key      => {
      'id'     => '',
      'server' => '',

  package { 'playonlinux':
    ensure => latest,

Where do I get the proper key (fingerprint?) to provide for this? The gpg link for id results in an error.

edit retag flag offensive close merge delete


Are you seriously asking how to use GPG?

Kai Burghardt gravatar imageKai Burghardt ( 2018-05-14 16:52:50 -0600 )edit

Is this forbidden or something?

tylerecouture gravatar imagetylerecouture ( 2018-05-14 17:20:31 -0600 )edit

It's kind of an odd question to ask on a Puppet Q'n'A site, isn't it.

Kai Burghardt gravatar imageKai Burghardt ( 2018-05-15 05:18:42 -0600 )edit

I have no idea... I'm just a hack trying to learn puppet. Should I move this somewhere else?

tylerecouture gravatar imagetylerecouture ( 2018-05-15 08:16:00 -0600 )edit

No worries, mate. I covered you, see?

Kai Burghardt gravatar imageKai Burghardt ( 2018-05-15 09:23:31 -0600 )edit

1 Answer

Sort by » oldest newest most voted

answered 2018-05-15 05:22:05 -0600

On a machine where you have already followed the install instructions, you can do

$ apt-key finger Play

Where “Play” is a part of the key's display name.

The fingerprint is then copied to the id attribute (without spacing), and instead of a server attribute you specify source with the full URI of the key.

edit flag offensive delete link more


Btw, your Package[playonlinux] should require => Apt::Source['play_on_linux_repo']. Both resources are apparently in the same stage.

Kai Burghardt gravatar imageKai Burghardt ( 2018-05-15 06:59:39 -0600 )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


Asked: 2018-05-14 15:29:38 -0600

Seen: 52 times

Last updated: May 15