|
96 | 96 |
|
97 | 97 | end |
98 | 98 |
|
| 99 | + context 'when restart_puppet is true' do |
| 100 | + let(:pre_condition) { 'class { "puppetdb": }' } |
| 101 | + |
| 102 | + context 'with create_puppet_service_resource as default' do |
| 103 | + let(:params) do |
| 104 | + { |
| 105 | + :puppet_service_name => 'puppetserver', |
| 106 | + :restart_puppet => true, |
| 107 | + } |
| 108 | + end |
| 109 | + |
| 110 | + it { should contain_service('puppetserver').with(:ensure => 'running') } |
| 111 | + end |
| 112 | + |
| 113 | + context 'with create_puppet_service_resource = true' do |
| 114 | + let(:params) do |
| 115 | + { |
| 116 | + :create_puppet_service_resource => true, |
| 117 | + :puppet_service_name => 'puppetserver', |
| 118 | + :restart_puppet => true, |
| 119 | + } |
| 120 | + end |
| 121 | + |
| 122 | + it { should contain_service('puppetserver').with(:ensure => 'running') } |
| 123 | + end |
| 124 | + |
| 125 | + context 'with create_puppet_service_resource = false' do |
| 126 | + # Also setting the various parameters that notify the service to be false. Otherwise this error surfaces: |
| 127 | + # `Could not find resource 'Service[puppetserver]' for relationship from 'Class[Puppetdb::Master::Puppetdb_conf]'` |
| 128 | + let(:params) do |
| 129 | + { |
| 130 | + :create_puppet_service_resource => false, |
| 131 | + :manage_config => false, |
| 132 | + :manage_report_processor => false, |
| 133 | + :manage_routes => false, |
| 134 | + :puppet_service_name => 'puppetserver', |
| 135 | + :restart_puppet => true, |
| 136 | + } |
| 137 | + end |
| 138 | + |
| 139 | + it { should_not contain_service('puppetserver') } |
| 140 | + end |
| 141 | + end |
99 | 142 | end |
0 commit comments