Re: [packer] Shell provisioner: invalid character '*' after array element

2019-08-13 Thread Rickard von Essen
You need to escape double quotes in json with \.

I recommend that you don't use inline for anything but trivial commands,
instead use scripts.

On Wed, Aug 14, 2019, 07:18 Tekchand Dagar  wrote:

> Hello Team,
>
> I am encoding my ruby code using rubyencoder and its create ".bak" file
> which contain our actual code. So i need to delete all the ".bak" extension
> file. I am using shell provisioner to do this. Below is my shell
> provisioner:
>
> {
> "type": "shell",
> "inline": [
> "sleep 10",
> "sudo /home/deploy/rubyencoder-evaluation/bin/rubyencoder -r
> /home/deploy/mobilock-app/app/controllers/",
> "sudo find /home/deploy/mobilock-app/app/controllers/ -type f
> -name "*.bak" -delete"
>]
> },
>
>
> But when i am validating my .json file i am getting below error:
>
> Failed to parse template: Error parsing JSON: invalid character '*' after
> array element
> At line 115, column 79 (offset 3858):
>   114: "sudo /home/deploy/rubyencoder-evaluation/bin/rubyencoder
> -r /home/deploy/mobilock-app/app/controllers/",
>   115: "sudo find /home/deploy/mobilock-app/app/controllers/ -type
> f -name "*
>
>   ^
>
>
> Can you please help me to fix this issue.
>
> Thanks.
>
> --
> This mailing list is governed under the HashiCorp Community Guidelines -
> https://www.hashicorp.com/community-guidelines.html. Behavior in
> violation of those guidelines may result in your removal from this mailing
> list.
>
> GitHub Issues: https://github.com/mitchellh/packer/issues
> IRC: #packer-tool on Freenode
> ---
> You received this message because you are subscribed to the Google Groups
> "Packer" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to packer-tool+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/15181494-93e1-45b5-acc2-41d4276ee0a5%40googlegroups.com
> 
> .
>

-- 
This mailing list is governed under the HashiCorp Community Guidelines - 
https://www.hashicorp.com/community-guidelines.html. Behavior in violation of 
those guidelines may result in your removal from this mailing list.

GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
--- 
You received this message because you are subscribed to the Google Groups 
"Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to packer-tool+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt9uNE5--wPYYCFgQbGacB_t9rV45XOYyisOvrJjkhxccw%40mail.gmail.com.


[packer] Shell provisioner: invalid character '*' after array element

2019-08-13 Thread Tekchand Dagar
Hello Team,

I am encoding my ruby code using rubyencoder and its create ".bak" file 
which contain our actual code. So i need to delete all the ".bak" extension 
file. I am using shell provisioner to do this. Below is my shell 
provisioner:

{
"type": "shell",
"inline": [
"sleep 10",
"sudo /home/deploy/rubyencoder-evaluation/bin/rubyencoder -r 
/home/deploy/mobilock-app/app/controllers/",
"sudo find /home/deploy/mobilock-app/app/controllers/ -type f -name 
"*.bak" -delete"
   ]
},


But when i am validating my .json file i am getting below error:

Failed to parse template: Error parsing JSON: invalid character '*' after 
array element
At line 115, column 79 (offset 3858):
  114: "sudo /home/deploy/rubyencoder-evaluation/bin/rubyencoder -r 
/home/deploy/mobilock-app/app/controllers/",
  115: "sudo find /home/deploy/mobilock-app/app/controllers/ -type 
f -name "*

^


Can you please help me to fix this issue.

Thanks.

-- 
This mailing list is governed under the HashiCorp Community Guidelines - 
https://www.hashicorp.com/community-guidelines.html. Behavior in violation of 
those guidelines may result in your removal from this mailing list.

GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
--- 
You received this message because you are subscribed to the Google Groups 
"Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to packer-tool+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/15181494-93e1-45b5-acc2-41d4276ee0a5%40googlegroups.com.


Re: [packer] Using Packer to build a windows box and provision with Ansible

2019-08-13 Thread deanwarrenuk
Just dawned on me, the IP is also available as {{.HTTPIP}} as used in the 
builder boot_command. Now whether this is available as where I am not 
sure...

On Tuesday, 13 August 2019 10:09:56 UTC+1, Richard Payne wrote:
>
> Actually, the IP is in the standard output, not even debug.
>
> No idea how you're supposed to use that though.
>
> On Tuesday, 13 August 2019 08:37:49 UTC+1, Richard Payne wrote:
>>
>> I'm not seeing the IP in the log.  However, it might provide some info on 
>> what's wrong with the Ansible provisioner?
>>
>>
>> 2019/08/13 07:37:43 packer: 2019/08/13 07:37:43 [DEBUG] Password is 
>> blank, will retry...
>> 2019/08/13 07:37:49 ui: amazon-ebs:
>> amazon-ebs: Password retrieved!
>> amazon-ebs:
>> amazon-ebs: Password retrieved!
>> ==> amazon-ebs: Waiting for WinRM to become available...
>> 2019/08/13 07:37:49 packer: 2019/08/13 07:37:49 Waiting for WinRM, up to 
>> timeout: 30m0s
>> 2019/08/13 07:37:49 ui: ==> amazon-ebs: Waiting for WinRM to become 
>> available...
>> 2019/08/13 07:37:54 packer: 2019/08/13 07:37:54 [INFO] Attempting WinRM 
>> connection...
>> 2019/08/13 07:37:54 packer: 2019/08/13 07:37:54 [DEBUG] connecting to 
>> remote shell using WinRM
>> 2019/08/13 07:38:01 ui: ==> amazon-ebs: Connected to WinRM!
>> 2019/08/13 07:38:01 packer: 2019/08/13 07:38:01 Running the provision hook
>> ==> amazon-ebs: Connected to WinRM!
>> 2019/08/13 07:38:01 [INFO] (telemetry) Starting provisioner ansible
>> 2019/08/13 07:38:01 ui: ==> amazon-ebs: Provisioning with Ansible...
>> ==> amazon-ebs: Provisioning with Ansible...
>> 2019/08/13 07:38:02 packer: 2019/08/13 07:38:02 SSH proxy: serving on 
>> 127.0.0.1:36005
>> 2019/08/13 07:38:02 ui: ==> amazon-ebs: Executing Ansible: 
>> ansible-playbook --extra-vars packer_build_name=amazon-ebs 
>> packer_builder_type=amazon-ebs -i /tmp/packer-provisioner-ansible774557480 
>> /home/richard/git/ansible/playbooks/windows_image_build/playbook.yml 
>> --private-key /tmp/ansible-key713730989 --extra-vars {'environment_name': 
>> 'packer', 'hosting_environment': 'aws', 'connection': 'packer'} --skip-tags 
>> gitchecks --skip-tags gather_facts --skip-tags slack
>> ==> amazon-ebs: Executing Ansible: ansible-playbook --extra-vars 
>> packer_build_name=amazon-ebs packer_builder_type=amazon-ebs -i 
>> /tmp/packer-provisioner-ansible774557480 
>> /home/richard/git/ansible/playbooks/windows_image_build/playbook.yml 
>> --private-key /tmp/ansible-key713730989 --extra-vars {'environment_name': 
>> 'packer', 'hosting_environment': 'aws', 'connection': 'packer'} --skip-tags 
>> gitchecks --skip-tags gather_facts --skip-tags slack
>> 2019/08/13 07:38:03 ui: amazon-ebs:  [WARNING]: Found variable using 
>> reserved name: connection
>> amazon-ebs:  [WARNING]: Found variable using reserved name: connection
>> amazon-ebs:
>> 2019/08/13 07:38:03 ui: amazon-ebs:
>> 2019/08/13 07:38:03 ui: amazon-ebs: PLAY [all] 
>> *
>> amazon-ebs: PLAY [all] 
>> *
>> 2019/08/13 07:38:03 ui: amazon-ebs:
>> amazon-ebs:
>> 2019/08/13 07:38:03 ui: amazon-ebs: TASK [Gathering Facts] 
>> *
>> amazon-ebs: TASK [Gathering Facts] 
>> *
>> 2019/08/13 07:38:03 packer: 2019/08/13 07:38:03 SSH proxy: accepted 
>> connection
>> 2019/08/13 07:38:03 packer: 2019/08/13 07:38:03 authentication attempt 
>> from 127.0.0.1:41696 to 127.0.0.1:36005 as richard using none
>> 2019/08/13 07:38:03 packer: 2019/08/13 07:38:03 authentication attempt 
>> from 127.0.0.1:41696 to 127.0.0.1:36005 as richard using publickey
>> 2019/08/13 07:38:03 packer: 2019/08/13 07:38:03 new env request: 
>> LANG=en_GB.UTF-8
>> 2019/08/13 07:38:03 packer: 2019/08/13 07:38:03 new exec request: /bin/sh 
>> -c 'echo ~richard && sleep 0'
>> 2019/08/13 07:38:03 packer: 2019/08/13 07:38:03 [INFO] starting remote 
>> command: /bin/sh -c 'echo ~richard && sleep 0'
>> 2019/08/13 07:38:03 packer: 2019/08/13 07:38:03 [INFO] command '/bin/sh 
>> -c 'echo ~richard && sleep 0'' exited with code: 1
>> 2019/08/13 07:38:03 packer: 2019/08/13 07:38:03 [INFO] RPC endpoint: 
>> Communicator ended with: 1
>> 2019/08/13 07:38:03 [INFO] 0 bytes written for 'stdout'
>> 2019/08/13 07:38:03 [INFO] 44 bytes written for 'stderr'
>> 2019/08/13 07:38:03 [INFO] RPC client: Communicator ended with: 1
>> 2019/08/13 07:38:03 [INFO] RPC endpoint: Communicator ended with: 1
>> 2019/08/13 07:38:03 [INFO] 0 bytes written for 'stdin'
>> 2019/08/13 07:38:03 packer: 2019/08/13 07:38:03 [INFO] 0 bytes written 
>> for 'stdout'
>> 2019/08/13 07:38:03 packer: 2019/08/13 07:38:03 [INFO] 44 bytes written 
>> for 'stderr'
>> 2019/08/13 07:38:03 packer: 2019/08/13 07:38:03 [INFO] RPC client: 
>> Communicator ended with: 1
>> 2019/08/13 07:38:03 packer: 2019/08/13 07:38:03 [INFO] 0 byt

