Skip to content

Instantly share code, notes, and snippets.

@Wenzel
Created July 3, 2018 12:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Wenzel/e6069273a569d3607fbec537c2ebce4b to your computer and use it in GitHub Desktop.
Save Wenzel/e6069273a569d3607fbec537c2ebce4b to your computer and use it in GitHub Desktop.
Packer WinRM connection_plugin for Ansible - Ansible v2.5.0 - ./packer build windows10.json
qemu output will be in this color.
==> qemu: Downloading or copying ISO
qemu: Found already downloaded, initial checksum matched, no download needed: http://care.dlservice.microsoft.com/dl/download/C/3/9/C399EEA8-135D-4207-92C9-6AAB3259F6EF/10240.16384.150709-1700.TH1_CLIENTENTERPRISEEVAL_OEMRET_X64FRE_EN-US.ISO
==> qemu: Creating floppy disk...
qemu: Copying files flatly from floppy_files
qemu: Copying file: ./answer_files/10/Autounattend.xml
qemu: Copying file: scripts/fixnetwork.ps1
qemu: Copying file: scripts/setup_winrm_public.bat
qemu: Done copying files from floppy_files
qemu: Collecting paths from floppy_dirs
qemu: Resulting paths from floppy_dirs : []
qemu: Done copying paths from floppy_dirs
==> qemu: Creating hard drive...
==> qemu: Found port for communicator (SSH, WinRM, etc): 4444.
==> qemu: Looking for available port between 5900 and 6000 on 127.0.0.1
==> qemu: Starting VM, booting from CD-ROM
qemu: The VM will be run headless, without a GUI. If you want to
qemu: view the screen of the VM, connect via VNC without a password to
qemu: vnc://127.0.0.1:5906
==> qemu: Overriding defaults Qemu arguments with QemuArgs...
==> qemu: Waiting 10s for boot...
==> qemu: Connecting to VM via VNC
==> qemu: Typing the boot command over VNC...
==> qemu: Waiting for WinRM to become available...
qemu: WinRM connected.
qemu: #< CLIXML
qemu: <Objs Version="1.1.0.1" xmlns="http://schemas.microsoft.com/powershell/2004/04"><Obj S="progress" RefId="0"><TN RefId="0"><T>System.Management.Automation.PSCustomObject</T><T>System.Object</T></TN><MS><I64 N="SourceId">1</I64><PR N="Record"><AV>Preparing modules for first use.</AV><AI>0</AI><Nil /><PI>-1</PI><PC>-1</PC><T>Completed</T><SR>-1</SR><SD> </SD></PR></MS></Obj><Obj S="progress" RefId="1"><TNRef RefId="0" /><MS><I64 N="SourceId">1</I64><PR N="Record"><AV>Preparing modules for first use.</AV><AI>0</AI><Nil /><PI>-1</PI><PC>-1</PC><T>Completed</T><SR>-1</SR><SD> </SD></PR></MS></Obj></Objs>
==> qemu: Connected to WinRM!
==> qemu: Provisioning with Ansible...
==> qemu: Executing Ansible: ansible-playbook --extra-vars packer_build_name=qemu packer_builder_type=qemu -i /tmp/packer-provisioner-ansible118319715 /home/tarrma/tmp/bug_packer/ansible/site.yml -e ansible_ssh_private_key_file=/tmp/ansible-key407739924 --connection=packer --extra-vars ansible_shell_type=powershell ansible_shell_executable=None -v
qemu: No config file found; using defaults
qemu:
qemu: PLAY [all] *********************************************************************
qemu:
qemu: TASK [Gathering Facts] *********************************************************
qemu: An exception occurred during task execution. To see the full traceback, use -vvv. The error was: KeyError: 'connection'
qemu: fatal: [default]: FAILED! => {"msg": "Unexpected failure during module execution.", "stdout": ""}
qemu: to retry, use: --limit @/home/tarrma/tmp/bug_packer/ansible/site.retry
qemu:
qemu: PLAY RECAP *********************************************************************
qemu: default : ok=0 changed=0 unreachable=0 failed=1
qemu:
==> qemu: Deleting output directory...
Build 'qemu' errored: Error executing Ansible: Non-zero exit status: exit status 2
==> Some builds didn't complete successfully and had errors:
--> qemu: Error executing Ansible: Non-zero exit status: exit status 2
==> Builds finished but no artifacts were created.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment