How change/Alias chef server url for 2nd organization

99 views
Skip to first unread message

Salam Elias

unread,
Apr 28, 2015, 3:22:57 PM4/28/15
to learnchef-funda...@googlegroups.com
Hi, I have chef up and running and and able to follow the "Chef Fundamentals Series " by Nathen Harvey which I find fantastic.I am using my own chef server and not the hosted one. The Chef server is on my lan and can be reached ad http://chef. So in my clients.rb, I have
chef_server_url          "https://mychef/organizations/sierac"
as said, works fine with my internal nodes but of course can not be contacted by my VM from Amazon

Everythbing went OK until module 5 where I needed to bootstrap a VM on Amazon. I can access my server using a different URL such as
http://myserver.hd.provider.com, which I added to my /etc/hosts as follows

127.0.0.1 myserver.hd.provider.com localhost
127.0.1.1 CHEF


I can log to the chef console with this external URL , create a user and a new organization. The problem is when I download the starter kit, investigating the knife.rb file, I have
chef_server_url          "https://localhost/organizations/myneworg"
 and not myserver.hd.provider.com, so when I try to run any command, of course I get authentitication error  as follows

ERROR: SSL Validation failure connecting to host: myserver.hd.provider.com  - SSL_connect ret

Thanks in advanceurned=1 errno=0 state=SSLv3 read ser
ver certificate B: certificate verify failed ERROR: Could not establish a secure connection to the server.
Use `knife ssl check` to troubleshoot your SSL configuration. If your Chef Server uses a self-signed certificate, you can use
`knife ssl fetch` to make knife trust the server's certificates.
Original Exception: OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certif
icate verify failed

So the question : Is it possible to use aliases for chef server "Internal" & "External", if not, how can I have Chef generate the files with

chef_server_url          "https://myserver.hd.provider.com/organizations/myneworg"  instead of localhost

Thanks in advance 
Reply all
Reply to author
Forward
0 new messages