Re: [packer] Using Packer to build a windows box and provision with Ansible

2019-08-13 Thread John Roh
I had the tough time to make this working as well, however, I am on packer
1.4.0 and ansible 2.4.0 (any upper version I have tried all failed).
Also, I could check the inbound rule to make sure 5985 or 5986 (https)
which ever you defined ("winrm_port" : 5986, I don't see from your
template).

John.

On Tue, Aug 13, 2019 at 5:47 AM deanwarrenuk 
wrote:

> This is interesting - is this related?
>
>
>
> https://stackoverflow.com/questions/50431469/getting-ip-address-of-the-aws-instance-when-using-packer-and-ansible
>
>
> --
> This mailing list is governed under the HashiCorp Community Guidelines -
> https://www.hashicorp.com/community-guidelines.html. Behavior in
> violation of those guidelines may result in your removal from this mailing
> list.
>
> GitHub Issues: https://github.com/mitchellh/packer/issues
> IRC: #packer-tool on Freenode
> ---
> You received this message because you are subscribed to the Google Groups
> "Packer" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to packer-tool+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/e13608ae-3040-46e9-a9c1-0faa8e676a51%40googlegroups.com
> 
> .
>

-- 
This mailing list is governed under the HashiCorp Community Guidelines - 
https://www.hashicorp.com/community-guidelines.html. Behavior in violation of 
those guidelines may result in your removal from this mailing list.

GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
--- 
You received this message because you are subscribed to the Google Groups 
"Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to packer-tool+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CAPxBRp47bLO_gRE5chPoPTJV_pMz2-m5c4Ds8mfeMwrFkbeWBQ%40mail.gmail.com.


Re: [packer] The new AMI is Building But Not Visible Using describe-images. Any ideas?

2019-08-13 Thread Rickard von Essen
This is 99% sure a permission issue with the credentials you are using to
run the aws cli. Double check that.

On Tue, Aug 13, 2019, 03:51 David Medinets  wrote:

> I am using the following JSON file to build an AMI which should be a copy
> of the Amazon Linux 2 AMI. The messages say the new AMI is built but it is
> not found when using describe-images - even five minutes later. I am
> passing the AWS credentials using the AWS_PROFILE env variable.
>
> The process seems dead simple. What am I doing wrong?
>
> -- example.json --
> {
>   "variables": {
> "aws_access_key": "",
> "aws_secret_key": ""
>   },
>   "builders": [{
> "type": "amazon-ebs",
> "access_key": "{{user `aws_access_key`}}",
> "secret_key": "{{user `aws_secret_key`}}",
> "region": "us-east-1",
> "source_ami": "ami-0b898040803850657",
> "instance_type": "t2.micro",
> "ssh_username": "ec2-user",
> "ami_name": "dmm-packer-example-{{timestamp}}"
>   }]
> }
>
> The output from is:
>
> -- packer build example.json --
> amazon-ebs output will be in this color.
>
> ==> amazon-ebs: Prevalidating AMI Name...
> amazon-ebs: Found Image ID: ami-0b898040803850657
> ==> amazon-ebs: Creating temporary keypair:
> packer_5d52168d-886b-7207-f14a-79d068c30677
> ==> amazon-ebs: Creating temporary security group for this instance:
> packer_5d52168e-2e7b-01b3-b40a-b3461f6d2e04
> ==> amazon-ebs: Authorizing access to port 22 on the temporary security
> group...
> ==> amazon-ebs: Launching a source AWS instance...
> amazon-ebs: Instance ID: i-080c2485a8759a2c7
> ==> amazon-ebs: Waiting for instance (i-080c2485a8759a2c7) to become
> ready...
> ==> amazon-ebs: Adding tags to source instance
> amazon-ebs: Adding tag: "Name": "Packer Builder"
> ==> amazon-ebs: Waiting for SSH to become available...
> ==> amazon-ebs: Connected to SSH!
> ==> amazon-ebs: Stopping the source instance...
> amazon-ebs: Stopping instance, attempt 1
> ==> amazon-ebs: Waiting for the instance to stop...
> ==> amazon-ebs: Creating the AMI: dmm-packer-example-1565660813
> amazon-ebs: AMI: ami-0b1ff7d63a5da8f06
> ==> amazon-ebs: Waiting for AMI to become ready...
> ==> amazon-ebs: Terminating the source AWS instance...
> ==> amazon-ebs: Cleaning up any extra volumes...
> ==> amazon-ebs: No volumes to clean up, skipping
> ==> amazon-ebs: Deleting temporary security group...
> ==> amazon-ebs: Deleting temporary keypair...
> Build 'amazon-ebs' finished.
>
> ==> Builds finished. The artifacts of successful builds are:
> --> amazon-ebs: AMIs were created:
>
> us-east-1: ami-0b1ff7d63a5da8f06
>
> -- aws ec2 describe-images --region us-east-1
> --image-ids ami-0b1ff7d63a5da8f06
> {
> "Images": []
> }
>
> --
> This mailing list is governed under the HashiCorp Community Guidelines -
> https://www.hashicorp.com/community-guidelines.html. Behavior in
> violation of those guidelines may result in your removal from this mailing
> list.
>
> GitHub Issues: https://github.com/mitchellh/packer/issues
> IRC: #packer-tool on Freenode
> ---
> You received this message because you are subscribed to the Google Groups
> "Packer" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to packer-tool+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/52728485-195c-47af-9576-d6aae04e312c%40googlegroups.com
> 
> .
>

-- 
This mailing list is governed under the HashiCorp Community Guidelines - 
https://www.hashicorp.com/community-guidelines.html. Behavior in violation of 
those guidelines may result in your removal from this mailing list.

GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
--- 
You received this message because you are subscribed to the Google Groups 
"Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to packer-tool+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt_qG_fxcxF2uifLj5PrgbS883tb0o2WUW1568bYe1sccQ%40mail.gmail.com.


