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 in notifying tentacle service restart on tentacle register #57

Merged
merged 1 commit into from Aug 18, 2016

Conversation

spuder
Copy link
Contributor

@spuder spuder commented Aug 18, 2016

Fixes the regression that 4f788e2 introduced in #55
Also fixes #55 so tentacles no longer require manual restarts before health checks pass.

         * octopus_deploy_tentacle[Tentacle] action configure
           * windows_firewall_rule[Octopus Deploy Tentacle] action create (skipped due to only_if)
           * octopus_deploy_tentacle[Tentacle] action install[2016-08-18T00:01:28+00:00] WARN: Please use the package resource available in Chef Client 12.6.
       windows_package will be removed in the next major version release
       of the Windows cookbook.


             * remote_file[C:\Users\ADMINI~1\AppData\Local\Temp\kitchen\cache/octopus-tentacle.msi] action create (up to date)
             * windows_package[Octopus Deploy Tentacle] action install (up to date)
       (up to date)
           * directory[C:\Octopus] action create (up to date)
           * powershell_script[generate-tentacle-cert] action run (skipped due to not_if)
           * powershell_script[create-instance-Tentacle] action run (skipped due to not_if)
           * powershell_script[configure-tentacle-Tentacle] action run (skipped due to not_if)
           * windows_service[OctopusDeploy Tentacle] action enable (up to date)
           * windows_service[OctopusDeploy Tentacle] action start (up to date)
            (up to date)
         * octopus_deploy_tentacle[Tentacle] action register
           * powershell_script[register-Tentacle-tentacle] action run
             - execute "C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe" -NoLogo -NonInteractive -NoProfile -ExecutionPolicy Bypass -InputFormat None -File "C:/Users/ADMINI~1/AppData/Local/Temp/chef-script20160818-2168-1j55eel.ps1"
           * windows_service[OctopusDeploy Tentacle] action nothing (skipped due to action :nothing)
           * windows_service[OctopusDeploy Tentacle] action restart
             - restart service windows_service[OctopusDeploy Tentacle]

Green checkmark means health check passed.

screenshot 2016-08-17 18 09 25

The git history is now a little messy. If you prefer, you could revert #55 and we can combine it with #57. Otherwise it should be good as is.

@spuder spuder changed the title Fixes #55 Fixes regression created in #55 Aug 18, 2016
@@ -168,7 +169,11 @@
notifies :restart, "windows_service[#{service_name}]", :delayed
end

new_resource.updated_by_last_action(actions_updated?([register_instance]))
service = windows_service service_name do
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe we can ignore this part because if the action above happens then the restart will happen and therefore the resource will be updated.

Copy link
Contributor Author

@spuder spuder Aug 18, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure I follow, are you saying change this:

new_resource.updated_by_last_action(actions_updated?([register_instance, service]))

to this?

new_resource.updated_by_last_action(actions_updated?([register_instance]))

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup that is correct. That service resource does not need to be included as it is dependent on the tentacle. If it was also performing an action by default I would include it but in this case it is only being notified by the existing resource.

@brentm5
Copy link
Member

brentm5 commented Aug 18, 2016

No need to revert. Just want to make sure its fixed before publishing this to supermarket.

@brentm5 brentm5 added the bug label Aug 18, 2016
@spuder
Copy link
Contributor Author

spuder commented Aug 18, 2016

Removed the service from new_resource.updated_by_last_action

Manually verified it works

I do notice that it sends 2 notifications to restart, I don't think there is any way of avoiding that without a large refactor. While not ideal, It shouldn't harm anything.

         * octopus_deploy_tentacle[Tentacle] action configure
           * windows_firewall_rule[Octopus Deploy Tentacle] action create (skipped due to not_if)
           * octopus_deploy_tentacle[Tentacle] action install[2016-08-18T01:06:42+00:00] WARN: Please use the package resource available in Chef Client 12.6.
       windows_package will be removed in the next major version release
       of the Windows cookbook.


             * remote_file[C:\Users\ADMINI~1\AppData\Local\Temp\kitchen\cache/octopus-tentacle.msi] action create (up to date)
             * windows_package[Octopus Deploy Tentacle] action install (up to date)
       (up to date)
           * directory[C:\Octopus] action create
             - create new directory C:\Octopus
           * powershell_script[generate-tentacle-cert] action run
             - execute "C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe" -NoLogo -NonInteractive -NoProfile -ExecutionPolicy Bypass -InputFormat None -File "C:/Users/ADMINI~1/AppData/Local/Temp/chef-script20160818-1092-1foxu5g.ps1"
           * powershell_script[create-instance-Tentacle] action run
             - execute "C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe" -NoLogo -NonInteractive -NoProfile -ExecutionPolicy Bypass -InputFormat None -File "C:/Users/ADMINI~1/AppData/Local/Temp/chef-script20160818-1092-skswk5.ps1"
           * powershell_script[configure-tentacle-Tentacle] action run
             - execute "C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe" -NoLogo -NonInteractive -NoProfile -ExecutionPolicy Bypass -InputFormat None -File "C:/Users/ADMINI~1/AppData/Local/Temp/chef-script20160818-1092-od3wir.ps1"
           * windows_service[OctopusDeploy Tentacle] action enable (up to date)
           * windows_service[OctopusDeploy Tentacle] action start (up to date)
           * windows_service[OctopusDeploy Tentacle] action restart
             - restart service windows_service[OctopusDeploy Tentacle]

         * octopus_deploy_tentacle[Tentacle] action register
           * powershell_script[register-Tentacle-tentacle] action run
             - execute "C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe" -NoLogo -NonInteractive -NoProfile -ExecutionPolicy Bypass -InputFormat None -File "C:/Users/ADMINI~1/AppData/Local/Temp/chef-script20160818-1092-l5ybvu.ps1"
           * windows_service[OctopusDeploy Tentacle] action nothing (skipped due to action :nothing)
           * windows_service[OctopusDeploy Tentacle] action restart
             - restart service windows_service[OctopusDeploy Tentacle]

@brentm5 brentm5 merged commit bcd1818 into cvent:master Aug 18, 2016
@brentm5 brentm5 changed the title Fixes regression created in #55 Fix issue in notifying tentacle service restart on tentacle register Aug 18, 2016
@spuder spuder deleted the fix/register2 branch August 18, 2016 16:11
@spuder
Copy link
Contributor Author

spuder commented Aug 18, 2016

👍
Will there be a 0.6.3 ?

@brentm5
Copy link
Member

brentm5 commented Aug 18, 2016

Published

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Polling tentacles need service restarted
2 participants