diff --git a/manifests/ubuntu/install_key.pp b/manifests/ubuntu/install_key.pp index dea9afc3..902a72bf 100644 --- a/manifests/ubuntu/install_key.pp +++ b/manifests/ubuntu/install_key.pp @@ -13,8 +13,10 @@ # # define datadog_agent::ubuntu::install_key() { + $shortkey = regsubst($name, '.*(.{8})$', '\1') + exec { "key ${name}": command => "/usr/bin/apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys ${name}", - unless => "/usr/bin/apt-key list | grep ${name} | grep expires", + unless => "/usr/bin/apt-key list | grep ${shortkey} | grep expires", } }