Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

missing /etc/pki directory #393

Closed
hboetes opened this issue Oct 27, 2017 · 3 comments
Closed

missing /etc/pki directory #393

hboetes opened this issue Oct 27, 2017 · 3 comments

Comments

@hboetes
Copy link

hboetes commented Oct 27, 2017

On my system /etc/pki is not available, therefore this patch. I'm not entirely sure this is the best possible fix.

diff --git a/puppetlabs/code/modules/icinga2/manifests/repo.pp b/puppetlabs/code/modules/icinga2/manifests/repo.pp
index acfbfa3..315fd74 100644
--- a/puppetlabs/code/modules/icinga2/manifests/repo.pp
+++ b/puppetlabs/code/modules/icinga2/manifests/repo.pp
@@ -75,6 +75,10 @@ class icinga2::repo {
       }
       'suse': {

+        file { '/etc/pki/':
+          ensure => directory,
+        }
+        ->
         file { '/etc/pki/GPG-KEY-icinga':
           ensure => present,
           source => 'http://packages.icinga.com/icinga.key',

@lbetz
Copy link
Contributor

lbetz commented Oct 27, 2017

Hm, interesting. But we can't manage resource from outside of our module. That means /etc/pki doesn't belong to the Icinga application.

As workaround handle the directory before the icinga2 module, i.e.

file { '/etc/pki':
ensure => directory,
}
-> class { 'icinga2':
manage_repo => true,
}

@baurmatt
Copy link
Contributor

baurmatt commented Nov 2, 2017

I've implemented a workaround for this problem a couple of years ago into puppet-logstash:

https://github.com/elastic/puppet-logstash/blob/18c285fa8feb1c84643d7bd1b5cc83a101fdc52e/manifests/repo.pp#L66-L73

      # Workaround until zypprepo allows the adding of the keys
      # https://github.com/deadpoint/puppet-zypprepo/issues/4
      exec { 'logstash_suse_import_gpg':
        command => "wget -q -O /tmp/RPM-GPG-KEY-elasticsearch ${gpg_key_url}; \
                    rpm --import /tmp/RPM-GPG-KEY-elasticsearch; \
                    rm /tmp/RPM-GPG-KEY-elasticsearch",
        unless  => "test $(rpm -qa gpg-pubkey | grep -i \"${gpg_key_id}\" | wc -l) -eq 1 ",
      }

This completely removes the need to download the GPG key fo /etc/pki.

@lbetz
Copy link
Contributor

lbetz commented Nov 13, 2017

related to #397

@lbetz lbetz closed this as completed Nov 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants