Git   发布时间:2022-04-04  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了针对虚拟机中的Windows 8.1 VM的Packerpipe理员问题大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

为了提供关于安装的一些背景知识,我正尝试使用VirtualBox作为提供程序和Ansible作为提供程序,从本地MACBook启动装有Packer的Windows 8.1(x64)VM。 我已经用Packer(没有Ansible提供程序)tesTing了Windows版本,它可以成功运行。

但是,当我尝试使用可靠的configuration器(不是本地的)时,我无法这样做。 我已经安装了packer文档中指定的packer版本: https ://www.packer.io/docs/provisioners/ansible.html。 我还运行Windows VM第一次启动时在http://docs.ansible.com/ansible/intro_windows.html#windows-system-prep中提到的ConfigureRemoTingForAnsible.ps1。

我的技术栈版本是:

Packer 1.0.0

Ansible 2.3.0.0

Python 2.7.11

pywinrm 0.2.2

VirtualBox 5.1.20

packer.json文件如下

Qt包装的Windows平台

Java应用程序最快的服务包装

同时从多个应用程序访问摄像头

打包使用ImageMagick C API的应用程序

为Ubuntu打包 – Web应用程序

{ "builders": [ { "type": "virtualBox-iso","iso_url": "{{ user `iso_url` }}","iso_checksum_type": "sha1","iso_checksum": "{{ user `iso_checksum` }}","communicator": "winrm","headless": "{{ user `headless` }}","boot_wait": "9m","winrm_use_ssl": true,"winrm_insecure": true,"winrm_host": "127.0.0.1","winrm_port": 5986,"winrm_username": "packer","winrm_password": "packer","winrm_timeout": "8h","shutdown_command": "shutdown /s /t 10 /f /dp:4:1 /c "Packer Shutdown"","guest_os_type": "Windows81_64","guest_additions_mode": "disable","floppy_files": [ "./answer_files/81/Autounattend.xml","./scripts/enable-winrm.ps1","./scripts/ConfigureRemoTingForAnsible.ps1" ],"v@L_600_0@manage": [ [ "modifyvm","{{.NamE}}","--natpf1","winrm,tcp,5986,5986" ],[ "modifyvm","--memory","4096" ],"--vram","32" ],"--cpus","2" ] ] } ],"provisioners": [ { "type": "ansible","playbook_file": "./provisioner/run-powersHell.yml","local_port": "5986","user": "packer","extra_arguments": [ "-vvvv","--connection","packer","--extra-vars","ansible_sHell_type=powersHell ansible_sHell_executable=None" ] } ],"post-processors": [ { "type": "vagrant","keep_input_artifact": true,"output": "output-formats/windows_81_{{.Provider}}.Box","vagrantfile_template": "vagrantfile-windows_81.template" } ],"variables": { "headless": "false","iso_checksum": "checKSUM_VALUE","iso_url": "/path/to/iso" } }

run-powersHell.yml手册是:

# This playbook tests the script module on Windows hosts - name: Run Ansible play hosts: all gather_facts: no tasks: - name: Ping windows machine win_command: cmd.exe /c powersHell -Command "Write-Host 'Hello World!'" # - name: Ping windows machine # win_ping: # - name: Create a file # win_file: # path: "C:\Windows\Temp\ansible_test.txt" # state: touch # - name: Run powersHell script # script: a:Helloworld.ps1

在packer.log中看到的错误的最后一部分是:

ui: [0;32m virtualBox-iso: <127.0.0.1> (1,'{"exception":"At C:\\Users\\packer\\ApPDAta\\Local\\Temp\\ansible-tmp-1493195766.64-166408222728325\\win_command.ps1:25 char:16\r\n+ $parsed_args = Parse-Args $args $false\r\n+ ~~~~~~~~~~","msg":"The term \u0027Parse-Args\u0027 is not recognized as the name of a cmdlet,function,script file,or operable program. check the spelling of the name,or if a path was included,verify that the path is correct and try again.","Failed":truE}rn','OpenSSH_6.9p1,LibreSSL 2.1.8rndebug1: Reading configuration data /Users/mk/.ssh/configrndebug1: Reading configuration data /etc/ssh/ssh_configrndebug1: /etc/ssh/ssh_config line 21: Applying options for *rndebug1: auto-mux: Trying exisTing masterrndebug2: fd 3 setTing O_NONBLOCKrndebug2: mux_client_Hello_exchange: master version 4rndebug3: mux_client_forWARDs: request forWARDings: 0 local,0 remoterndebug3: mux_client_request_session: enteringrndebug3: mux_client_request_alive: enteringrndebug3: mux_client_request_alive: done pid = 7498rndebug3: mux_client_request_session: session request sentrndebug1: mux_client_request_session: master session id: 2rndebug3: mux_client_read_packet: read header Failed: Broken piperndebug2: Received exit status froR_639_11845@ master 1rnShared connection to 127.0.0.1 closed.rn')[0m ui: [0;32m virtualBox-iso: The full traceBACk is:[0m ui: [0;32m virtualBox-iso: At C:UserspackerApPDAtaLocalTempansible-tmp-1493195766.64-166408222728325win_command.ps1:25 char:16[0m ui: [0;32m virtualBox-iso: + $parsed_args = Parse-Args $args $false[0m ui: [0;32m virtualBox-iso: + ~~~~~~~~~~[0m ui: [0;32m virtualBox-iso: fatal: [default]: Failed! => {[0m ui: [0;32m virtualBox-iso: "changed": false,[0m ui: [0;32m virtualBox-iso: "Failed": true,[0m ui: [0;32m virtualBox-iso: "msg": "The term 'Parse-Args' is not recognized as the name of a cmdlet,verify that the path is correct and try again."[0m ui: [0;32m virtualBox-iso: }[0m ui: [0;32m virtualBox-iso: to retry,use: --limit @/Users/mk/Workspace/packer/win81/provisioner/run-powersHell.retrY[0m ui: [0;32m virtualBox-iso:[0m ui: [0;32m virtualBox-iso: PLAY RECAP *********************************************************************[0m ui: [0;32m virtualBox-iso: default : ok=0 changed=0 unreachable=0 Failed=1[0m ui: [0;32m virtualBox-iso:[0m packer: 2017/04/26 18:36:31 shutTing down the SSH proxy packer: 2017/04/26 18:36:31 ExecuTing V@L_600_0@manage: []String{"controlvm","packer-virtualBox-iso-1493195197","poweroff"}

没有任何可执行的Windows任务(在Windows VM上执行为.ps1)能够执行,并且接收到与上述相同的错误(请参阅我的操作手册中的注释行)。 它们都是Parse-Args cmdlet上的错误,这是一个标准的PowersHell函数,但由于某些原因无法在Windows 8.1 vm上识别。

仅供参:我也尝试在端口5985(没有SSL)上运行winrm,并得到相同的错误

任何帮助过去这个问题将不胜感激。

通过debian包提供系统范围的vim语法高亮显示

rpmbuild安装(但未封装)的文件

Linux中的沙盒技术:snappy vs flatpak比较?

在Windows上使用内置python构build软件安装程序

蓝牙服务器应用程序接受移动设备的连接

有同样的确切问题。 我发现在Ansible的最新版本中爆发了一些东西。 我将Ansible安装降级到2.2.0,并按照Packer文档的预期工作。

大佬总结

以上是大佬教程为你收集整理的针对虚拟机中的Windows 8.1 VM的Packerpipe理员问题全部内容,希望文章能够帮你解决针对虚拟机中的Windows 8.1 VM的Packerpipe理员问题所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。
标签: