Browse Source

Update to install gpgme, and to not pass packages as parameters if it's not going to override them.

Includes tests.
master
Aaron Hicks 6 years ago
parent
commit
065e9d95b6
6 changed files with 22 additions and 10 deletions
  1. 4
    0
      README.markdown
  2. 1
    3
      manifests/init.pp
  3. 10
    4
      manifests/install.pp
  4. 3
    1
      manifests/params.pp
  5. 2
    0
      spec/classes/gpg_spec.rb
  6. 2
    2
      spec/classes/install_spec.rb

+ 4
- 0
README.markdown View File

@@ -8,6 +8,10 @@ This is a Puppet module for handing GPG keys.

Update your license details here.

# References

* https://github.com/crayfishx/puppet-gpg used for creation of GPG keys with gpgme

# Attribution

This module is derived from the puppet-blank module by Aaron Hicks (aethylred@gmail.com)

+ 1
- 3
manifests/init.pp View File

@@ -33,8 +33,6 @@ class gpg (

# Parameter sanity checks here

class{'gpg::install':
package => $gpg::params::package
}
class{'gpg::install': }

}

+ 10
- 4
manifests/install.pp View File

@@ -1,7 +1,13 @@
class gpg::install (
$package
){
package{$package:
class gpg::install {

package{$gpg::params::package:
ensure => installed
}

package { $gpg::params::gpgme_package:
ensure => 'installed',
provider => $gpg::params::pgme_provider,
require => Package[$gpg::params::package]
}

}

+ 3
- 1
manifests/params.pp View File

@@ -2,7 +2,9 @@ class gpg::params {

case $::osfamily {
'Debian', 'RedHat':{
$package = 'gnupg'
$package = 'gnupg'
$gpgme_package = 'gpgme'
$gpgme_provider = 'gem'
}
default: {
fail("The operating system family ${::osfamily} is not supported by the puppet-gpg module on ${::fqdn}")

+ 2
- 0
spec/classes/gpg_spec.rb View File

@@ -9,6 +9,7 @@ describe 'gpg', :type => :class do
end
it { should create_class("gpg::install") }
it { should contain_package("gnupg") }
it { should contain_package("gpgme") }
end

context "on a RedHat OS" do
@@ -19,5 +20,6 @@ describe 'gpg', :type => :class do
end
it { should create_class("gpg::install") }
it { should contain_package("gnupg") }
it { should contain_package("gpgme") }
end
end

+ 2
- 2
spec/classes/install_spec.rb View File

@@ -7,8 +7,8 @@ describe 'gpg::install', :type => :class do
:osfamily => 'Debian'
}
end
let(:params) { {:package => 'gnupg'} }
it { should contain_package("gnupg") }
it { should contain_package("gpgme") }
end

context "on a RedHat OS" do
@@ -17,7 +17,7 @@ describe 'gpg::install', :type => :class do
:osfamily => 'RedHat'
}
end
let(:params) { {:package => 'gnupg'} }
it { should contain_package("gnupg") }
it { should contain_package("gpgme") }
end
end

Loading…
Cancel
Save