我正在尝试创建具有网络共享和Ansible的脱机Visual Studio 2017安装。
由于安装循环(?)没有太多日志记录,我很难弄清楚到底是怎么回事,日志常常含糊不清,而且经常告诉我引导程序正在从Microsoft下载文件。
我想知道是否有更简单的方法可以使用Ansible做到这一点。
我使用了Microsoft的以下指南来尝试理解事情:
可能有问题的问题:https://github.com/MicrosoftDocs/visualstudio-docs/issues/1531
设置:
我已经创建了一个可用的网络共享: \\ Share \ VisualStudio2017 \
该共享在测试过程中(当前)没有任何限制,因此,意味着“所有人”都可以读取其内容。
共享由以下布局命令填充
vs_enterprise.exe --layout \\<server>\Share\Development\VisualStudio2017 --lang en-US --add Microsoft.VisualStudio.Workload.ManagedDesktop --add Microsoft.VisualStudio.Workload.NativeDesktop --add Microsoft.VisualStudio.Workload.Universal --add Microsoft.VisualStudio.Workload.NetWeb Microsoft.VisualStudio.Workload.Node --add Microsoft.VisualStudio.Workload.NetCrossPlat --add Microsoft.VisualStudio.Workload.NetCoreTools --includeRecommended
将共享中的Response.json更新为
{
"installChannelUri": "\\<server>\\Share\\Development\\VisualStudio2017\\ChannelManifest.json",
"channelUri": "\\<server>\\Share\\Development\\VisualStudio2017\\ChannelManifest.json",
"installCatalogUri": "\\<server>\\Share\\Development\\VisualStudio2017\\Catalog.json",
"channelId": "VisualStudio.15.Release",
"productId": "Microsoft.VisualStudio.Product.Enterprise",
"add": [
"Microsoft.VisualStudio.Workload.ManagedDesktop;includeRecommended",
"Microsoft.VisualStudio.Workload.NativeDesktop;includeRecommended",
"Microsoft.VisualStudio.Workload.NetCoreTools;includeRecommended",
"Microsoft.VisualStudio.Workload.NetCrossPlat;includeRecommended",
"Microsoft.VisualStudio.Workload.NetWeb;includeRecommended",
"Microsoft.VisualStudio.Workload.Node;includeRecommended",
"Microsoft.VisualStudio.Workload.Universal;includeRecommended"
],
"addProductLang": [
"en-US"
]
}
份额与角色结合在一起
- name: Install Visual Studio 2017
win_package:
path: '\\<server>\share\Development\VisualStudio2017\vs_enterprise.exe'
state: present
product_id: Microsoft.VisualStudio.Product.Enterprise
channel_id: VisualStudio.15.Release
user_name: <DOMAIN>\<USERNAME>
user_password: <PASSWORD>
arguments:
# - --quiet
- --wait
- --norestart
# - --add Microsoft.VisualStudio.Workload.ManagedDesktop
# - --add Microsoft.VisualStudio.Workload.NativeDesktop
# - --add Microsoft.VisualStudio.Workload.Universal
# - --add Microsoft.VisualStudio.Workload.NetWeb Microsoft.VisualStudio.Workload.Node
# - --add Microsoft.VisualStudio.Workload.NetCrossPlat
# - --add Microsoft.VisualStudio.Workload.NetCoreTools
# - --includeRecommended
我正在使用具有详细设置的命令运行剧本
ansible-playbook -i hosts utvClients.yaml -vvvv
输出
TASK [VisualStudio2017 : Install Visual Studio 2017] ******************************************************************************************************************************************************
task path: /mnt/d/dev/Ansible/roles/VisualStudio2017/tasks/main.yaml:2
Using module file /usr/lib/python2.7/dist-packages/ansible/modules/windows/win_package.ps1
<192.168.56.101> ESTABLISH WINRM CONNECTION FOR USER: Ansible on PORT 5986 TO 192.168.56.101
checking if winrm_host 192.168.56.101 is an IPv6 address
EXEC (via pipeline wrapper)
主机路径为C:\ users \\ AppData \ Local \ Temp \ dd_bootstrapper_.log的主机上的引导程序日志说:
Beginning of the log. Start Time: 3/6/2019 9:43:56 AM
VisualStudio Bootstrapper:3/6/2019 9:43:57 AM: Commandline arguments = --wait,--norestart,--path cache="\\<server>\share\Development\VisualStudio2017\",--env,_SFX_CAB_EXE_PACKAGE:C:\Users\Ansible\tyzrpvdy.v4j _SFX_CAB_EXE_ORIGINALWORKINGDIR:C:\Users\Ansible
VisualStudio Bootstrapper:3/6/2019 9:43:57 AM: Parent process name = tyzrpvdy
VisualStudio Bootstrapper:3/6/2019 9:43:57 AM: Parent process product version = 15.9.28307.423
VisualStudio Bootstrapper:3/6/2019 9:43:57 AM: CampaignId =
VisualStudio Bootstrapper:3/6/2019 9:43:57 AM: ResponseId not available in 'vs_setup_bootstrapper.config'. Trying to parse filename.
VisualStudio Bootstrapper:3/6/2019 9:43:57 AM: loading config settings: -update --update --layout -offline --offline --locale --layout --originalworkingdir --installLayoutPath --env
VisualStudio Bootstrapper:3/6/2019 9:43:57 AM: DownloadURL = https://aka.ms/vs/15/release/installer
VisualStudio Bootstrapper:3/6/2019 9:43:57 AM: InstallLocation = C:\Program Files (x86)\Microsoft Visual Studio\Installer
VisualStudio Bootstrapper:3/6/2019 9:43:57 AM: OfflineFilePath =
VisualStudio Bootstrapper:3/6/2019 9:43:57 AM: LayoutLocation =
VisualStudio Bootstrapper:3/6/2019 9:43:57 AM: ExecutableArguments = /finalizeInstall install --in "C:\ProgramData\Microsoft\VisualStudio\Packages\_bootstrapper\vs_setup_bootstrapper_201903060943571796.json" --norestart "--path cache="\\<server>\share\Development\VisualStudio2017\"" --locale en-US --activityId "d3c1a7c6-22ba-42af-9ce9-7ede1608e7be"
VisualStudio Bootstrapper:3/6/2019 9:43:57 AM: OSVersion = Microsoft Windows NT 10.0.17763.0
VisualStudio Bootstrapper:3/6/2019 9:43:57 AM: Starting to detect the existing VS and .Net...
VisualStudio Bootstrapper:3/6/2019 9:43:57 AM: Finished detecting the existing VS and .Net
首先,DownloadUrl是否仍设置为aka.ms? 我没有适当地覆盖它吗?还有更多要考虑的事情吗?