|
4 | 4 | let :constant_parameter_defaults do
|
5 | 5 | {:config_hash => {},
|
6 | 6 | :package_ensure => 'present',
|
7 |
| - :enabled => true |
| 7 | + :enabled => true, |
| 8 | + :manage_service => true |
8 | 9 | }
|
9 | 10 | end
|
10 | 11 |
|
|
53 | 54 | :package_ensure => 'latest',
|
54 | 55 | :service_name => 'dans_service',
|
55 | 56 | :config_hash => {'root_password' => 'foo'},
|
56 |
| - :enabled => false |
| 57 | + :enabled => false, |
| 58 | + :manage_service => false |
57 | 59 | }
|
58 | 60 | ].each do |passed_params|
|
59 | 61 |
|
|
76 | 78 | :ensure => param_values[:package_ensure]
|
77 | 79 | )}
|
78 | 80 |
|
79 |
| - it { should contain_service('mysqld').with( |
80 |
| - :name => param_values[:service_name], |
81 |
| - :ensure => param_values[:enabled] ? 'running' : 'stopped', |
82 |
| - :enable => param_values[:enabled], |
83 |
| - :require => 'Package[mysql-server]' |
84 |
| - )} |
85 |
| - |
86 |
| - it { should contain_service('mysqld').without_provider } |
| 81 | + it { |
| 82 | + if param_values[:manage_service] |
| 83 | + should contain_service('mysqld').with( |
| 84 | + :name => param_values[:service_name], |
| 85 | + :ensure => param_values[:enabled] ? 'running' : 'stopped', |
| 86 | + :enable => param_values[:enabled], |
| 87 | + :require => 'Package[mysql-server]' |
| 88 | + ).without_provider |
| 89 | + else |
| 90 | + should_not contain_service('mysqld') |
| 91 | + end |
| 92 | + } |
87 | 93 | end
|
88 | 94 | end
|
89 | 95 | end
|
|
0 commit comments