Provide username and password for chef recipe -
i'm using chef's windows cookbook provision windows servers. here's recipe:
# windows sdk windows 7 , .net 4 - .net tools v4 windows_package "windows sdk windows 7 , .net 4 - .net tools v4" source "\\\\myserver\\mydrive\\chef\\winsdknetfx40tools_amd64\\winsdk_nfx40tools_amd64.msi" installer_type :msi action :install end the problem i'm running permissions error when trying access unc path. possible provide username/password windows_package can tell access share as? i've tried store credentials via credentials manager, that's not working.
windows not allow credentials included directly in unc path. there not appear chef support authenticating while accessing files on unc paths.
chef's mount resource supports mounting remote path. allows passing username , password on windows. mount unc path before windows_package call , reference mounted drive path instead of unc path.
untested example:
mount "z:" action :mount device "\\\\myserver\\mydrive\\chef\\winsdknetfx40tools_amd64\\" username "whoever" password "whatever" end windows_package "windows sdk windows 7 , .net 4 - .net tools v4" source "z:\\winsdk_nfx40tools_amd64.msi" installer_type :msi action :install end mount resource documentation: http://docs.opscode.com/resource_mount.html
mount resource source: https://github.com/opscode/chef/blob/807891d08dc5c436da237ec8a09639cea87a04fa/lib/chef/provider/mount/windows.rb#l60
Comments
Post a Comment