-hkps_ubuntu_pp = <<-MANIFEST
- apt_key { 'puppetlabs':
- id => '#{PUPPETLABS_GPG_KEY_LONG_ID}',
- ensure => 'present',
- server => 'hkps://keyserver.ubuntu.com',
- }
- MANIFEST
+if fact('operatingsystem') =~ %r{Ubuntu} and fact('operatingsystemrelease') =~ %r{^18\.04}
+ hkps_protocol_supported = true
+else
+ hkps_protocol_supported = false
+end
+
+if hkps_protocol_supported
+ hkps_ubuntu_pp = <<-MANIFEST
+ apt_key { 'puppetlabs':
+ id => '#{PUPPETLABS_GPG_KEY_LONG_ID}',
+ ensure => 'present',
+ server => 'hkps://keyserver.ubuntu.com',
+ }
+ MANIFEST
+end