Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server 2003 Does Not Work With Chef #7

Closed
moserke opened this issue Sep 22, 2012 · 8 comments
Closed

Server 2003 Does Not Work With Chef #7

moserke opened this issue Sep 22, 2012 · 8 comments

Comments

@moserke
Copy link

moserke commented Sep 22, 2012

Because symbolic links are not available in server 2003, more specifically mklink, chef-solo does not work as the c:\tmp\vagrant-chef-1* links do not create correctly. Need the option to be able to change location of chef-solo files.

@moserke
Copy link
Author

moserke commented Sep 23, 2012

As a work around to this issue I was able to get a chef-solo provisioning work with the following modifications. These modifications take many of the extended features of vagrant away, but could be potentially a basis for how to override the vagrant functions in the in the vagrant-windows gem.

Modify the chef-solo.bat file

copy chef-solo.bat to chef-solo-orig.bat
rename chef-solo to chef-solo-orig
edit chef-solo.bat to be only the line "chef-solo-orig %3 %4".  This strips the -c parameter from the vagrant call

Create a mklink.bat file

Create the file c:\windows\system32\mklink.bat
Place the line "echo Mounting %2 to %3 >> c:\Temp\mklink.log"

Create a solo.rb file

Create the file c:\etc\chef\solo.rb
Set cookbook_path "\\\\vboxsvr\\v-csc-1"
Set role_path "\\\\vboxsvr\\v-csr-2"
Set data_bag_path "\\\\vboxsvr\\v-csdb-3"

Set the following lines in the Vagrantfile

config.vm.share_folder "v-csc-1", "/tmp/vagrant-chef-1/chef-solo-1/cookbooks", "#{ENV['HOME'] || ENV['HOMEDRIVE']}/chef/chef-repo/cookbooks"
config.vm.share_folder "v-csr-2", "/tmp/vagrant-chef-1/chef-solo-2/roles", "#{ENV['HOME'] || ENV['HOMEDRIVE']}/chef/chef-repo/roles"
config.vm.share_folder "v-csdb-3", "/tmp/vagrant-chef-1/chef-solo-3/data_bags", "#{ENV['HOME'] || ENV['HOMEDRIVE']}/chef/chef-repo/data_bags"

Remove the following lines in the Vagrantfile

chef.cookbooks_path
chef.roles_path
chef.data_bags_path

This solution requires that v-csc-1 is set to cookbooks, v-csr-2 is set to roles and v-csdb-3 is set to data_bags

@pmorton
Copy link
Contributor

pmorton commented Sep 25, 2012

@leftathome Can you confirm this. I think that you are running on windows 2003 No?

@moserke
Copy link
Author

moserke commented Sep 25, 2012

Correct, this is windows server 2003. I should rephrase that it's not chef that does not run on server 2003 it's the vagrant/vagrant-windows things that don't work on server 2003 because it's calling in to the OS to do mklink. The workaround I posted above is what I had to do to get chef-solo to run on a server 2003 vagrant box.

@leftathome
Copy link

Unfortunately I can't confirm this as I don't have a 2003 image handy. Our test framework is 2008R2-centric and concerned primarily with getting chef-client to run on a node. Version-specific features can be added via distro_dispatch without resorting to even more monkey-patching -- I added 2003 just as an example. Should be possible to patch in support for just about any other version of Windows.

@moserke, you might want to give my fork of this module a try and see if it fixes anything for you ... or, at least, that it's easier to work on.

It might not be, since you're using chef-solo and I'm using chef-client, but it might be worth a try anyway. (Good luck!)

@pmorton
Copy link
Contributor

pmorton commented Apr 30, 2013

@moserke It seems that using junction (from sysinternals) *could solve this problem. Are you interested in making a PR for it?

@pmorton
Copy link
Contributor

pmorton commented May 3, 2013

@moserke I am considering simply not supporting windows 2003. The problem that I run into is that I do not use windows 2003 in any of my environments and hence I do not have the testing resources to maintain this. I certainly would not be in objection to accepting a pull request that addresses this incompatibility. If I where implementing this, I would probably do a P/Invoke for creating junctions from powershell and add it to the resource script.

@moserke
Copy link
Author

moserke commented May 3, 2013

Yeah, the issue with this is that server 2003 does not allow remote paths/UNCs in their junctions. So although you can create the junction you can not map it to the virtualbox \vboxsvr path. I think we may have hit a wall on getting this fully supported in the same mode as server 2008. Maybe just putting a "Server 2003 Not Supported" is sufficient, people won't try that way. Besides, it's a ten year old OS right. :-)

@pmorton
Copy link
Contributor

pmorton commented May 3, 2013

Updated the README with the supported operating systems. Thanks for the feedback.

@pmorton pmorton closed this as completed May 3, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants