-
Notifications
You must be signed in to change notification settings - Fork 136
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FacterDB: Switch to stringified facts
- Loading branch information
1 parent
c5b8766
commit 4bf4e47
Showing
5 changed files
with
17 additions
and
16 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,5 @@ | |
enabled_lint_checks: | ||
- parameter_documentation | ||
- parameter_types | ||
spec/spec_helper.rb: | ||
facterdb_string_keys: true |
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 |
---|---|---|
|
@@ -17,8 +17,7 @@ | |
describe 'with defaults' do | ||
it { is_expected.to compile } | ||
|
||
epel = facts[:osfamily] == 'RedHat' && facts[:operatingsystem] != 'Fedora' | ||
|
||
epel = facts['os']['family'] == 'RedHat' && facts['os']['name'] != 'Fedora' | ||
it 'contains the correct resources' do | ||
is_expected.to contain_class('letsencrypt::install'). | ||
with(configure_epel: epel). | ||
|
@@ -33,7 +32,7 @@ | |
cron_monthday: ['*']) | ||
is_expected.to contain_cron('letsencrypt-renew').with_ensure('absent') | ||
|
||
if facts[:osfamily] == 'FreeBSD' | ||
if facts['os']['family'] == 'FreeBSD' | ||
is_expected.to contain_ini_setting('/usr/local/etc/letsencrypt/cli.ini email [email protected]') | ||
is_expected.to contain_ini_setting('/usr/local/etc/letsencrypt/cli.ini server https://acme-v02.api.letsencrypt.org/directory') | ||
is_expected.to contain_file('letsencrypt-renewal-hooks-puppet'). | ||
|
@@ -50,7 +49,7 @@ | |
is_expected.to contain_file('letsencrypt-renewal-hooks-puppet').with_path('/etc/letsencrypt/renewal-hooks-puppet') | ||
end | ||
|
||
if facts[:osfamily] == 'RedHat' | ||
if facts['os']['family'] == 'RedHat' | ||
if epel | ||
is_expected.to contain_class('epel').that_comes_before('Package[letsencrypt]') | ||
else | ||
|
@@ -60,20 +59,20 @@ | |
is_expected.to contain_class('letsencrypt').with(package_command: 'certbot') | ||
is_expected.to contain_package('letsencrypt').with(name: 'certbot').with_ensure('installed') | ||
is_expected.to contain_file('/etc/letsencrypt').with(ensure: 'directory') | ||
elsif facts[:osfamily] == 'Debian' | ||
elsif facts['os']['family'] == 'Debian' | ||
is_expected.to contain_class('letsencrypt::install').with(package_name: 'certbot') | ||
is_expected.to contain_file('/etc/letsencrypt').with(ensure: 'directory') | ||
elsif facts[:operatingsystem] == 'Gentoo' | ||
elsif facts['os']['name'] == 'Gentoo' | ||
is_expected.to contain_class('letsencrypt::install').with(package_name: 'app-crypt/certbot') | ||
is_expected.to contain_class('letsencrypt').with(package_command: 'certbot') | ||
is_expected.to contain_package('letsencrypt').with(name: 'app-crypt/certbot').with_ensure('installed') | ||
is_expected.to contain_file('/etc/letsencrypt').with(ensure: 'directory') | ||
elsif facts[:operatingsystem] == 'OpenBSD' | ||
elsif facts['os']['name' == 'OpenBSD' | ||
is_expected.to contain_class('letsencrypt::install').with(package_name: 'certbot') | ||
is_expected.to contain_class('letsencrypt').with(package_command: 'certbot') | ||
is_expected.to contain_package('letsencrypt').with(name: 'certbot').with_ensure('installed') | ||
is_expected.to contain_file('/etc/letsencrypt').with(ensure: 'directory') | ||
elsif facts[:operatingsystem] == 'FreeBSD' | ||
elsif facts['os']['name' == 'FreeBSD' | ||
is_expected.to contain_class('letsencrypt::install').with(package_name: 'py39-certbot') | ||
is_expected.to contain_class('letsencrypt').with(package_command: 'certbot') | ||
is_expected.to contain_package('letsencrypt').with(name: 'py39-certbot').with_ensure('installed') | ||
|
@@ -100,7 +99,7 @@ | |
describe 'with custom config' do | ||
let(:additional_params) { { config: { 'foo' => 'bar' } } } | ||
|
||
case facts[:operatingsystem] | ||
case facts['os']['name'] | ||
when 'FreeBSD' | ||
it { is_expected.to contain_ini_setting('/usr/local/etc/letsencrypt/cli.ini foo bar') } | ||
else | ||
|
@@ -237,7 +236,7 @@ | |
|
||
it { is_expected.to compile.with_all_deps } | ||
|
||
case facts[:operatingsystem] | ||
case facts['os']['name'] | ||
when 'FreeBSD' | ||
it { is_expected.to contain_ini_setting('/usr/local/etc/letsencrypt/cli.ini email [email protected]') } | ||
else | ||
|
@@ -253,7 +252,7 @@ | |
context 'with unsafe_registration set to true' do | ||
let(:params) { { unsafe_registration: true } } | ||
|
||
case facts[:operatingsystem] | ||
case facts['os']['name'] | ||
when 'FreeBSD' | ||
it { is_expected.not_to contain_ini_setting('/usr/local/etc/letsencrypt/cli.ini email [email protected]') } | ||
it { is_expected.to contain_ini_setting('/usr/local/etc/letsencrypt/cli.ini register-unsafely-without-email true') } | ||
|
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