Skip to content
This repository was archived by the owner on Jan 8, 2019. It is now read-only.

Fix the 'ssh failed to start error' on every chef run. #1272

Merged
merged 1 commit into from
Sep 21, 2018

Conversation

macmaster
Copy link
Contributor

@macmaster macmaster commented Sep 21, 2018

This change pulls out the first commit of #1271 and just applies a simple diff to fix the error.
The default service provider now works fine for ssh on ubuntu 14.04, so we can use it instead of a manual execution resource.

Tested under the following scenarios:

  • ssh is disabled, not yet running.
  • ssh is disabled, already running.
  • ssh is enabled, not yet running.
  • ssh is enabled, already running.

Tested using the following methods:
Disable the service with:

$ sudo chef-shell
chef (12.19.36)> recipe_mode
chef:recipe (12.19.36)> service 'ssh' do
chef:recipe > action :disable
chef:recipe ?> end
chef:recipe (12.19.36)> run_chef

Modify and check the status of ssh with:

$ sudo service ssh stop
$ sudo service ssh status
$ sudo service ssh start

Run this recipe with chef:

$ sudo chef-client -o 'bcpc::ssh'

@cbaenziger
Copy link
Member

The specifics of the tests are quite important; this code runs under at least a few different scenarios:
• SSH service not enabled
• SSH service running but disabled
• SSH service enabled and running
• SSH service not running seems unlikely since we ssh in

Please confirm if you've tried these three (or anyone comment if you can think of more)

@macmaster
Copy link
Contributor Author

The specifics of the tests are quite important; this code runs under at least a few different scenarios:
• SSH service not enabled
• SSH service running but disabled
• SSH service enabled and running
• SSH service not running seems unlikely since we ssh in

Please confirm if you've tried these three (or anyone comment if you can think of more)

Now tested under the following circumstances:

  • ssh is disabled, not yet running.
  • ssh is disabled, already running.
  • ssh is enabled, not yet running.
  • ssh is enabled, already running.

@cbaenziger
Copy link
Member

Thanks for the verification!

@cbaenziger cbaenziger merged commit 692df90 into bloomberg:master Sep 21, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants