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

Parameters for apt GPG key ID and GPG key source #199

Merged
merged 2 commits into from Jul 12, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 10 additions & 0 deletions manifests/init.pp
Expand Up @@ -22,6 +22,14 @@
# [*repo_source*]
# String. Location of the yum/apt repo. Overrides the default location
# Default: undef

# [*repo_key_id*]
# String. The apt GPG key id
# Default: 7580C77F
#
# [*repo_key_source*]
# String. URL of the apt GPG key
# Default: http://repos.sensuapp.org/apt/pubkey.gpg
#
# [*client*]
# Boolean. Include the sensu client
Expand Down Expand Up @@ -175,6 +183,8 @@
$install_repo = true,
$repo = 'main',
$repo_source = undef,
$repo_key_id = '7580C77F',
$repo_key_source = 'http://repos.sensuapp.org/apt/pubkey.gpg',
$client = true,
$server = false,
$api = false,
Expand Down
5 changes: 3 additions & 2 deletions manifests/repo/apt.pp
Expand Up @@ -22,10 +22,11 @@
} else {
$url = 'http://repos.sensuapp.org/apt'
}

if $ensure == 'present' {
apt::key { 'sensu':
key => '7580C77F',
key_source => 'http://repos.sensuapp.org/apt/pubkey.gpg',
key => $sensu::repo_key_id,
key_source => $sensu::repo_key_source,
}
}
apt::source { 'sensu':
Expand Down
9 changes: 9 additions & 0 deletions spec/classes/sensu_package_spec.rb
Expand Up @@ -68,6 +68,15 @@
) }
end

context 'override key ID and key source' do
let(:params) { { :repo_key_id => 'FFFFFFFF', :repo_key_source => 'http://repo.mydomina.com/apt/pubkey.gpg' } }

it { should_not contain_apt__key('sensu').with(
:key => 'FFFFFFFF',
:key_source => 'http://repo.mydomain.com/apt/pubkey.gpg'
) }
end

context 'install_repo => false' do
let(:params) { { :install_repo => false, :repo => 'main' } }
it { should contain_apt__source('sensu').with_ensure('absent') }
Expand Down