Re: [packer] Windows2016 guest on RHEL linux host never ending winrm loop

2019-08-13 Thread Automationbuilder360 Builder
Yes..! when i try to boot VBOX VM with the ISO the server crashes again.. ( 
When on windows host )
but when on RHEL host ( The VM gets crated but waits on winrm endless )..!


BTW, this ISO runs just find on VMWARE environment.
it is customized such a way that it will not wait for any input and 
completes the whole installation.


On Tuesday, 13 August 2019 19:45:49 UTC+5:30, Rickard von Essen wrote:
>
> Can you run and install windows manually in virtualbox? Seem like you have 
> problems with that? 
>
> On Tue, Aug 13, 2019, 15:49 Automationbuilder360 Builder <
> automation...@gmail.com > wrote:
>
>> Hi Rickard,
>>
>> To verify the "headless Flase" mode i tried this on windows 2016 host VM 
>> as well.
>> but as soon i attach the iso the VM gets crashed with no updates.
>>
>> BTW "--on-error=ask" was not of much help. as it never asked for any 
>> input.
>>
>> and the last few lines of output from VBOX.log is here.
>>
>> 00:00:00.394503 *** End of VT-x features 
>> 
>> 00:00:00.396851 PcBios: ATA LUN#0 LCHS=1024/255/63
>> 00:00:00.396924 APIC: fPostedIntrsEnabled=false 
>> fVirtApicRegsEnabled=false fSupportsTscDeadline=false
>> 00:00:00.396933 TMR3UtcNow: nsNow=1 565 703 281 470 031 000 nsPrev=0 -> 
>> cNsDelta=1 565 703 281 470 031 000 (offLag=0 offVirtualSync=0 
>> offVirtualSyncGivenUp=0, NowAgain=1 565 703 281 470 031 000)
>> 00:00:00.396945 VMEmt: Halt method global1 (5)
>> 00:00:00.396986 VMEmt: HaltedGlobal1 config: cNsSpinBlockThresholdCfg=2000
>> 00:00:00.397019 Changing the VM state from 'CREATING' to 'CREATED'
>> 00:00:00.403717 Changing the VM state from 'CREATED' to 'POWERING_ON'
>> 00:00:00.404306 Changing the VM state from 'POWERING_ON' to 'RUNNING'
>> 00:00:00.404319 Console: Machine state changed to 'Running'
>> 00:00:00.410651 VMMDev: Guest Log: BIOS: VirtualBox 6.0.4
>> 00:00:00.410980 PCI: Setting up resources and interrupts
>> 00:00:00.411473 PIT: mode=2 count=0x1 (65536) - 18.20 Hz (ch=0)
>> 00:00:00.433895 Display::handleDisplayResize: uScreenId=0 
>> pvVRAM= w=720 h=400 bpp=0 cbLine=0x0 flags=0x0
>> 00:00:00.452285 VMMDev: Guest Log: CPUID EDX: 0x178bfbff
>> 00:00:00.452554 PIIX3 ATA: Ctl#0: RESET, DevSel=0 AIOIf=0 CmdIf0=0x00 (-1 
>> usec ago) CmdIf1=0x00 (-1 usec ago)
>> 00:00:00.452664 PIIX3 ATA: Ctl#0: finished processing RESET
>> 00:00:00.456064 VMMDev: Guest Log: BIOS: ata0-0: PCHS=16383/16/63 
>> LCHS=1024/255/63
>> 00:00:00.460933 PIIX3 ATA: Ctl#0: RESET, DevSel=1 AIOIf=0 CmdIf0=0xec (-1 
>> usec ago) CmdIf1=0x00 (-1 usec ago)
>> 00:00:00.461049 PIIX3 ATA: Ctl#0: finished processing RESET
>> 00:00:00.506867 PIT: mode=2 count=0x48d3 (18643) - 64.00 Hz (ch=0)
>> 00:00:00.510412 Display::handleDisplayResize: uScreenId=0 
>> pvVRAM=7f0d4996c000 w=640 h=480 bpp=32 cbLine=0xA00 flags=0x0
>> 00:00:02.997497 Display::handleDisplayResize: uScreenId=0 
>> pvVRAM= w=720 h=400 bpp=0 cbLine=0x0 flags=0x0
>> 00:00:03.005835 PIT: mode=2 count=0x1 (65536) - 18.20 Hz (ch=0)
>> 00:00:03.008104 VMMDev: Guest Log: BIOS: Boot : bseqnr=1, bootseq=0032
>> 00:00:03.010321 VMMDev: Guest Log: BIOS: Boot from Hard Disk 0 failed
>> 00:00:03.011968 VMMDev: Guest Log: BIOS: Boot : bseqnr=2, bootseq=0003
>> 00:00:03.015036 VMMDev: Guest Log: BIOS: Booting from CD-ROM...
>> 00:00:03.450411 Display::handleDisplayResize: uScreenId=0 
>> pvVRAM=7f0d4996c000 w=1024 h=768 bpp=24 cbLine=0xC00 flags=0x0
>> 00:00:07.035679 VMMDev: Guest Log: BIOS: int13_diskette_function: 
>> unsupported AH=41
>> 00:00:09.319618 RTC: period=0x10 (16) 2048 Hz
>> 00:00:15.441594 NAT: Old socket recv size: 128KB
>> 00:00:15.441620 NAT: Old socket send size: 128KB
>> 00:00:22.650511 Display::handleDisplayResize: uScreenId=0 
>> pvVRAM=7f0d4996c000 w=1024 h=768 bpp=32 cbLine=0x1000 flags=0x0
>> 00:00:31.379280 NAT: Link up
>> 00:00:31.413775 NAT: resolv.conf: nameserver 10.xXX.XXX.21
>> 00:00:31.413797 NAT: resolv.conf: nameserver 10.XX.XXX.21
>> 00:00:31.413840 NAT: DNS#0: 10.XXX.XXX.21
>> 00:00:31.413847 NAT: DNS#1: 10.XXX.XXX.21
>> 00:00:31.413853 NAT: DHCP offered IP address 10.0.2.15
>> 00:00:31.415524 NAT: DHCP offered IP address 10.0.2.15
>> 00:00:31.447769 NAT: IPv6 not supported
>>
>>
>>
>>
>> On Tuesday, 13 August 2019 18:24:59 UTC+5:30, Rickard von Essen wrote:
>>>
>>> Run with headless false, add flag --on-error=ask when this fails use the 
>>> console and debug the winrm setup from the inside or check the status of 
>>> the installation. 
>>>
>>> On Tue, Aug 13, 2019, 13:11 Automationbuilder360 Builder <
>>> automation...@gmail.com> wrote:
>>>
 Hi All,

 Am new to Packer, am trying to create a Windows 2016 guest on VBOX 
 hosted on RHEL VM.
 using virtualbox-iso builders and trying to test my windows customized 
 image.
 the idea to create VM and get windows 2016 installed through iso and 
 then connect with ansible and run couple of test cases. part of my image 
 building and testing pipeline.
>>

Re: [packer] Windows2016 guest on RHEL linux host never ending winrm loop

2019-08-13 Thread Rickard von Essen
Can you run and install windows manually in virtualbox? Seem like you have
problems with that?

On Tue, Aug 13, 2019, 15:49 Automationbuilder360 Builder <
automationbuilder...@gmail.com> wrote:

