-
Notifications
You must be signed in to change notification settings - Fork 40
chef server URL being set to "172.17.0.1" and fails SSL verify #79
Comments
I tried with this: :convergence_options => {
:ssl_verify_mode => 'verify_none',
:chef_server => 'https://chefserver.vagrant.local/organizations/chefserver'
} But it didn't change the chefserver URL. It did get me past SSL verify because of the SSL verify mode, however I would much prefer to have this work. Unexpected API Request Failure:
-------------------------------
Cannot load environment chefserver |
Not sure if it'll help, but I use the following to allow ssl verification. chef_server_cert = {
"/etc/chef/trusted_certs/chef_my_com.crt" => {
content: open(
::File.dirname(Chef::Config[:config_file]
)+'/trusted_certs/chef_my_com.crt'
).read()
}
}
machine nodename do
converge true
action context.action
file chef_server_cert
end |
Been trying to copy file over to docker machine but keep getting this: |
Tested yagzoo's modification and I get... |
I've written a fix for docker_transport.rb upload_file which works (FileUtils won't work here), so now I can copy certs over with "file" in my recipe. if host == '127.0.0.1' || host == '::1'
Chef::Log.debug("Using Chef server URL: #{uri.to_s}")
return uri.to_s EDIT: This is a known issue, chef-boneyard/chef-provisioning#347, I'm using workaround. I guess the main issue I had was 'file' didn't work so I couldn't move a cert over to container. I'll probably submit a PR for this. |
…_in from docker-api
I changed it to this and created PR #80, let me know if this is a valid PR else I'll close it/update it: def upload_file(local_path, path)
dir = File.dirname(path)
localfile = File.basename(local_path)
execute(['mkdir','-p',dir])
container.archive_in(local_path, dir, overwrite: true)
execute(['mv',dir+"/"+localfile,path])
end |
I'm using the following script:
I run this command with debug turned on:
chef-client script.rb
In debug logs I get this firstly:
Then I get these:
My client.rb file is in /etc/chef with this:
I figure it's because "172.17.0.1" is the IP of the Docker container, whilst the certificate I'm providing is of "chefserver.vagrant.local". But I can't change the chefserver URL being used.
The text was updated successfully, but these errors were encountered: