|
41 | 41 | context 'nginx::package' do |
42 | 42 | it { is_expected.to compile.with_all_deps } |
43 | 43 |
|
44 | | - case facts[:osfamily] |
| 44 | + case facts[:os]['family'] |
45 | 45 | when 'RedHat' |
46 | 46 | context 'using defaults' do |
47 | 47 | it { is_expected.to contain_package('nginx') } |
48 | 48 |
|
49 | 49 | it do |
50 | 50 | is_expected.to contain_yumrepo('nginx-release').with( |
51 | | - 'baseurl' => "https://nginx.org/packages/#{%w[CentOS VirtuozzoLinux OracleLinux].include?(facts[:operatingsystem]) ? 'centos' : 'rhel'}/#{facts[:operatingsystemmajrelease]}/$basearch/", |
| 51 | + 'baseurl' => "https://nginx.org/packages/#{%w[CentOS VirtuozzoLinux OracleLinux].include?(facts[:os]['name']) ? 'centos' : 'rhel'}/#{facts[:os]['release']['major']}/$basearch/", |
52 | 52 | 'descr' => 'nginx repo', |
53 | 53 | 'enabled' => '1', |
54 | 54 | 'gpgcheck' => '1', |
|
74 | 74 |
|
75 | 75 | it do |
76 | 76 | is_expected.to contain_yumrepo('nginx-release').with( |
77 | | - 'baseurl' => "https://nginx.org/packages/#{%w[CentOS VirtuozzoLinux OracleLinux].include?(facts[:operatingsystem]) ? 'centos' : 'rhel'}/#{facts[:operatingsystemmajrelease]}/$basearch/", |
| 77 | + 'baseurl' => "https://nginx.org/packages/#{%w[CentOS VirtuozzoLinux OracleLinux].include?(facts[:os]['name']) ? 'centos' : 'rhel'}/#{facts[:os]['release']['major']}/$basearch/", |
78 | 78 | 'descr' => 'nginx repo', |
79 | 79 | 'enabled' => '1', |
80 | 80 | 'gpgcheck' => '1', |
|
91 | 91 |
|
92 | 92 | it do |
93 | 93 | is_expected.to contain_yumrepo('nginx-release').with( |
94 | | - 'baseurl' => "https://nginx.org/packages/mainline/#{%w[CentOS VirtuozzoLinux OracleLinux].include?(facts[:operatingsystem]) ? 'centos' : 'rhel'}/#{facts[:operatingsystemmajrelease]}/$basearch/" |
| 94 | + 'baseurl' => "https://nginx.org/packages/mainline/#{%w[CentOS VirtuozzoLinux OracleLinux].include?(facts[:os]['name']) ? 'centos' : 'rhel'}/#{facts[:os]['release']['major']}/$basearch/" |
95 | 95 | ) |
96 | 96 | end |
97 | 97 |
|
|
105 | 105 | it { is_expected.to contain_yumrepo('passenger').that_comes_before('Package[nginx]') } |
106 | 106 | end |
107 | 107 |
|
108 | | - context 'package_source => passenger', unless: facts[:operatingsystemmajrelease] == '8' do |
| 108 | + context 'package_source => passenger', unless: facts[:os]['release']['major'] == '8' do |
109 | 109 | let(:params) { { package_source: 'passenger' } } |
110 | 110 |
|
111 | 111 | it do |
112 | 112 | is_expected.to contain_yumrepo('passenger').with( |
113 | | - 'baseurl' => "https://oss-binaries.phusionpassenger.com/yum/passenger/el/#{facts[:operatingsystemmajrelease]}/$basearch", |
| 113 | + 'baseurl' => "https://oss-binaries.phusionpassenger.com/yum/passenger/el/#{facts[:os]['release']['major']}/$basearch", |
114 | 114 | 'gpgcheck' => '0', |
115 | 115 | 'repo_gpgcheck' => '1', |
116 | 116 | 'gpgkey' => 'https://oss-binaries.phusionpassenger.com/auto-software-signing-gpg-key.txt' |
|
128 | 128 | it { is_expected.to contain_package('passenger').with('ensure' => 'installed') } |
129 | 129 | end |
130 | 130 |
|
131 | | - describe 'installs the requested passenger package version', unless: facts[:operatingsystemmajrelease] == '8' do |
| 131 | + describe 'installs the requested passenger package version', unless: facts[:os]['release']['major'] == '8' do |
132 | 132 | let(:params) { { package_source: 'passenger', passenger_package_ensure: '4.1.0-1.el9' } } |
133 | 133 |
|
134 | 134 | it 'installs specified version exactly' do |
|
158 | 158 |
|
159 | 159 | it do |
160 | 160 | is_expected.to contain_apt__source('nginx').with( |
161 | | - 'location' => "https://nginx.org/packages/#{facts[:operatingsystem].downcase}", |
| 161 | + 'location' => "https://nginx.org/packages/#{facts[:os]['name'].downcase}", |
162 | 162 | 'repos' => 'nginx', |
163 | 163 | 'key' => { 'id' => '573BFD6B3D8FBC641079A6ABABF5BD827BD9BF62' } |
164 | 164 | ) |
|
180 | 180 |
|
181 | 181 | it do |
182 | 182 | is_expected.to contain_apt__source('nginx').with( |
183 | | - 'location' => "https://nginx.org/packages/mainline/#{facts[:operatingsystem].downcase}" |
| 183 | + 'location' => "https://nginx.org/packages/mainline/#{facts[:os]['name'].downcase}" |
184 | 184 | ) |
185 | 185 | end |
186 | 186 | end |
|
358 | 358 | end |
359 | 359 | end |
360 | 360 |
|
361 | | - case facts[:osfamily] |
| 361 | + case facts[:os]['family'] |
362 | 362 | when 'RedHat' |
363 | 363 | it { is_expected.to contain_file('/etc/nginx/nginx.conf').with_content %r{^user nginx;} } |
364 | 364 |
|
|
0 commit comments