> Hi Rickard,
>
> To verify the "headless Flase" mode i tried this on windows 2016 host VM
> as well.
> but as soon i attach the iso the VM gets crashed with no updates.
>
> BTW "--on-error=ask" was not of much help. as it never asked for any input.
>
> and the last few lines of output from VBOX.log is here.
>
> 00:00:00.394503 *** End of VT-x features
> 
> 00:00:00.396851 PcBios: ATA LUN#0 LCHS=1024/255/63
> 00:00:00.396924 APIC: fPostedIntrsEnabled=false fVirtApicRegsEnabled=false
> fSupportsTscDeadline=false
> 00:00:00.396933 TMR3UtcNow: nsNow=1 565 703 281 470 031 000 nsPrev=0 ->
> cNsDelta=1 565 703 281 470 031 000 (offLag=0 offVirtualSync=0
> offVirtualSyncGivenUp=0, NowAgain=1 565 703 281 470 031 000)
> 00:00:00.396945 VMEmt: Halt method global1 (5)
> 00:00:00.396986 VMEmt: HaltedGlobal1 config: cNsSpinBlockThresholdCfg=2000
> 00:00:00.397019 Changing the VM state from 'CREATING' to 'CREATED'
> 00:00:00.403717 Changing the VM state from 'CREATED' to 'POWERING_ON'
> 00:00:00.404306 Changing the VM state from 'POWERING_ON' to 'RUNNING'
> 00:00:00.404319 Console: Machine state changed to 'Running'
> 00:00:00.410651 VMMDev: Guest Log: BIOS: VirtualBox 6.0.4
> 00:00:00.410980 PCI: Setting up resources and interrupts
> 00:00:00.411473 PIT: mode=2 count=0x1 (65536) - 18.20 Hz (ch=0)
> 00:00:00.433895 Display::handleDisplayResize: uScreenId=0
> pvVRAM= w=720 h=400 bpp=0 cbLine=0x0 flags=0x0
> 00:00:00.452285 VMMDev: Guest Log: CPUID EDX: 0x178bfbff
> 00:00:00.452554 PIIX3 ATA: Ctl#0: RESET, DevSel=0 AIOIf=0 CmdIf0=0x00 (-1
> usec ago) CmdIf1=0x00 (-1 usec ago)
> 00:00:00.452664 PIIX3 ATA: Ctl#0: finished processing RESET
> 00:00:00.456064 VMMDev: Guest Log: BIOS: ata0-0: PCHS=16383/16/63
> LCHS=1024/255/63
> 00:00:00.460933 PIIX3 ATA: Ctl#0: RESET, DevSel=1 AIOIf=0 CmdIf0=0xec (-1
> usec ago) CmdIf1=0x00 (-1 usec ago)
> 00:00:00.461049 PIIX3 ATA: Ctl#0: finished processing RESET
> 00:00:00.506867 PIT: mode=2 count=0x48d3 (18643) - 64.00 Hz (ch=0)
> 00:00:00.510412 Display::handleDisplayResize: uScreenId=0
> pvVRAM=7f0d4996c000 w=640 h=480 bpp=32 cbLine=0xA00 flags=0x0
> 00:00:02.997497 Display::handleDisplayResize: uScreenId=0
> pvVRAM= w=720 h=400 bpp=0 cbLine=0x0 flags=0x0
> 00:00:03.005835 PIT: mode=2 count=0x1 (65536) - 18.20 Hz (ch=0)
> 00:00:03.008104 VMMDev: Guest Log: BIOS: Boot : bseqnr=1, bootseq=0032
> 00:00:03.010321 VMMDev: Guest Log: BIOS: Boot from Hard Disk 0 failed
> 00:00:03.011968 VMMDev: Guest Log: BIOS: Boot : bseqnr=2, bootseq=0003
> 00:00:03.015036 VMMDev: Guest Log: BIOS: Booting from CD-ROM...
> 00:00:03.450411 Display::handleDisplayResize: uScreenId=0
> pvVRAM=7f0d4996c000 w=1024 h=768 bpp=24 cbLine=0xC00 flags=0x0
> 00:00:07.035679 VMMDev: Guest Log: BIOS: int13_diskette_function:
> unsupported AH=41
> 00:00:09.319618 RTC: period=0x10 (16) 2048 Hz
> 00:00:15.441594 NAT: Old socket recv size: 128KB
> 00:00:15.441620 NAT: Old socket send size: 128KB
> 00:00:22.650511 Display::handleDisplayResize: uScreenId=0
> pvVRAM=7f0d4996c000 w=1024 h=768 bpp=32 cbLine=0x1000 flags=0x0
> 00:00:31.379280 NAT: Link up
> 00:00:31.413775 NAT: resolv.conf: nameserver 10.xXX.XXX.21
> 00:00:31.413797 NAT: resolv.conf: nameserver 10.XX.XXX.21
> 00:00:31.413840 NAT: DNS#0: 10.XXX.XXX.21
> 00:00:31.413847 NAT: DNS#1: 10.XXX.XXX.21
> 00:00:31.413853 NAT: DHCP offered IP address 10.0.2.15
> 00:00:31.415524 NAT: DHCP offered IP address 10.0.2.15
> 00:00:31.447769 NAT: IPv6 not supported
>
>
>
>
> On Tuesday, 13 August 2019 18:24:59 UTC+5:30, Rickard von Essen wrote:
>>
>> Run with headless false, add flag --on-error=ask when this fails use the
>> console and debug the winrm setup from the inside or check the status of
>> the installation.
>>
>> On Tue, Aug 13, 2019, 13:11 Automationbuilder360 Builder <
>> automation...@gmail.com> wrote:
>>
>>> Hi All,
>>>
>>> Am new to Packer, am trying to create a Windows 2016 guest on VBOX
>>> hosted on RHEL VM.
>>> using virtualbox-iso builders and trying to test my windows customized
>>> image.
>>> the idea to create VM and get windows 2016 installed through iso and
>>> then connect with ansible and run couple of test cases. part of my image
>>> building and testing pipeline.
>>>
>>> however after the VM gets created it waits for winrm untill the timeout
>>> and just fails,
>>> i have no idea to see whats happening on the guest.
>>> this is a tested iso which works great on vmware. any help is much
>>> appreciated.
>>>
>>>
>>> Here is the output
>>>
>>> ==> virtualbox-iso: Retrieving ISO
>>> virtualbox-iso: Using file in-place:
>>> file:///home/myhome/iso/mycustom_windows2016.v1.0.ISO
>>> ==> virtualbox-iso: Creating floppy disk...
>>> virtualbox-iso: Copying files flatly from floppy_files
>>>

Re: [packer] Windows2016 guest on RHEL linux host never ending winrm loop

2019-08-13 Thread Automationbuilder360 Builder
Hi Rickard,

To verify the "headless Flase" mode i tried this on windows 2016 host VM as 
well.
but as soon i attach the iso the VM gets crashed with no updates.

BTW "--on-error=ask" was not of much help. as it never asked for any input.

and the last few lines of output from VBOX.log is here.

00:00:00.394503 *** End of VT-x features 

