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

Change EL7 package and command to certbot #35

Merged
merged 1 commit into from
Jun 1, 2016
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,29 @@

if $::operatingsystem == 'Debian' and versioncmp($::operatingsystemrelease, '9') >= 0 {
$install_method = 'package'
$package_name = 'letsencrypt'
$package_command = 'letsencrypt'
} elsif $::operatingsystem == 'Ubuntu' and versioncmp($::operatingsystemrelease, '16.04') >= 0 {
$install_method = 'package'
$package_name = 'letsencrypt'
$package_command = 'letsencrypt'
} elsif $::osfamily == 'RedHat' and versioncmp($::operatingsystemmajrelease, '7') >= 0 {
$install_method = 'package'
$package_name = 'certbot'
$package_command = 'certbot'
} elsif $::osfamily == 'Gentoo' {
$install_method = 'package'
$package_name = 'app-crypt/certbot'
$package_command = 'certbot'
} else {
$install_method = 'vcs'
$package_name = 'letsencrypt'
$package_command = 'letsencrypt'
}

if $::osfamily == 'RedHat' {
$configure_epel = true
} else {
$configure_epel = false
}

if $::osfamily == 'Gentoo' {
$package_name = 'app-crypt/certbot'
$package_command = 'certbot'
} else {
$package_name = 'letsencrypt'
$package_command = 'letsencrypt'
}
}
4 changes: 3 additions & 1 deletion spec/classes/letsencrypt_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
end

describe 'with install_method => package' do
let(:additional_params) { { install_method: 'package' } }
let(:additional_params) { { install_method: 'package', package_command: 'letsencrypt' } }
it { is_expected.to contain_class('letsencrypt::install').with_install_method('package') }
it { is_expected.to contain_exec('initialize letsencrypt').with_command('letsencrypt -h') }
end
Expand Down Expand Up @@ -142,6 +142,8 @@
it 'should contain the correct resources' do
is_expected.to contain_class('epel').that_comes_before('Package[letsencrypt]')
is_expected.to contain_class('letsencrypt::install').with(install_method: 'package')
is_expected.to contain_class('letsencrypt').with(package_command: 'certbot')
is_expected.to contain_package('letsencrypt').with(name: 'certbot')
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/defines/letsencrypt_certonly_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{'Debian' => '9.0', 'Ubuntu' => '16.04', 'RedHat' => '7.2'}.each do |osfamily, osversion|
context "on #{osfamily} based operating systems" do
let(:facts) { { osfamily: osfamily, operatingsystem: osfamily, operatingsystemrelease: osversion, operatingsystemmajrelease: osversion.split('.').first, path: '/usr/bin' } }
let(:pre_condition) { "class { letsencrypt: email => '[email protected]' }" }
let(:pre_condition) { "class { letsencrypt: email => '[email protected]', package_command => 'letsencrypt' }" }

context 'with a single domain' do
let(:title) { 'foo.example.com' }
Expand Down