5

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?

delete
  • 18,144
  • 15
  • 48
  • 79

1 Answers1

1

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'
}
Anshu Prateek
  • 3,011
  • 1
  • 18
  • 33
  • In the manifestfile, it gives an error: Error: validate_re(): "dotdeb" does not match ["\\A(0x)?[0-9a-fA-F]{8}\\Z", "\\A(0x)?[0-9a-fA-F]{16}\\Z", "\\A(0x)?[0-9a-fA-F]{40}\\Z"] – delete Mar 15 '16 at 09:37
  • @AnshuPrateek How do I get the HEXKEYID? and also the "id =>" – anudeep Jan 22 '17 at 12:49
  • @AnshuPrateek I also am curious on how to obtain the hex id of a key. – Elliot Huffman Feb 28 '17 at 14:14
  • 2
    @anudeep You can use the apt-key list to find the name of the key (thats the key id in hex). – Anshu Prateek Mar 01 '17 at 03:34
  • @ElliotLabs comments allow only one user mention, see above. – Anshu Prateek Mar 01 '17 at 03:35
  • One way to get the HexKeyID in the 0xlong format is to use the following command with the keyfile `gpg --keyid-format 0xlong --verbose --dry-run --import KEYFILE` The output will contain a string in the format that matches the required, `["\\A(0x)?[0-9a-fA-F]{8}\\Z", "\\A(0x)?[0-9a-fA-F]{16}\\Z", "\\A(0x)?[0-9a-fA-F]{40}\\Z"]` that passes validation. – garg Aug 02 '22 at 17:05