00:00:00.396851 PcBios: ATA LUN#0 LCHS=1024/255/63
00:00:00.396924 APIC: fPostedIntrsEnabled=false fVirtApicRegsEnabled=false 
fSupportsTscDeadline=false
00:00:00.396933 TMR3UtcNow: nsNow=1 565 703 281 470 031 000 nsPrev=0 -> 
cNsDelta=1 565 703 281 470 031 000 (offLag=0 offVirtualSync=0 
offVirtualSyncGivenUp=0, NowAgain=1 565 703 281 470 031 000)
00:00:00.396945 VMEmt: Halt method global1 (5)
00:00:00.396986 VMEmt: HaltedGlobal1 config: cNsSpinBlockThresholdCfg=2000
00:00:00.397019 Changing the VM state from 'CREATING' to 'CREATED'
00:00:00.403717 Changing the VM state from 'CREATED' to 'POWERING_ON'
00:00:00.404306 Changing the VM state from 'POWERING_ON' to 'RUNNING'
00:00:00.404319 Console: Machine state changed to 'Running'
00:00:00.410651 VMMDev: Guest Log: BIOS: VirtualBox 6.0.4
00:00:00.410980 PCI: Setting up resources and interrupts
00:00:00.411473 PIT: mode=2 count=0x1 (65536) - 18.20 Hz (ch=0)
00:00:00.433895 Display::handleDisplayResize: uScreenId=0 
pvVRAM= w=720 h=400 bpp=0 cbLine=0x0 flags=0x0
00:00:00.452285 VMMDev: Guest Log: CPUID EDX: 0x178bfbff
00:00:00.452554 PIIX3 ATA: Ctl#0: RESET, DevSel=0 AIOIf=0 CmdIf0=0x00 (-1 
usec ago) CmdIf1=0x00 (-1 usec ago)
00:00:00.452664 PIIX3 ATA: Ctl#0: finished processing RESET
00:00:00.456064 VMMDev: Guest Log: BIOS: ata0-0: PCHS=16383/16/63 
LCHS=1024/255/63
00:00:00.460933 PIIX3 ATA: Ctl#0: RESET, DevSel=1 AIOIf=0 CmdIf0=0xec (-1 
usec ago) CmdIf1=0x00 (-1 usec ago)
00:00:00.461049 PIIX3 ATA: Ctl#0: finished processing RESET
00:00:00.506867 PIT: mode=2 count=0x48d3 (18643) - 64.00 Hz (ch=0)
00:00:00.510412 Display::handleDisplayResize: uScreenId=0 
pvVRAM=7f0d4996c000 w=640 h=480 bpp=32 cbLine=0xA00 flags=0x0
00:00:02.997497 Display::handleDisplayResize: uScreenId=0 
pvVRAM= w=720 h=400 bpp=0 cbLine=0x0 flags=0x0
00:00:03.005835 PIT: mode=2 count=0x1 (65536) - 18.20 Hz (ch=0)
00:00:03.008104 VMMDev: Guest Log: BIOS: Boot : bseqnr=1, bootseq=0032
00:00:03.010321 VMMDev: Guest Log: BIOS: Boot from Hard Disk 0 failed
00:00:03.011968 VMMDev: Guest Log: BIOS: Boot : bseqnr=2, bootseq=0003
00:00:03.015036 VMMDev: Guest Log: BIOS: Booting from CD-ROM...
00:00:03.450411 Display::handleDisplayResize: uScreenId=0 
pvVRAM=7f0d4996c000 w=1024 h=768 bpp=24 cbLine=0xC00 flags=0x0
00:00:07.035679 VMMDev: Guest Log: BIOS: int13_diskette_function: 
unsupported AH=41
00:00:09.319618 RTC: period=0x10 (16) 2048 Hz
00:00:15.441594 NAT: Old socket recv size: 128KB
00:00:15.441620 NAT: Old socket send size: 128KB
00:00:22.650511 Display::handleDisplayResize: uScreenId=0 
pvVRAM=7f0d4996c000 w=1024 h=768 bpp=32 cbLine=0x1000 flags=0x0
00:00:31.379280 NAT: Link up
00:00:31.413775 NAT: resolv.conf: nameserver 10.xXX.XXX.21
00:00:31.413797 NAT: resolv.conf: nameserver 10.XX.XXX.21
00:00:31.413840 NAT: DNS#0: 10.XXX.XXX.21
00:00:31.413847 NAT: DNS#1: 10.XXX.XXX.21
00:00:31.413853 NAT: DHCP offered IP address 10.0.2.15
00:00:31.415524 NAT: DHCP offered IP address 10.0.2.15
00:00:31.447769 NAT: IPv6 not supported




On Tuesday, 13 August 2019 18:24:59 UTC+5:30, Rickard von Essen wrote:
>
> Run with headless false, add flag --on-error=ask when this fails use the 
> console and debug the winrm setup from the inside or check the status of 
> the installation. 
>
> On Tue, Aug 13, 2019, 13:11 Automationbuilder360 Builder <
> automation...@gmail.com > wrote:
>
>> Hi All,
>>
>> Am new to Packer, am trying to create a Windows 2016 guest on VBOX hosted 
>> on RHEL VM.
>> using virtualbox-iso builders and trying to test my windows customized 
>> image.
>> the idea to create VM and get windows 2016 installed through iso and then 
>> connect with ansible and run couple of test cases. part of my image 
>> building and testing pipeline.
>>
>> however after the VM gets created it waits for winrm untill the timeout 
>> and just fails,
>> i have no idea to see whats happening on the guest.
>> this is a tested iso which works great on vmware. any help is much 
>> appreciated.
>>
>>
>> Here is the output
>>
>> ==> virtualbox-iso: Retrieving ISO
>> virtualbox-iso: Using file in-place: 
>> file:///home/myhome/iso/mycustom_windows2016.v1.0.ISO
>> ==> virtualbox-iso: Creating floppy disk...
>> virtualbox-iso: Copying files flatly from floppy_files
>> virtualbox-iso: Copying file: ./Scripts/enable_winrm.ps1
>> virtualbox-iso: Done copying files from floppy_files
>> virtualbox-iso: Collecting paths from floppy_dirs
>> virtualbox-iso: Resulting paths from floppy_dirs : []
>> virtualbox-iso: Done copying paths from floppy_dirs
>> ==> virtualbox-iso: Creating virtual machine...
>> ==

Re: [packer] Windows2016 guest on RHEL linux host never ending winrm loop

2019-08-13 Thread Rickard von Essen
Run with headless false, add flag --on-error=ask when this fails use the
console and debug the winrm setup from the inside or check the status of
the installation.

On Tue, Aug 13, 2019, 13:11 Automationbuilder360 Builder <
automationbuilder...@gmail.com> wrote:

> Hi All,
>
> Am new to Packer, am trying to create a Windows 2016 guest on VBOX hosted
> on RHEL VM.
> using virtualbox-iso builders and trying to test my windows customized
> image.
> the idea to create VM and get windows 2016 installed through iso and then
> connect with ansible and run couple of test cases. part of my image
> building and testing pipeline.
>
> however after the VM gets created it waits for winrm untill the timeout
> and just fails,
> i have no idea to see whats happening on the guest.
> this is a tested iso which works great on vmware. any help is much
> appreciated.
>
>
> Here is the output
>
> ==> virtualbox-iso: Retrieving ISO
> virtualbox-iso: Using file in-place:
> file:///home/myhome/iso/mycustom_windows2016.v1.0.ISO
> ==> virtualbox-iso: Creating floppy disk...
> virtualbox-iso: Copying files flatly from floppy_files
> virtualbox-iso: Copying file: ./Scripts/enable_winrm.ps1
> virtualbox-iso: Done copying files from floppy_files
> virtualbox-iso: Collecting paths from floppy_dirs
> virtualbox-iso: Resulting paths from floppy_dirs : []
> virtualbox-iso: Done copying paths from floppy_dirs
> ==> virtualbox-iso: Creating virtual machine...
> ==> virtualbox-iso: Creating hard drive...
> ==> virtualbox-iso: Attaching floppy disk...
> ==> virtualbox-iso: Creating forwarded port mapping for communicator (SSH,
> WinRM, etc) (host port 3789)
> ==> virtualbox-iso: Executing custom VBoxManage commands...
> virtualbox-iso: Executing: modifyvm packer-virtualbox-iso-1565282739
> --natpf1 winrm,tcp,,222585,,5985
> virtualbox-iso: Executing: modifyvm packer-virtualbox-iso-1565282739
> --memory 4096
> virtualbox-iso: Executing: modifyvm packer-virtualbox-iso-1565282739
> --cpus 2
> ==> virtualbox-iso: Starting the virtual machine...
> virtualbox-iso: The VM will be run headless, without a GUI. If you want to
> virtualbox-iso: view the screen of the VM, connect via VRDP without a
> password to
> virtualbox-iso: rdp://127.0.0.1:5908
> ==> virtualbox-iso: Waiting 10s for boot...
> ==> virtualbox-iso: Typing the boot command...
> ==> virtualbox-iso: Using winrm communicator to connect: 127.0.0.1
> ==> virtualbox-iso: Waiting for WinRM to become available...
> ==> virtualbox-iso: Timeout waiting for WinRM.
> ==> virtualbox-iso: Deregistering and deleting VM...
> ==> virtualbox-iso: Deleting output directory...
> Build 'virtualbox-iso' errored: Timeout waiting for WinRM.
>
> ==> Some builds didn't complete successfully and had errors:
> --> virtualbox-iso: Timeout waiting for WinRM.
>
> --
> This mailing list is governed under the HashiCorp Community Guidelines -
> https://www.hashicorp.com/community-guidelines.html. Behavior in
> violation of those guidelines may result in your removal from this mailing
> list.
>
> GitHub Issues: https://github.com/mitchellh/packer/issues
> IRC: #packer-tool on Freenode
> ---
> You received this message because you are subscribed to the Google Groups
> "Packer" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to packer-tool+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/1e83587f-660c-45ed-9caf-1e0acf39786f%40googlegroups.com
> 
> .
>

