Silent installer for windows chef client


#1

Hi,
I am using the .msi chef client across a few nodes right now .We will
potentially be using this across 70 odd boxes . I am currently looking at
trying out the resources specified here ->

Wanted to know what others are currently using for the same.

thanks
Madhurranjan


#2

Apologies : the following works :

msiexec /qb /i chef-client-0.10.4-6.msi

Problem though is that there is an issue with the Path environment
variable. The environment variable “PATH” is appended with the
c:\opscode\bin and c:\opscode\embedded\bin but for it to reflect on a new
command prompt, I have to go to My computer, -> Environment variables ->
open the path Variable -> click OK and then close which is weird and then
running “knife” just works fine. WIthout doing that , it doesn’t seem to
work .
thanks
Ranjan

On Mon, Dec 12, 2011 at 6:36 PM, Madhurranjan Mohaan <
maadhuuranjan.m@gmail.com> wrote:

Hi,
I am using the .msi chef client across a few nodes right now .We will
potentially be using this across 70 odd boxes . I am currently looking at
trying out the resources specified here ->
https://github.com/chef-cookbooks/windows

Wanted to know what others are currently using for the same.

thanks
Madhurranjan


#3

Le 12.12.2011 14:29, Madhurranjan Mohaan a écrit :

Apologies :
the following works :
msiexec /qb /i chef-client-0.10.4-6.msi

Problem though is that there is an issue with the Path environment
variable. The environment variable “PATH” is appended with the
c:opscodebin and c:opscodeembeddedbin but for it to reflect on a new
command prompt, I have to go to My computer, -> Environment variables ->
open the path Variable -> click OK and then close which is weird and
then running “knife” just works fine. WIthout doing that , it doesn’t
seem to work .

thanks
Ranjan

Indeed, env vars are loaded at
logon… so after an install you have to tell the system to reload your
env variables.

Same as in unix when editing your .profile, untill you
reload it you won’t have access to new values.


#4

To clarify further. Environmental variables are not just loaded at login.

  1. New instances of cmd prompt in the same windows session will enumerate the new env vars. This is why you are able to close on command prompt and open another in which knife will work. If you are looking for a hacky work around for this type of problem, http://stackoverflow.com/questions/171588/is-there-a-command-to-refresh-environment-variables-from-the-command-prompt-in-w

  2. For an even (or maybe less) hackier work around, just set PATH=%PATH%;c:\opscode\bin;c:\opscode\embedded\bin. This will add the ops code directories to you current cmd.exe session.

  3. Using the Win32 API it is possible to notify other processes that environmental variables have changed. (See https://github.com/opscode/chef/blob/master/chef/lib/chef/provider/env/windows.rb#L66 for an example). The unfortunate part is that cmd.exe does not subscribe to this event.

Paul

On Dec 12, 2011, at 5:56 AM, Tensibai wrote:

Le 12.12.2011 14:29, Madhurranjan Mohaan a écrit :

Apologies : the following works :

msiexec /qb /i chef-client-0.10.4-6.msi
Problem though is that there is an issue with the Path environment variable. The environment variable “PATH” is appended with the c:\opscode\bin and c:\opscode\embedded\bin but for it to reflect on a new command prompt, I have to go to My computer, -> Environment variables -> open the path Variable -> click OK and then close which is weird and then running “knife” just works fine. WIthout doing that , it doesn’t seem to work .
thanks
Ranjan

Indeed, env vars are loaded at logon… so after an install you have to tell the system to reload your env variables.

Same as in unix when editing your .profile, untill you reload it you won’t have access to new values.


#5

Greetings -

Currently we are not using the MSI (directly) to deploy chef. By and large we are using the knife bootstrap wine, command with the windows -chef-client-msi (Default Now) http://wiki.opscode.com/display/chef/Knife+Windows+Bootstrap#KnifeWindowsBootstrap-windowschefclientmsi

The nice part about using the knife bootstrap command is that it takes care of doing all of the additional setup including transferring your validation cert and client configuration. Once you bootstrap the windows server with knife, chef-client should run fine.

WRT the windows cookbook, are there particualr things that you are trying to accomplish?

Paul

On Dec 12, 2011, at 5:06 AM, Madhurranjan Mohaan wrote:

Hi,
I am using the .msi chef client across a few nodes right now .We will potentially be using this across 70 odd boxes . I am currently looking at trying out the resources specified here -> https://github.com/chef-cookbooks/windows

Wanted to know what others are currently using for the same.

thanks
Madhurranjan


#6

Thanks Paul. I’ll try out the bootstrap. I want to basically run and
install a whole bunch of installers and configure them so that my builds
can run on them. This includes things like .Net , IIS, SQL server and other
items. My problem was that though the environment variable had the chef
install path appended, it just wasn’t reflecting till I went there manually
and clicked them. I’ll try what you have recommended here , which is to
hardcode the path variable separately and see if that works.

cheers

Madhurranjan

On Mon, Dec 12, 2011 at 11:49 PM, Paul Morton - BIA
pmorton@biaprotect.comwrote:

Greetings -

Currently we are not using the MSI (directly) to deploy chef. By and large
we are using the knife bootstrap wine, command with the windows
-chef-client-msi (Default Now)
http://wiki.opscode.com/display/chef/Knife+Windows+Bootstrap#KnifeWindowsBootstrap-windowschefclientmsi

The nice part about using the knife bootstrap command is that it takes
care of doing all of the additional setup including transferring your
validation cert and client configuration. Once you bootstrap the windows
server with knife, chef-client should run fine.

WRT the windows cookbook, are there particualr things that you are trying
to accomplish?

Paul

On Dec 12, 2011, at 5:06 AM, Madhurranjan Mohaan wrote:

Hi,
I am using the .msi chef client across a few nodes right now .We will
potentially be using this across 70 odd boxes . I am currently looking at
trying out the resources specified here ->
https://github.com/chef-cookbooks/windows

Wanted to know what others are currently using for the same.

thanks
Madhurranjan