通过 Ansible 的 VirtualBox 静默安装失败?
VirtualBox silent install via Ansible fails?
$ ansible --version
ansible 2.10.8
根据 Oracle VM VirtualBox 6.1 Silent Install (How-To Guide),我应该可以像这样静默安装 VirtualBox
C:\temp> VirtualBox-6.1.28-147628-Win.exe --silent --ignore-reboot
如果我 运行 在 Windows 命令提示符下执行上述命令,它会成功并安装 VirtualBox。
现在我在 Ansible 中执行此操作
- name: "Install {{ artifact_filename }}"
win_package:
path: "C:\temp\VirtualBox-6.1.28-147628-Win.exe"
arguments: "--silent --ignore-reboot"
state: present
当我 运行 带有任务的剧本时,我得到了这个。
fatal: [10.227.x.x]: FAILED! => {
"changed": false,
"invocation": {
"module_args": {
"arguments": "--silent --ignore-reboot",
"chdir": null,
"client_cert": null,
"client_cert_password": null,
"creates_path": null,
"creates_service": null,
"creates_version": null,
"expected_return_code": [
0,
3010
],
"follow_redirects": "safe",
"force_basic_auth": false,
"headers": null,
"http_agent": "ansible-httpget",
"log_path": null,
"maximum_redirection": 50,
"password": null,
"path": "C:\temp\VirtualBox-6.1.28-147628-Win.exe",
"product_id": null,
"provider": "auto",
"proxy_password": null,
"proxy_url": null,
"proxy_use_default_credential": false,
"proxy_username": null,
"state": "present",
"url_method": null,
"url_password": null,
"url_timeout": 30,
"url_username": null,
"use_default_credential": false,
"use_proxy": true,
"username": null,
"validate_certs": true,
"wait_for_children": false
}
},
"msg": "unexpected rc from 'C:\temp\VirtualBox-6.1.28-147628-Win.exe --silent --ignore-reboot': see rc, stdout, and stderr for more details",
"rc": 1,
"reboot_required": false,
"stderr": "",
"stderr_lines": [],
"stdout": "",
"stdout_lines": []
}
我错过了什么? TIA.
我对 win_package documentation 进行了 RTFM。它说关于 arguments
选项
arguments This is only used for the msi, msp, and registry providers.
所以我改为这样做
- name: "Install VirtualBox"
win_command: "C:\temp\VirtualBox-6.1.28-147628-Win.exe --silent --ignore-reboot"
如果有人有更好的答案,我会全神贯注。
$ ansible --version
ansible 2.10.8
根据 Oracle VM VirtualBox 6.1 Silent Install (How-To Guide),我应该可以像这样静默安装 VirtualBox
C:\temp> VirtualBox-6.1.28-147628-Win.exe --silent --ignore-reboot
如果我 运行 在 Windows 命令提示符下执行上述命令,它会成功并安装 VirtualBox。
现在我在 Ansible 中执行此操作
- name: "Install {{ artifact_filename }}"
win_package:
path: "C:\temp\VirtualBox-6.1.28-147628-Win.exe"
arguments: "--silent --ignore-reboot"
state: present
当我 运行 带有任务的剧本时,我得到了这个。
fatal: [10.227.x.x]: FAILED! => {
"changed": false,
"invocation": {
"module_args": {
"arguments": "--silent --ignore-reboot",
"chdir": null,
"client_cert": null,
"client_cert_password": null,
"creates_path": null,
"creates_service": null,
"creates_version": null,
"expected_return_code": [
0,
3010
],
"follow_redirects": "safe",
"force_basic_auth": false,
"headers": null,
"http_agent": "ansible-httpget",
"log_path": null,
"maximum_redirection": 50,
"password": null,
"path": "C:\temp\VirtualBox-6.1.28-147628-Win.exe",
"product_id": null,
"provider": "auto",
"proxy_password": null,
"proxy_url": null,
"proxy_use_default_credential": false,
"proxy_username": null,
"state": "present",
"url_method": null,
"url_password": null,
"url_timeout": 30,
"url_username": null,
"use_default_credential": false,
"use_proxy": true,
"username": null,
"validate_certs": true,
"wait_for_children": false
}
},
"msg": "unexpected rc from 'C:\temp\VirtualBox-6.1.28-147628-Win.exe --silent --ignore-reboot': see rc, stdout, and stderr for more details",
"rc": 1,
"reboot_required": false,
"stderr": "",
"stderr_lines": [],
"stdout": "",
"stdout_lines": []
}
我错过了什么? TIA.
我对 win_package documentation 进行了 RTFM。它说关于 arguments
选项
arguments This is only used for the msi, msp, and registry providers.
所以我改为这样做
- name: "Install VirtualBox"
win_command: "C:\temp\VirtualBox-6.1.28-147628-Win.exe --silent --ignore-reboot"
如果有人有更好的答案,我会全神贯注。