-- 
This mailing list is governed under the HashiCorp Community Guidelines - 
https://www.hashicorp.com/community-guidelines.html. Behavior in violation of 
those guidelines may result in your removal from this mailing list.

GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
--- 
You received this message because you are subscribed to the Google Groups 
"Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to packer-tool+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt8bhK3mDAboH00sg1JZmZ2jBKMxZVPwVqtcX%2B%2BhGzKj0g%40mail.gmail.com.


Re: [packer] Using Packer to build a windows box and provision with Ansible

2019-08-13 Thread deanwarrenuk

>
> This is interesting - is this related?


https://stackoverflow.com/questions/50431469/getting-ip-address-of-the-aws-instance-when-using-packer-and-ansible
 

-- 
This mailing list is governed under the HashiCorp Community Guidelines - 
https://www.hashicorp.com/community-guidelines.html. Behavior in violation of 
those guidelines may result in your removal from this mailing list.

GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
--- 
You received this message because you are subscribed to the Google Groups 
"Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to packer-tool+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/e13608ae-3040-46e9-a9c1-0faa8e676a51%40googlegroups.com.


[packer] Windows2016 guest on RHEL linux host never ending winrm loop

2019-08-13 Thread Automationbuilder360 Builder


Hi All,

Am new to Packer, am trying to create a Windows 2016 guest on VBOX hosted 
on RHEL VM.
using virtualbox-iso builders and trying to test my windows customized 
image.
the idea to create VM and get windows 2016 installed through iso and then 
connect with ansible and run couple of test cases. part of my image 
building and testing pipeline.

however after the VM gets created it waits for winrm untill the timeout and 
just fails,
i have no idea to see whats happening on the guest.
this is a tested iso which works great on vmware. any help is much 
appreciated.


Here is the output

==> virtualbox-iso: Retrieving ISO
virtualbox-iso: Using file in-place: 
file:///home/myhome/iso/mycustom_windows2016.v1.0.ISO
==> virtualbox-iso: Creating floppy disk...
virtualbox-iso: Copying files flatly from floppy_files
virtualbox-iso: Copying file: ./Scripts/enable_winrm.ps1
virtualbox-iso: Done copying files from floppy_files
virtualbox-iso: Collecting paths from floppy_dirs
virtualbox-iso: Resulting paths from floppy_dirs : []
virtualbox-iso: Done copying paths from floppy_dirs
==> virtualbox-iso: Creating virtual machine...
==> virtualbox-iso: Creating hard drive...
==> virtualbox-iso: Attaching floppy disk...
==> virtualbox-iso: Creating forwarded port mapping for communicator (SSH, 
WinRM, etc) (host port 3789)
==> virtualbox-iso: Executing custom VBoxManage commands...
virtualbox-iso: Executing: modifyvm packer-virtualbox-iso-1565282739 
--natpf1 winrm,tcp,,222585,,5985
virtualbox-iso: Executing: modifyvm packer-virtualbox-iso-1565282739 
--memory 4096
virtualbox-iso: Executing: modifyvm packer-virtualbox-iso-1565282739 --cpus 
2
==> virtualbox-iso: Starting the virtual machine...
virtualbox-iso: The VM will be run headless, without a GUI. If you want to
virtualbox-iso: view the screen of the VM, connect via VRDP without a 
password to
virtualbox-iso: rdp://127.0.0.1:5908
==> virtualbox-iso: Waiting 10s for boot...
==> virtualbox-iso: Typing the boot command...
==> virtualbox-iso: Using winrm communicator to connect: 127.0.0.1
==> virtualbox-iso: Waiting for WinRM to become available...
==> virtualbox-iso: Timeout waiting for WinRM.
==> virtualbox-iso: Deregistering and deleting VM...
==> virtualbox-iso: Deleting output directory...
Build 'virtualbox-iso' errored: Timeout waiting for WinRM.

==> Some builds didn't complete successfully and had errors:
--> virtualbox-iso: Timeout waiting for WinRM.

-- 
This mailing list is governed under the HashiCorp Community Guidelines - 
https://www.hashicorp.com/community-guidelines.html. Behavior in violation of 
those guidelines may result in your removal from this mailing list.

GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
--- 
You received this message because you are subscribed to the Google Groups 
"Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to packer-tool+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/1e83587f-660c-45ed-9caf-1e0acf39786f%40googlegroups.com.


Re: [packer] Using Packer to build a windows box and provision with Ansible

