puppet apt class - adding a APT source with GPG key

asked 2017-01-27 08:50:47 -0600

ankh2054 gravatar image

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

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"]
edit retag flag offensive close merge delete

Comments

1

Boy, you gotta refresh your regexp skills. It clearly reads, that it accepts strings of 8, 16, or 40 hexadecimal figures. Your id is just 39 characters long.

Kai Burghardt gravatar imageKai Burghardt ( 2017-01-27 09:51:36 -0600 )edit

oops 🙊 thank you

ankh2054 gravatar imageankh2054 ( 2017-01-28 03:47:48 -0600 )edit