Ansible win_package 通知更改但不安装
Ansible win_package notifies change but does not install
我正在使用 ansible > win_package 方法安装 visual studio 2013、2015、2017 和 2019。对于 VS2017 和 2019 安装,win_package 通知更改但没有更改发生服务器。该任务的运行时间不到 1 分钟,而实际安装需要 5-10 分钟。这可能是什么原因?
此外,这个 github 线程也有类似的问题,但没有解决方案。 https://github.com/ansible/ansible/issues/51385
VS INSTALLER TASK
- name: VS Installer
win_package:
path: 'D:\Software\VisualStudio\ansible\install\{{ item.year }}\{{ item.installer_name }}'
creates_path: "{{ item.create_path }}"
state: present
arguments: "{{ item.args }}"
loop: "{{ visualstudio }}"
VARIABLES FILE
- year: "2017"
eng_serv_path: network file share
create_path: 'C:\Program Files (x86)\Microsoft Visual Studio17\Enterprise\Common7\IDE\devenv.exe'
installer_name: vs_enterprise.exe
product_key: product key
version: enterprise
args: '--in D:\Software\VisualStudio\ansible\install17\Response_vs2017.json'
- year: "2019"
eng_serv_path: network file share
create_path: 'C:\Program Files (x86)\Microsoft Visual Studio19\Enterprise\Common7\IDE\devenv.exe'
installer_name: vs_enterprise__25978676.1624374836.exe
product_key: product key
version: enterprise
args: '--in D:\Software\VisualStudio\ansible\install19\Response_vs2019.json'
OUTPUT EXAMPLE
changed: [IP address] => (item={u'eng_serv_path': u'network file share', u'version': u'enterprise', u'installer_name': u'vs_enterprise__25978676.1624374836.exe', u'create_path': u'C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\devenv.exe', u'year': u'2019', u'args': u'--in D:\Software\VisualStudio\ansible\install\2019\Response_vs2019.json', u'product_key': u'product key'}) => {
"ansible_loop_var": "item",
"changed": true,
"item": {
"args": "--in D:\Software\VisualStudio\ansible\install\2019\Response_vs2019.json",
"create_path": "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\devenv.exe",
"eng_serv_path": "network file share",
"installer_name": "vs_enterprise__25978676.1624374836.exe",
"product_key": "product key",
"version": "enterprise",
"year": "2019"
},
"rc": 0,
"reboot_required": false
}
我找到的解决方案不是使用响应文件,而是直接传递参数并且有效
我正在使用 ansible > win_package 方法安装 visual studio 2013、2015、2017 和 2019。对于 VS2017 和 2019 安装,win_package 通知更改但没有更改发生服务器。该任务的运行时间不到 1 分钟,而实际安装需要 5-10 分钟。这可能是什么原因?
此外,这个 github 线程也有类似的问题,但没有解决方案。 https://github.com/ansible/ansible/issues/51385
VS INSTALLER TASK
- name: VS Installer
win_package:
path: 'D:\Software\VisualStudio\ansible\install\{{ item.year }}\{{ item.installer_name }}'
creates_path: "{{ item.create_path }}"
state: present
arguments: "{{ item.args }}"
loop: "{{ visualstudio }}"
VARIABLES FILE
- year: "2017"
eng_serv_path: network file share
create_path: 'C:\Program Files (x86)\Microsoft Visual Studio17\Enterprise\Common7\IDE\devenv.exe'
installer_name: vs_enterprise.exe
product_key: product key
version: enterprise
args: '--in D:\Software\VisualStudio\ansible\install17\Response_vs2017.json'
- year: "2019"
eng_serv_path: network file share
create_path: 'C:\Program Files (x86)\Microsoft Visual Studio19\Enterprise\Common7\IDE\devenv.exe'
installer_name: vs_enterprise__25978676.1624374836.exe
product_key: product key
version: enterprise
args: '--in D:\Software\VisualStudio\ansible\install19\Response_vs2019.json'
OUTPUT EXAMPLE
changed: [IP address] => (item={u'eng_serv_path': u'network file share', u'version': u'enterprise', u'installer_name': u'vs_enterprise__25978676.1624374836.exe', u'create_path': u'C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\devenv.exe', u'year': u'2019', u'args': u'--in D:\Software\VisualStudio\ansible\install\2019\Response_vs2019.json', u'product_key': u'product key'}) => {
"ansible_loop_var": "item",
"changed": true,
"item": {
"args": "--in D:\Software\VisualStudio\ansible\install\2019\Response_vs2019.json",
"create_path": "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\devenv.exe",
"eng_serv_path": "network file share",
"installer_name": "vs_enterprise__25978676.1624374836.exe",
"product_key": "product key",
"version": "enterprise",
"year": "2019"
},
"rc": 0,
"reboot_required": false
}
我找到的解决方案不是使用响应文件,而是直接传递参数并且有效