2019-08-13 Thread deanwarrenuk
Looks like its saying you don't have permissions to create 
~/.ansible/tmp/etc... 
e.g.
exec request: /bin/sh -c '( umask 77 && mkdir -p "` echo 
~/.ansible/tmp/ansible-tmp-1565678283.204747-204856165820508...
amazon-ebs: fatal: [default]: UNREACHABLE! => {"changed": false, "msg": 
"Authentication or permission failure.

Does the user have those permission?

On Tuesday, 13 August 2019 10:09:56 UTC+1, Richard Payne wrote:
>
> Actually, the IP is in the standard output, not even debug.
>
> No idea how you're supposed to use that though.
>
> On Tuesday, 13 August 2019 08:37:49 UTC+1, Richard Payne wrote:
>>
>> I'm not seeing the IP in the log.  However, it might provide some info on 
>> what's wrong with the Ansible provisioner?
>>
>>
>> 2019/08/13 07:37:43 packer: 2019/08/13 07:37:43 [DEBUG] Password is 
>> blank, will retry...
>> 2019/08/13 07:37:49 ui: amazon-ebs:
>> amazon-ebs: Password retrieved!
>> amazon-ebs:
>> amazon-ebs: Password retrieved!
>> ==> amazon-ebs: Waiting for WinRM to become available...
>> 2019/08/13 07:37:49 packer: 2019/08/13 07:37:49 Waiting for WinRM, up to 
>> timeout: 30m0s
>> 2019/08/13 07:37:49 ui: ==> amazon-ebs: Waiting for WinRM to become 
>> available...
>> 2019/08/13 07:37:54 packer: 2019/08/13 07:37:54 [INFO] Attempting WinRM 
>> connection...
>> 2019/08/13 07:37:54 packer: 2019/08/13 07:37:54 [DEBUG] connecting to 
>> remote shell using WinRM
>> 2019/08/13 07:38:01 ui: ==> amazon-ebs: Connected to WinRM!
>> 2019/08/13 07:38:01 packer: 2019/08/13 07:38:01 Running the provision hook
>> ==> amazon-ebs: Connected to WinRM!
>> 2019/08/13 07:38:01 [INFO] (telemetry) Starting provisioner ansible
>> 2019/08/13 07:38:01 ui: ==> amazon-ebs: Provisioning with Ansible...
>> ==> amazon-ebs: Provisioning with Ansible...
>> 2019/08/13 07:38:02 packer: 2019/08/13 07:38:02 SSH proxy: serving on 
>> 127.0.0.1:36005
>> 2019/08/13 07:38:02 ui: ==> amazon-ebs: Executing Ansible: 
>> ansible-playbook --extra-vars packer_build_name=amazon-ebs 
>> packer_builder_type=amazon-ebs -i /tmp/packer-provisioner-ansible774557480 
>> /home/richard/git/ansible/playbooks/windows_image_build/playbook.yml 
>> --private-key /tmp/ansible-key713730989 --extra-vars {'environment_name': 
>> 'packer', 'hosting_environment': 'aws', 'connection': 'packer'} --skip-tags 
>> gitchecks --skip-tags gather_facts --skip-tags slack
>> ==> amazon-ebs: Executing Ansible: ansible-playbook --extra-vars 
>> packer_build_name=amazon-ebs packer_builder_type=amazon-ebs -i 
>> /tmp/packer-provisioner-ansible774557480 
>> /home/richard/git/ansible/playbooks/windows_image_build/playbook.yml 
>> --private-key /tmp/ansible-key713730989 --extra-vars {'environment_name': 
>> 'packer', 'hosting_environment': 'aws', 'connection': 'packer'} --skip-tags 
>> gitchecks --skip-tags gather_facts --skip-tags slack
>> 2019/08/13 07:38:03 ui: amazon-ebs:  [WARNING]: Found variable using 
>> reserved name: connection
>> amazon-ebs:  [WARNING]: Found variable using reserved name: connection
>> amazon-ebs:
>> 2019/08/13 07:38:03 ui: amazon-ebs:
>> 2019/08/13 07:38:03 ui: amazon-ebs: PLAY [all] 
>> *
>> amazon-ebs: PLAY [all] 
>> *
>> 2019/08/13 07:38:03 ui: amazon-ebs:
>> amazon-ebs:
>> 2019/08/13 07:38:03 ui: amazon-ebs: TASK [Gathering Facts] 
>> *
>> amazon-ebs: TASK [Gathering Facts] 
>> *
>> 2019/08/13 07:38:03 packer: 2019/08/13 07:38:03 SSH proxy: accepted 
>> connection
>> 2019/08/13 07:38:03 packer: 2019/08/13 07:38:03 authentication attempt 
>> from 127.0.0.1:41696 to 127.0.0.1:36005 as richard using none
>> 2019/08/13 07:38:03 packer: 2019/08/13 07:38:03 authentication attempt 
>> from 127.0.0.1:41696 to 127.0.0.1:36005 as richard using publickey
>> 2019/08/13 07:38:03 packer: 2019/08/13 07:38:03 new env request: 
>> LANG=en_GB.UTF-8
>> 2019/08/13 07:38:03 packer: 2019/08/13 07:38:03 new exec request: /bin/sh 
>> -c 'echo ~richard && sleep 0'
>> 2019/08/13 07:38:03 packer: 2019/08/13 07:38:03 [INFO] starting remote 
>> command: /bin/sh -c 'echo ~richard && sleep 0'
>> 2019/08/13 07:38:03 packer: 2019/08/13 07:38:03 [INFO] command '/bin/sh 
>> -c 'echo ~richard && sleep 0'' exited with code: 1
>> 2019/08/13 07:38:03 packer: 2019/08/13 07:38:03 [INFO] RPC endpoint: 
>> Communicator ended with: 1
>> 2019/08/13 07:38:03 [INFO] 0 bytes written for 'stdout'
>> 2019/08/13 07:38:03 [INFO] 44 bytes written for 'stderr'
>> 2019/08/13 07:38:03 [INFO] RPC client: Communicator ended with: 1
>> 2019/08/13 07:38:03 [INFO] RPC endpoint: Communicator ended with: 1
>> 2019/08/13 07:38:03 [INFO] 0 bytes written for 'stdin'
>> 2019/08/13 07:38:03 packer: 2019/08/13 07:38:03 [INFO] 0 bytes written 
>> for 'stdout'
>> 2019/08/13 07:38:03 packer: 2019/08/13 07:38:03

Re: [packer] Using Packer to build a windows box and provision with Ansible

2019-08-13 Thread 'Richard Payne' via Packer
Actually, the IP is in the standard output, not even debug.

No idea how you're supposed to use that though.

On Tuesday, 13 August 2019 08:37:49 UTC+1, Richard Payne wrote:
>
> I'm not seeing the IP in the log.  However, it might provide some info on 
> what's wrong with the Ansible provisioner?
>
>
> 2019/08/13 07:37:43 packer: 2019/08/13 07:37:43 [DEBUG] Password is blank, 
> will retry...
> 2019/08/13 07:37:49 ui: amazon-ebs:
> amazon-ebs: Password retrieved!
> amazon-ebs:
> amazon-ebs: Password retrieved!
> ==> amazon-ebs: Waiting for WinRM to become available...
> 2019/08/13 07:37:49 packer: 2019/08/13 07:37:49 Waiting for WinRM, up to 
> timeout: 30m0s
> 2019/08/13 07:37:49 ui: ==> amazon-ebs: Waiting for WinRM to become 
> available...
> 2019/08/13 07:37:54 packer: 2019/08/13 07:37:54 [INFO] Attempting WinRM 
> connection...
> 2019/08/13 07:37:54 packer: 2019/08/13 07:37:54 [DEBUG] connecting to 
> remote shell using WinRM
> 2019/08/13 07:38:01 ui: ==> amazon-ebs: Connected to WinRM!
> 2019/08/13 07:38:01 packer: 2019/08/13 07:38:01 Running the provision hook
> ==> amazon-ebs: Connected to WinRM!
> 2019/08/13 07:38:01 [INFO] (telemetry) Starting provisioner ansible
> 2019/08/13 07:38:01 ui: ==> amazon-ebs: Provisioning with Ansible...
> ==> amazon-ebs: Provisioning with Ansible...
> 2019/08/13 07:38:02 packer: 2019/08/13 07:38:02 SSH proxy: serving on 
> 127.0.0.1:36005
> 2019/08/13 07:38:02 ui: ==> amazon-ebs: Executing Ansible: 
> ansible-playbook --extra-vars packer_build_name=amazon-ebs 
> packer_builder_type=amazon-ebs -i /tmp/packer-provisioner-ansible774557480 
> /home/richard/git/ansible/playbooks/windows_image_build/playbook.yml 
> --private-key /tmp/ansible-key713730989 --extra-vars {'environment_name': 
> 'packer', 'hosting_environment': 'aws', 'connection': 'packer'} --skip-tags 
> gitchecks --skip-tags gather_facts --skip-tags slack
> ==> amazon-ebs: Executing Ansible: ansible-playbook --extra-vars 
> packer_build_name=amazon-ebs packer_builder_type=amazon-ebs -i 
> /tmp/packer-provisioner-ansible774557480 
> /home/richard/git/ansible/playbooks/windows_image_build/playbook.yml 
> --private-key /tmp/ansible-key713730989 --extra-vars {'environment_name': 
> 'packer', 'hosting_environment': 'aws', 'connection': 'packer'} --skip-tags 
> gitchecks --skip-tags gather_facts --skip-tags slack
> 2019/08/13 07:38:03 ui: amazon-ebs:  [WARNING]: Found variable using 
> reserved name: connection
> amazon-ebs:  [WARNING]: Found variable using reserved name: connection
> amazon-ebs:
> 2019/08/13 07:38:03 ui: amazon-ebs:
> 2019/08/13 07:38:03 ui: amazon-ebs: PLAY [all] 
> *
> amazon-ebs: PLAY [all] 
> *
> 2019/08/13 07:38:03 ui: amazon-ebs:
> amazon-ebs:
> 2019/08/13 07:38:03 ui: amazon-ebs: TASK [Gathering Facts] 
> *
> amazon-ebs: TASK [Gathering Facts] 
> *
> 2019/08/13 07:38:03 packer: 2019/08/13 07:38:03 SSH proxy: accepted 
> connection
> 2019/08/13 07:38:03 packer: 2019/08/13 07:38:03 authentication attempt 
> from 127.0.0.1:41696 to 127.0.0.1:36005 as richard using none
> 2019/08/13 07:38:03 packer: 2019/08/13 07:38:03 authentication attempt 
> from 127.0.0.1:41696 to 127.0.0.1:36005 as richard using publickey
> 2019/08/13 07:38:03 packer: 2019/08/13 07:38:03 new env request: 
> LANG=en_GB.UTF-8
> 2019/08/13 07:38:03 packer: 2019/08/13 07:38:03 new exec request: /bin/sh 
> -c 'echo ~richard && sleep 0'
> 2019/08/13 07:38:03 packer: 2019/08/13 07:38:03 [INFO] starting remote 
> command: /bin/sh -c 'echo ~richard && sleep 0'
> 2019/08/13 07:38:03 packer: 2019/08/13 07:38:03 [INFO] command '/bin/sh -c 
> 'echo ~richard && sleep 0'' exited with code: 1
> 2019/08/13 07:38:03 packer: 2019/08/13 07:38:03 [INFO] RPC endpoint: 
> Communicator ended with: 1
> 2019/08/13 07:38:03 [INFO] 0 bytes written for 'stdout'
> 2019/08/13 07:38:03 [INFO] 44 bytes written for 'stderr'
> 2019/08/13 07:38:03 [INFO] RPC client: Communicator ended with: 1
> 2019/08/13 07:38:03 [INFO] RPC endpoint: Communicator ended with: 1
> 2019/08/13 07:38:03 [INFO] 0 bytes written for 'stdin'
> 2019/08/13 07:38:03 packer: 2019/08/13 07:38:03 [INFO] 0 bytes written for 
> 'stdout'
> 2019/08/13 07:38:03 packer: 2019/08/13 07:38:03 [INFO] 44 bytes written 
> for 'stderr'
> 2019/08/13 07:38:03 packer: 2019/08/13 07:38:03 [INFO] RPC client: 
> Communicator ended with: 1
> 2019/08/13 07:38:03 packer: 2019/08/13 07:38:03 [INFO] 0 bytes written for 
> 'stdin'
> 2019/08/13 07:38:03 packer: 2019/08/13 07:38:03 new env request: 
> LANG=en_GB.UTF-8
> 2019/08/13 07:38:03 packer: 2019/08/13 07:38:03 new exec request: /bin/sh 
> -c 'echo "`pwd`" && sleep 0'
> 2019/08/13 07:38:03 packer: 2019/08/13 07:38:03 [INFO] starting remote 
> command: /bin/sh 

Re: [packer] Using Packer to build a windows box and provision with Ansible

2019-08-13 Thread 'Richard Payne' via Packer
I'm not seeing the IP in the log.  However, it might provide some info on 
what's wrong with the Ansible provisioner?


2019/08/13 07:37:43 packer: 2019/08/13 07:37:43 [DEBUG] Password is blank, 
will retry...
2019/08/13 07:37:49 ui: amazon-ebs:
amazon-ebs: Password retrieved!
amazon-ebs:
amazon-ebs: Password retrieved!
==> amazon-ebs: Waiting for WinRM to become available...
2019/08/13 07:37:49 packer: 2019/08/13 07:37:49 Waiting for WinRM, up to 
timeout: 30m0s
2019/08/13 07:37:49 ui: ==> amazon-ebs: Waiting for WinRM to become 
available...
2019/08/13 07:37:54 packer: 2019/08/13 07:37:54 [INFO] Attempting WinRM 
connection...
2019/08/13 07:37:54 packer: 2019/08/13 07:37:54 [DEBUG] connecting to 
remote shell using WinRM
2019/08/13 07:38:01 ui: ==> amazon-ebs: Connected to WinRM!
2019/08/13 07:38:01 packer: 2019/08/13 07:38:01 Running the provision hook
==> amazon-ebs: Connected to WinRM!
2019/08/13 07:38:01 [INFO] (telemetry) Starting provisioner ansible
2019/08/13 07:38:01 ui: ==> amazon-ebs: Provisioning with Ansible...
==> amazon-ebs: Provisioning with Ansible...
2019/08/13 07:38:02 packer: 2019/08/13 07:38:02 SSH proxy: serving on 
127.0.0.1:36005
2019/08/13 07:38:02 ui: ==> amazon-ebs: Executing Ansible: ansible-playbook 
--extra-vars packer_build_name=amazon-ebs packer_builder_type=amazon-ebs -i 
/tmp/packer-provisioner-ansible774557480 
/home/richard/git/ansible/playbooks/windows_image_build/playbook.yml 
--private-key /tmp/ansible-key713730989 --extra-vars {'environment_name': 
'packer', 'hosting_environment': 'aws', 'connection': 'packer'} --skip-tags 
gitchecks --skip-tags gather_facts --skip-tags slack
==> amazon-ebs: Executing Ansible: ansible-playbook --extra-vars 
packer_build_name=amazon-ebs packer_builder_type=amazon-ebs -i 
/tmp/packer-provisioner-ansible774557480 
/home/richard/git/ansible/playbooks/windows_image_build/playbook.yml 
--private-key /tmp/ansible-key713730989 --extra-vars {'environment_name': 
'packer', 'hosting_environment': 'aws', 'connection': 'packer'} --skip-tags 
gitchecks --skip-tags gather_facts --skip-tags slack
2019/08/13 07:38:03 ui: amazon-ebs:  [WARNING]: Found variable using 
reserved name: connection
amazon-ebs:  [WARNING]: Found variable using reserved name: connection
amazon-ebs:
2019/08/13 07:38:03 ui: amazon-ebs:
2019/08/13 07:38:03 ui: amazon-ebs: PLAY [all] 
*
amazon-ebs: PLAY [all] 
*
2019/08/13 07:38:03 ui: amazon-ebs:
amazon-ebs:
2019/08/13 07:38:03 ui: amazon-ebs: TASK [Gathering Facts] 
*
amazon-ebs: TASK [Gathering Facts] 
*
2019/08/13 07:38:03 packer: 2019/08/13 07:38:03 SSH proxy: accepted 
connection
2019/08/13 07:38:03 packer: 2019/08/13 07:38:03 authentication attempt from 
127.0.0.1:41696 to 127.0.0.1:36005 as richard using none
2019/08/13 07:38:03 packer: 2019/08/13 07:38:03 authentication attempt from 
127.0.0.1:41696 to 127.0.0.1:36005 as richard using publickey
2019/08/13 07:38:03 packer: 2019/08/13 07:38:03 new env request: 
LANG=en_GB.UTF-8
2019/08/13 07:38:03 packer: 2019/08/13 07:38:03 new exec request: /bin/sh 
-c 'echo ~richard && sleep 0'
2019/08/13 07:38:03 packer: 2019/08/13 07:38:03 [INFO] starting remote 
command: /bin/sh -c 'echo ~richard && sleep 0'
2019/08/13 07:38:03 packer: 2019/08/13 07:38:03 [INFO] command '/bin/sh -c 
'echo ~richard && sleep 0'' exited with code: 1
2019/08/13 07:38:03 packer: 2019/08/13 07:38:03 [INFO] RPC endpoint: 
Communicator ended with: 1
2019/08/13 07:38:03 [INFO] 0 bytes written for 'stdout'
2019/08/13 07:38:03 [INFO] 44 bytes written for 'stderr'
2019/08/13 07:38:03 [INFO] RPC client: Communicator ended with: 1
2019/08/13 07:38:03 [INFO] RPC endpoint: Communicator ended with: 1
2019/08/13 07:38:03 [INFO] 0 bytes written for 'stdin'
2019/08/13 07:38:03 packer: 2019/08/13 07:38:03 [INFO] 0 bytes written for 
'stdout'
2019/08/13 07:38:03 packer: 2019/08/13 07:38:03 [INFO] 44 bytes written for 
'stderr'
2019/08/13 07:38:03 packer: 2019/08/13 07:38:03 [INFO] RPC client: 
Communicator ended with: 1
2019/08/13 07:38:03 packer: 2019/08/13 07:38:03 [INFO] 0 bytes written for 
'stdin'
2019/08/13 07:38:03 packer: 2019/08/13 07:38:03 new env request: 
LANG=en_GB.UTF-8
2019/08/13 07:38:03 packer: 2019/08/13 07:38:03 new exec request: /bin/sh 
-c 'echo "`pwd`" && sleep 0'
2019/08/13 07:38:03 packer: 2019/08/13 07:38:03 [INFO] starting remote 
command: /bin/sh -c 'echo "`pwd`" && sleep 0'
2019/08/13 07:38:03 packer: 2019/08/13 07:38:03 [INFO] command '/bin/sh -c 
'echo "`pwd`" && sleep 0'' exited with code: 1
2019/08/13 07:38:03 packer: 2019/08/13 07:38:03 [INFO] RPC endpoint: 
Communicator ended with: 1
2019/08/13 07:38:03 [INFO] 44 bytes written for 'stderr'
2019/08/13 07:38:03 [INFO] 0 bytes written for 'st