annotate modules/epel/manifests/rpm_gpg_key.pp @ 432:d05e9281909c

Remove now abandoned Strike Creations website
author IBBoard <dev@ibboard.co.uk>
date Tue, 21 Feb 2023 15:54:18 +0000
parents 66c075c5f54a
children adf6fe9bbc17
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
387
66c075c5f54a Update to newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 272
diff changeset
1 # @summary Import an RPM gpg key
272
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
2 #
387
66c075c5f54a Update to newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 272
diff changeset
3 # @api private
272
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
4 #
387
66c075c5f54a Update to newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 272
diff changeset
5 # @param path
272
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
6 # Path of the RPM GPG key to import
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
7 #
387
66c075c5f54a Update to newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 272
diff changeset
8 # @example Sample Usage
66c075c5f54a Update to newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 272
diff changeset
9 # epel::rpm_gpg_key{ 'EPEL-6':
66c075c5f54a Update to newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 272
diff changeset
10 # path => '/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6',
66c075c5f54a Update to newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 272
diff changeset
11 # }
66c075c5f54a Update to newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 272
diff changeset
12 define epel::rpm_gpg_key ($path) {
272
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
13 # Given the path to a key, see if it is imported, if not, import it
387
66c075c5f54a Update to newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 272
diff changeset
14 exec { "import-${name}":
272
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
15 path => '/bin:/usr/bin:/sbin:/usr/sbin',
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
16 command => "rpm --import ${path}",
387
66c075c5f54a Update to newer Python module
IBBoard <dev@ibboard.co.uk>
parents: 272
diff changeset
17 unless => "rpm -q gpg-pubkey-$(echo $(gpg -q --batch --with-colons --throw-keyids --keyid-format short < ${path}) | grep pub | cut -d ':' -f 5 | cut --characters=9- | tr '[A-Z]' '[a-z]')",
272
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
18 require => File[$path],
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
19 logoutput => 'on_failure',
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
20 }
c42fb28cff86 Update to a newer Python module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
21 }