|
194 | 194 | is_expected.to contain_file('/some_dir/actions-runner-2.272.0/first_runner/configure_install_runner.sh').with_content(/authorization: token test_PAT/) |
195 | 195 | end |
196 | 196 | end |
| 197 | + |
| 198 | + context 'is expected to create a github_actions_runner installation with proxy settings in systemd globally in init.pp' do |
| 199 | + let(:params) do |
| 200 | + super().merge( |
| 201 | + 'http_proxy' => 'http://proxy.local', |
| 202 | + 'https_proxy' => 'http://proxy.local', |
| 203 | + 'no_proxy' => 'example.com', |
| 204 | + 'instances' => { |
| 205 | + 'first_runner' => { |
| 206 | + 'labels' => ['test_label1'], |
| 207 | + 'repo_name' => 'test_repo', |
| 208 | + }, |
| 209 | + }, |
| 210 | + ) |
| 211 | + end |
| 212 | + |
| 213 | + it do |
| 214 | + is_expected.to contain_systemd__unit_file('github-actions-runner.first_runner.service').with_content(%r{Environment="http_proxy=http://proxy.local"}) |
| 215 | + is_expected.to contain_systemd__unit_file('github-actions-runner.first_runner.service').with_content(%r{Environment="https_proxy=http://proxy.local"}) |
| 216 | + is_expected.to contain_systemd__unit_file('github-actions-runner.first_runner.service').with_content(%r{Environment="no_proxy=example.com"}) |
| 217 | + end |
| 218 | + end |
| 219 | + |
| 220 | + context 'is expected to create a github_actions_runner installation with proxy settings in systemd globally in init.pp overwriting in a instance' do |
| 221 | + let(:params) do |
| 222 | + super().merge( |
| 223 | + 'http_proxy' => 'http://proxy.local', |
| 224 | + 'https_proxy' => 'http://proxy.local', |
| 225 | + 'no_proxy' => 'example.com', |
| 226 | + 'instances' => { |
| 227 | + 'first_runner' => { |
| 228 | + 'labels' => ['test_label1'], |
| 229 | + 'repo_name' => 'test_repo', |
| 230 | + 'http_proxy' => 'http://newproxy.local', |
| 231 | + }, |
| 232 | + }, |
| 233 | + ) |
| 234 | + end |
| 235 | + |
| 236 | + it do |
| 237 | + is_expected.to contain_systemd__unit_file('github-actions-runner.first_runner.service').with_content(%r{Environment="http_proxy=http://newproxy.local"}) |
| 238 | + is_expected.to contain_systemd__unit_file('github-actions-runner.first_runner.service').with_content(%r{Environment="https_proxy=http://proxy.local"}) |
| 239 | + is_expected.to contain_systemd__unit_file('github-actions-runner.first_runner.service').with_content(%r{Environment="no_proxy=example.com"}) |
| 240 | + end |
| 241 | + end |
| 242 | + |
| 243 | + context 'is expected to create a github_actions_runner installation with proxy settings in systemd' do |
| 244 | + let(:params) do |
| 245 | + super().merge( |
| 246 | + 'instances' => { |
| 247 | + 'first_runner' => { |
| 248 | + 'labels' => ['test_label1'], |
| 249 | + 'repo_name' => 'test_repo', |
| 250 | + 'http_proxy' => 'http://proxy.local', |
| 251 | + 'https_proxy' => 'http://proxy.local', |
| 252 | + 'no_proxy' => 'example.com'}, |
| 253 | + }, |
| 254 | + ) |
| 255 | + end |
| 256 | + |
| 257 | + it do |
| 258 | + is_expected.to contain_systemd__unit_file('github-actions-runner.first_runner.service').with_content(%r{Environment="http_proxy=http://proxy.local"}) |
| 259 | + is_expected.to contain_systemd__unit_file('github-actions-runner.first_runner.service').with_content(%r{Environment="https_proxy=http://proxy.local"}) |
| 260 | + is_expected.to contain_systemd__unit_file('github-actions-runner.first_runner.service').with_content(%r{Environment="no_proxy=example.com"}) |
| 261 | + end |
| 262 | + end |
| 263 | + |
| 264 | + context 'is expected to create a github_actions_runner installation without proxy settings in systemd' do |
| 265 | + let(:params) do |
| 266 | + super().merge( |
| 267 | + 'instances' => { |
| 268 | + 'first_runner' => { |
| 269 | + 'labels' => ['test_label1'], |
| 270 | + 'repo_name' => 'test_repo'}, |
| 271 | + }, |
| 272 | + ) |
| 273 | + end |
| 274 | + |
| 275 | + it do |
| 276 | + is_expected.to contain_systemd__unit_file('github-actions-runner.first_runner.service').without_content(%r{Environment="http_proxy=http://proxy.local"}) |
| 277 | + is_expected.to contain_systemd__unit_file('github-actions-runner.first_runner.service').without_content(%r{Environment="https_proxy=http://proxy.local"}) |
| 278 | + is_expected.to contain_systemd__unit_file('github-actions-runner.first_runner.service').without_content(%r{Environment="no_proxy=example.com"}) |
| 279 | + end |
| 280 | + end |
197 | 281 | end |
198 | 282 | end |
199 | 283 | end |
0 commit comments