chef-cookbooks / ssh_known_hosts

Development repository for Chef Cookbook ssh_known_hosts
https://supermarket.chef.io/cookbooks/ssh_known_hosts
Apache License 2.0
72 stars 77 forks source link

Not honoring `default['ssh_known_hosts']['file']` attribute in 6.x? #87

Closed espoelstra closed 6 years ago

espoelstra commented 6 years ago

Cookbook version

6.1.0

Chef-client version

2.4.17

Platform Details

Ubuntu 14.04

Scenario:

Our test-kitchen builds are failing due to the custom known_hosts file we have specified not existing. It appears the cookbook is now ignoring the default['ssh_known_hosts']['file'] attribute and just writing to the default file unless explicitly overridden using file_location in the recipe.

Steps to Reproduce:

Run the tests from the recipe using an attributes file instead of hardcoded file_location and see what happens. https://github.com/chef-cookbooks/ssh_known_hosts/raw/master/test/fixtures/cookbooks/ssh_known_hosts_test/recipes/resource.rb

Expected Result:

Previously (in 5.2.1 and earlier) the custom attribute specified file was created and populated.

Actual Result:

Now the entries are simply added to the host wide known_hosts and not the user/application specific known hosts defined in attributes.

tas50 commented 6 years ago

6.X moved this from the attribute to the resource itself. This is part of getting this resource ready to be moved directly into Chef. Chef 15 will ship with this resource and eliminate the need to depend on this cookbook. Since this cookbook will be going away the attributes for the cookbook also need to go away. This is breaking change, but that was part of the reason for the major version bump.