Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue with notifying service to restart when its disabled! #22

Merged
merged 1 commit into from
Apr 4, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
source_url 'https://github.com/cvent/octopus-deploy-cookbook'
issues_url 'https://github.com/cvent/octopus-deploy-cookbook/issues'
version '0.5.0'
version '0.5.1'

depends 'windows', '~> 1.38'
supports 'windows'
Expand Down
2 changes: 1 addition & 1 deletion providers/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
#{catch_powershell_error('Create Service')}
EOH
sensitive true
notifies :restart, "windows_service[#{service_name}]", :delayed
notifies :restart, "windows_service[#{service_name}]", :delayed if start_service
not_if { ::Win32::Service.exists?(service_name) }
end

Expand Down
4 changes: 2 additions & 2 deletions test/cookbooks/verify-octo/recipes/audit_server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
expect(service('OctopusDeploy')).to be_installed
end

it 'should have enabled the service' do
expect(service('OctopusDeploy')).to be_enabled
it 'should have disabled the service' do
expect(service('OctopusDeploy')).to have_start_mode('Disabled')
end

it 'should have created the configuration file' do
Expand Down
1 change: 1 addition & 0 deletions test/cookbooks/verify-octo/recipes/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
checksum node['verify-octo']['server']['checksum']
node_name 'octo-web-01'
connection_string 'Data Source=localhostdba;Initial Catalog=octo;Integrated Security=False;User ID=octo;Password=password'
start_service false
end

include_recipe 'verify-octo::audit_server'