0

Am trying to set-up Chef Infra in this manner: Chef Server (Linux), Chef Workstation (Windows), Chef Node (Windows). Chef server and chef workstation are working smooth.

However, chef-client is failing on chef node with the error:

'chef-client' is not recognized as an internal or external command, operable program or batch file.

I did the following:

  1. Downloaded chef-client windows msi package and installed on server (through root user)
  2. Copied the default folders (chef and opscode) from C:\ to D:\ and granted local user permission to read/write
  3. Created client.rb file and also placed SSL certificates in D:\chef
  4. Read permission granted to validator.pem file on chef server. Client.pem is not available as it is the first chef-client run

What else needs to be done? Am i missing something very critical?

Happy
  • 1
  • 1
    Seems to be an issue with the PATH environment variable. The `chef-client` binary should be in `C:\opscode\chef\bin`. Should work once this path is added to `PATH`. – seshadri_c Jun 17 '21 at 12:38
  • Since the chef and opscode folders are copied from C:\ to D:\, i have added the D:\opscode\chef\bin and D:\opscode\chef\embedded\bin variables in PATH. Hence, C:\opscode\chef\bin and D:\opscode\chef\bin co-exist in the system. Just want to know: 1. If we can keep both the variables or only the one where chef resides (either C:\ or D:\). 2. Is it ideal to change the chef and opscode folder path from default C:\ to D:\? (this is done because i am local user and do not have root privileges). Thanks! – Happy Jun 17 '21 at 14:06
  • I'd suggest having a clean `PATH`, i.e. remove `C:\opscode.\..`. Not tested, but changing path from `C:\` to `D:\` should not matter. – seshadri_c Jun 18 '21 at 04:10
  • 1
    Thank you seshadri_c for the solution. It worked! Thank you for the help! One more thing I did is copying the org-validator.pem file to chef node and renaming the file to validation.pem. – Happy Jun 18 '21 at 13:42

0 Answers0