Amandeep Singh
Amandeep Singh

Reputation: 1

Can we install chef client and server at custom directory rather than default?

The default installation of chef-client happens in /opt directory. I have a requirement where i need to install chef client under /opt/installed_apps directory.

If i am installing it under /opt/installed_apps, it is creating a /opt/chef folder inside /opt/installed_apps and while running the chef-client command, it is throwing an error that "/opt/chef/embedded/bin/ruby file or directory not exist".

I tried to set the path of ruby gem i.e /opt/chef/embedded/bin/ruby in environmental PATH variable but it didn't work.

Please advice do i have to set any specific environment variables for chef-client to work or custom installation of chef client/server is not allowed/recommended.

Thank Amandeep Singh

Upvotes: 0

Views: 437

Answers (1)

Tensibai
Tensibai

Reputation: 15784

Short: you can't, some libraries in the embedded Ruby are statically linked against this directory.

The only workaround I can think of is installing in your destination directory (for mounts or I don't what reason) and then make a symlink to /opt/chef like:

 ln -s /opt/chef /opt/installed_apps/opt/chef

Going down the path of installing ruby and using gem install sounds overkill and error-prone.

Upvotes: 0

Related Questions