Friday, January 26, 2024

[SOLVED] How to add apt-keys with puppet?

Issue

Using this puppet-module for apt, how can i import this key:

https://www.dotdeb.org/dotdeb.gpg 

What i want to achieve is a puppet-related solution for both shell commands:

wget https://www.dotdeb.org/dotdeb.gpg
apt-key add dotdeb.gpg 

The documentation of this puppet-modul isn't clear about this. How to do this?


Solution

You have to use apt::key

https://github.com/puppetlabs/puppetlabs-apt/blob/master/manifests/key.pp

something like this in your hiera -

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

https://ask.puppetlabs.com/question/4845/add-key-with-puppetlabs-apt/

or in your puppet manifest file -

apt::key {'HEXKEYID':
  source => 'https://www.dotdeb.org/dotdeb.gpg',
  id     => 'ID_OF_YOUR_KEY'
}


Answered By - Anshu Prateek
Answer Checked By - Gilberto Lyons (WPSolving Admin)