forked from voxpupuli/puppet-letsencrypt
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This has been stuck on an old version and so far nobody has updated it to a recent version that actually works. Distribution packages just work.
- Loading branch information
Showing
11 changed files
with
56 additions
and
240 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,21 @@ | ||
# @summary Installs the Let's Encrypt client. | ||
# | ||
# @param manage_install A feature flag to toggle the management of the letsencrypt client installation. | ||
# @param manage_dependencies A feature flag to toggle the management of the letsencrypt dependencies. | ||
# @param configure_epel A feature flag to include the 'epel' class and depend on it for package installation. | ||
# @param install_method Method to install the letsencrypt client | ||
# @param path The path to the letsencrypt installation. | ||
# @param repo A Git URL to install the Let's encrypt client from. | ||
# @param version The Git ref (tag, sha, branch) to check out when installing the client with the `vcs` method. | ||
# @param package_ensure The value passed to `ensure` when installing the client with the `package` method. | ||
# @param package_name Name of package to use when installing the client with the `package` method. | ||
# | ||
class letsencrypt::install ( | ||
Boolean $manage_install = $letsencrypt::manage_install, | ||
Boolean $manage_dependencies = $letsencrypt::manage_dependencies, | ||
Boolean $configure_epel = $letsencrypt::configure_epel, | ||
Enum['package', 'vcs'] $install_method = $letsencrypt::install_method, | ||
String $package_name = $letsencrypt::package_name, | ||
String $package_ensure = $letsencrypt::package_ensure, | ||
String $path = $letsencrypt::path, | ||
String $repo = $letsencrypt::repo, | ||
String $version = $letsencrypt::version, | ||
) { | ||
if $install_method == 'vcs' { | ||
if $manage_dependencies { | ||
$dependencies = ['python', 'git'] | ||
ensure_packages($dependencies) | ||
Package[$dependencies] -> Vcsrepo[$path] | ||
} | ||
|
||
vcsrepo { $path: | ||
ensure => present, | ||
provider => git, | ||
source => $repo, | ||
revision => $version, | ||
} | ||
} else { | ||
package { 'letsencrypt': | ||
ensure => $package_ensure, | ||
name => $package_name, | ||
} | ||
package { 'letsencrypt': | ||
ensure => $package_ensure, | ||
name => $package_name, | ||
} | ||
|
||
if $configure_epel { | ||
include epel | ||
Class['epel'] -> Package['letsencrypt'] | ||
} | ||
if $configure_epel { | ||
include epel | ||
Class['epel'] -> Package['letsencrypt'] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,39 +27,4 @@ class { 'letsencrypt' : | |
its(:content) { is_expected.to match %r{email = [email protected]} } | ||
end | ||
end | ||
|
||
context 'with install_method => vcs' do | ||
pp = %( | ||
class { 'letsencrypt' : | ||
install_method => 'vcs', | ||
email => '[email protected]', | ||
config => { | ||
'server' => 'https://acme-staging-v02.api.letsencrypt.org/directory', | ||
}, | ||
} | ||
) | ||
|
||
it 'installs letsencrypt without error' do | ||
apply_manifest(pp, catch_failures: true) | ||
end | ||
it 'installs letsencrypt idempotently' do | ||
apply_manifest(pp, catch_changes: true) | ||
end | ||
|
||
describe file('/etc/letsencrypt/cli.ini') do | ||
it { is_expected.to be_file } | ||
it { is_expected.to be_owned_by 'root' } | ||
it { is_expected.to be_grouped_into 'root' } | ||
it { is_expected.to be_mode 644 } | ||
its(:content) { is_expected.to match %r{server = https://acme-staging-v02.api.letsencrypt.org/directory} } | ||
its(:content) { is_expected.to match %r{email = [email protected]} } | ||
end | ||
|
||
describe file('/opt/letsencrypt/.venv/bin/certbot') do | ||
it { is_expected.to be_file } | ||
it { is_expected.to be_owned_by 'root' } | ||
it { is_expected.to be_grouped_into 'root' } | ||
it { is_expected.to be_mode 755 } | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.