|
87 | 87 | end
|
88 | 88 | end
|
89 | 89 |
|
90 |
| - context 'is expected to create a github_actions_runner service' do |
91 |
| - it do |
92 |
| - is_expected.to contain_service('github-actions-runner.first_runner.service').with('ensure' => 'running', 'enable' => true) |
93 |
| - end |
94 |
| - end |
95 |
| - |
96 | 90 | context 'is expected to contain archive' do
|
97 | 91 | it do
|
98 | 92 | is_expected.to contain_archive('first_runner-actions-runner-linux-x64-2.272.0.tar.gz').with(
|
|
208 | 202 | end
|
209 | 203 | end
|
210 | 204 |
|
| 205 | + context 'is expected to create a github_actions_runner with service active and enabled' do |
| 206 | + let(:params) do |
| 207 | + super().merge( |
| 208 | + 'http_proxy' => 'http://proxy.local', |
| 209 | + 'https_proxy' => 'http://proxy.local', |
| 210 | + 'no_proxy' => 'example.com', |
| 211 | + 'instances' => { |
| 212 | + 'first_runner' => { |
| 213 | + 'labels' => ['test_label1'], |
| 214 | + 'repo_name' => 'test_repo', |
| 215 | + }, |
| 216 | + }, |
| 217 | + ) |
| 218 | + end |
| 219 | + |
| 220 | + it do |
| 221 | + is_expected.to contain_systemd__unit_file('github-actions-runner.first_runner.service').with( |
| 222 | + 'ensure' => 'present', |
| 223 | + 'enable' => true, |
| 224 | + 'active' => true, |
| 225 | + ) |
| 226 | + end |
| 227 | + end |
| 228 | + |
| 229 | + context 'is expected to remove github_actions_runner unit_file and other resources' do |
| 230 | + let(:params) do |
| 231 | + super().merge( |
| 232 | + 'http_proxy' => 'http://proxy.local', |
| 233 | + 'https_proxy' => 'http://proxy.local', |
| 234 | + 'no_proxy' => 'example.com', |
| 235 | + 'instances' => { |
| 236 | + 'first_runner' => { |
| 237 | + 'ensure' => 'absent', |
| 238 | + 'labels' => ['test_label1'], |
| 239 | + 'repo_name' => 'test_repo', |
| 240 | + }, |
| 241 | + }, |
| 242 | + ) |
| 243 | + end |
| 244 | + |
| 245 | + it do |
| 246 | + is_expected.to contain_systemd__unit_file('github-actions-runner.first_runner.service').with( |
| 247 | + 'ensure' => 'absent', |
| 248 | + 'enable' => false, |
| 249 | + 'active' => false, |
| 250 | + ) |
| 251 | + is_expected.to contain_file('/some_dir/actions-runner-2.272.0/first_runner').with( |
| 252 | + 'ensure' => 'absent', |
| 253 | + ) |
| 254 | + is_expected.to contain_archive('first_runner-actions-runner-linux-x64-2.272.0.tar.gz').with( |
| 255 | + 'ensure' => 'absent', |
| 256 | + ) |
| 257 | + is_expected.to contain_file('/some_dir/actions-runner-2.272.0/first_runner/configure_install_runner.sh').with( |
| 258 | + 'ensure' => 'absent', |
| 259 | + ) |
| 260 | + end |
| 261 | + end |
| 262 | + |
211 | 263 | context 'is expected to create a github_actions_runner installation with proxy settings in systemd globally in init.pp' do
|
212 | 264 | let(:params) do
|
213 | 265 | super().merge(
|
|
0 commit comments