1

I'm using the module: https://github.com/puppetlabs/puppetlabs-apt

I configured the below class to create an additional APT source and add the GPG key.

class filebeats_apt {

    apt::source { 'Filebeats':
      comment  => 'Filebeats',
      location => 'https://packages.elastic.co/beats/apt',
      release  => 'stable',
      repos    => 'main',
      key      => {
        'server' => 'https://packages.elastic.co/GPG-KEY-elasticsearch',
        'id'     => '30239CC130E1A7FD81A27B140976EAF437D05B5',
      },
      include  => {
        'src' => true,
        'deb' => true,
      },
    }
}

Im referencing the class in my main manifest as following:

# Puppetpal
node 'puppetpal' {
 include filebeats_apt
}

I keep getting the following error:

Error while evaluating a Resource Statement, 
Evaluation Error: Error while evaluating a Function Call, validate_re():

 "30239CC130E1A7FD81A27B140976EAF437D05B5" 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"]
1

The ID you posted is only 39 character long, but has to be either 8, 16 or 40 characters long. I guess you forgot to copy one character.

As a sidenote:

key      => {
    'server' => 'https://packages.elastic.co/GPG-KEY-elasticsearch',
    'id'     => '30239CC130E1A7FD81A27B140976EAF437D05B5',
},

server and id do not require quotation marks.

  • thanks and now I get this: Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Error while evaluating a Function Call, validate_re(): "packages.elastic.co/GPG-KEY-elasticsearch" does not match ["\\A((hkp|http|https):\\/\\/)?([a-z\\d])([a-z\\d-]{0,61}\\.)+[a-z\\d]+(:\\d{2,5})?$"] – Ankh2054 Jan 27 '17 at 15:25
  • As you can see from the regex, the URL has to start with either hkp://, http:// or https:// – mzhaase Jan 27 '17 at 15:27
  • yeah strange as that's whats configured. removing https:// makes it work – Ankh2054 Jan 27 '17 at 15:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.