|
17 | 17 | describe 'with defaults' do
|
18 | 18 | it { is_expected.to compile }
|
19 | 19 |
|
20 |
| - epel = facts[:osfamily] == 'RedHat' && facts[:operatingsystem] != 'Fedora' |
21 |
| - |
| 20 | + epel = facts['os']['family'] == 'RedHat' && facts['os']['name'] != 'Fedora' |
22 | 21 | it 'contains the correct resources' do
|
23 | 22 | is_expected.to contain_class('letsencrypt::install').
|
24 | 23 | with(configure_epel: epel).
|
|
33 | 32 | cron_monthday: ['*'])
|
34 | 33 | is_expected.to contain_cron('letsencrypt-renew').with_ensure('absent')
|
35 | 34 |
|
36 |
| - if facts[:osfamily] == 'FreeBSD' |
| 35 | + if facts['os']['family'] == 'FreeBSD' |
37 | 36 | is_expected.to contain_ini_setting('/usr/local/etc/letsencrypt/cli.ini email [email protected]')
|
38 | 37 | is_expected.to contain_ini_setting('/usr/local/etc/letsencrypt/cli.ini server https://acme-v02.api.letsencrypt.org/directory')
|
39 | 38 | is_expected.to contain_file('letsencrypt-renewal-hooks-puppet').
|
|
50 | 49 | is_expected.to contain_file('letsencrypt-renewal-hooks-puppet').with_path('/etc/letsencrypt/renewal-hooks-puppet')
|
51 | 50 | end
|
52 | 51 |
|
53 |
| - if facts[:osfamily] == 'RedHat' |
| 52 | + if facts['os']['family'] == 'RedHat' |
54 | 53 | if epel
|
55 | 54 | is_expected.to contain_class('epel').that_comes_before('Package[letsencrypt]')
|
56 | 55 | else
|
|
60 | 59 | is_expected.to contain_class('letsencrypt').with(package_command: 'certbot')
|
61 | 60 | is_expected.to contain_package('letsencrypt').with(name: 'certbot').with_ensure('installed')
|
62 | 61 | is_expected.to contain_file('/etc/letsencrypt').with(ensure: 'directory')
|
63 |
| - elsif facts[:osfamily] == 'Debian' |
| 62 | + elsif facts['os']['family'] == 'Debian' |
64 | 63 | is_expected.to contain_class('letsencrypt::install').with(package_name: 'certbot')
|
65 | 64 | is_expected.to contain_file('/etc/letsencrypt').with(ensure: 'directory')
|
66 |
| - elsif facts[:operatingsystem] == 'Gentoo' |
| 65 | + elsif facts['os']['name'] == 'Gentoo' |
67 | 66 | is_expected.to contain_class('letsencrypt::install').with(package_name: 'app-crypt/certbot')
|
68 | 67 | is_expected.to contain_class('letsencrypt').with(package_command: 'certbot')
|
69 | 68 | is_expected.to contain_package('letsencrypt').with(name: 'app-crypt/certbot').with_ensure('installed')
|
70 | 69 | is_expected.to contain_file('/etc/letsencrypt').with(ensure: 'directory')
|
71 |
| - elsif facts[:operatingsystem] == 'OpenBSD' |
| 70 | + elsif facts['os']['name'] == 'OpenBSD' |
72 | 71 | is_expected.to contain_class('letsencrypt::install').with(package_name: 'certbot')
|
73 | 72 | is_expected.to contain_class('letsencrypt').with(package_command: 'certbot')
|
74 | 73 | is_expected.to contain_package('letsencrypt').with(name: 'certbot').with_ensure('installed')
|
75 | 74 | is_expected.to contain_file('/etc/letsencrypt').with(ensure: 'directory')
|
76 |
| - elsif facts[:operatingsystem] == 'FreeBSD' |
| 75 | + elsif facts['os']['name'] == 'FreeBSD' |
77 | 76 | is_expected.to contain_class('letsencrypt::install').with(package_name: 'py311-certbot')
|
78 | 77 | is_expected.to contain_class('letsencrypt').with(package_command: 'certbot')
|
79 | 78 | is_expected.to contain_package('letsencrypt').with(name: 'py311-certbot').with_ensure('installed')
|
|
100 | 99 | describe 'with custom config' do
|
101 | 100 | let(:additional_params) { { config: { 'foo' => 'bar' } } }
|
102 | 101 |
|
103 |
| - case facts[:operatingsystem] |
| 102 | + case facts['os']['name'] |
104 | 103 | when 'FreeBSD'
|
105 | 104 | it { is_expected.to contain_ini_setting('/usr/local/etc/letsencrypt/cli.ini foo bar') }
|
106 | 105 | else
|
|
237 | 236 |
|
238 | 237 | it { is_expected.to compile.with_all_deps }
|
239 | 238 |
|
240 |
| - case facts[:operatingsystem] |
| 239 | + case facts['os']['name'] |
241 | 240 | when 'FreeBSD'
|
242 | 241 | it { is_expected.to contain_ini_setting('/usr/local/etc/letsencrypt/cli.ini email [email protected]') }
|
243 | 242 | else
|
|
253 | 252 | context 'with unsafe_registration set to true' do
|
254 | 253 | let(:params) { { unsafe_registration: true } }
|
255 | 254 |
|
256 |
| - case facts[:operatingsystem] |
| 255 | + case facts['os']['name'] |
257 | 256 | when 'FreeBSD'
|
258 | 257 | it { is_expected.not_to contain_ini_setting('/usr/local/etc/letsencrypt/cli.ini email [email protected]') }
|
259 | 258 | it { is_expected.to contain_ini_setting('/usr/local/etc/letsencrypt/cli.ini register-unsafely-without-email true') }
|
|
0 commit comments