Finish Script not run on Ubuntu 15.10 or Ubuntu 16.04

I use foreman to provision to vSphere. I have vSphere templates for Ubuntu
12.04, 14.04, 15.10, and 16.04. Both Ubuntu 12.04 and 14.04 work properly
(except for the disk size bug). Ubuntu 15.10 and 16.04 are provisioned
from the template. Foreman just hangs on 'configuring instance' in the UI.
There is nothing in the logs after 'getting dhcp'. Even when I enable
debug.

If I login to the provisioned vm, the finish script is sitting in the home
directory. But it has never been run. I created a noop script (see
below). This script is never run. There is nothing in the syslog on the
guest either.
<%#
kind: finish
name: Landcare Ubuntu Finish
oses:

  • Ubuntu 15.10
  • Ubuntu 16.04
    %>
    #!/bin/bash

logger '=== Starting finish Script ==='
logger '=== End of finish Script ==='

exit 0

Anyone know what might be going wrong?

Thank you

Check the Foreman production logs - the finish process goes like this:

  • SSH to target to check it's up
  • SCP rendered script to target
  • SSH to target and run script

So, the final part is where it's hanging, and hopefully it'll be visible in
the Foreman logs

Solved!!! I forgot to allow no passwords for the ssh user on sudo!

··· On Friday, April 29, 2016 at 9:47:37 AM UTC+12, Michael Speth wrote: > > I use foreman to provision to vSphere. I have vSphere templates for > Ubuntu 12.04, 14.04, 15.10, and 16.04. Both Ubuntu 12.04 and 14.04 work > properly (except for the disk size bug). Ubuntu 15.10 and 16.04 are > provisioned from the template. Foreman just hangs on 'configuring > instance' in the UI. There is nothing in the logs after 'getting dhcp'. > Even when I enable debug. > > If I login to the provisioned vm, the finish script is sitting in the home > directory. But it has never been run. I created a noop script (see > below). This script is never run. There is nothing in the syslog on the > guest either. > <%# > kind: finish > name: Landcare Ubuntu Finish > oses: > - Ubuntu 15.10 > - Ubuntu 16.04 > %> > #!/bin/bash > > logger '=== Starting finish Script ===' > logger '=== End of finish Script ===' > > exit 0 > > Anyone know what might be going wrong? > > Thank you >

Here is the production log starting when the vm was provisioned. Its a bit
hard to parse through it as puppet is constantly sending reports.

http://dumptext.com/fAYZtw3Y

··· On Friday, April 29, 2016 at 8:48:56 PM UTC+12, Greg Sutcliffe wrote: > > Check the Foreman production logs - the finish process goes like this: > > * SSH to target to check it's up > * SCP rendered script to target > * SSH to target and run script > > So, the final part is where it's hanging, and hopefully it'll be visible > in the Foreman logs >

This seems to be the only relevant information:
2016-05-02T10:49:34 [app] [I] Parameters: {"utf8"=>"✓",
"authenticity_token"=>"H2h1FBqjdLey2WaJnOIWRC2BRzYu8A0s0L81ndbP8XA=",
"host"=>{"name"=>"foreman-test-100", "hostgroup_id"=>"2",
"compute_resource_id"=>"4", "puppetclass_ids"=>[""], "managed"=>"true",
"progress_report_id"=>"[FILTERED]", "type"=>"Host::Managed",
"interfaces_attributes"=>{"0"=>{"_destroy"=>"0", "type"=>"Nic::Managed",
"mac"=>"", "identifier"=>"eth0", "name"=>"foreman-test-100",
"domain_id"=>"9", "subnet_id"=>"13", "ip"=>"192.168.250.53",
"managed"=>"1", "primary"=>"1", "provision"=>"1", "virtual"=>"0",
"tag"=>"", "attached_to"=>"",
"compute_attributes"=>{"type"=>"VirtualVmxnet3", "network"=>"VM_Config"}},
"1"=>{"_destroy"=>"0", "type"=>"Nic::Managed", "mac"=>"",
"identifier"=>"eth1", "name"=>"", "domain_id"=>"", "subnet_id"=>"",
"ip"=>"", "managed"=>"0", "primary"=>"0", "provision"=>"0", "virtual"=>"0",
"tag"=>"", "attached_to"=>"",
"compute_attributes"=>{"type"=>"VirtualVmxnet3", "network"=>"LAN172"}}},
"compute_attributes"=>{"cpus"=>"1", "corespersocket"=>"1",
"memory_mb"=>"1024", "cluster"=>"Palmerston North HA", "resource_pool"=>"3
Low Priority VM's", "path"=>"/Datacenters/Palmerston North/vm/Informatics
VM's", "guest_id"=>"ubuntu64Guest",
"scsi_controller_type"=>"VirtualLsiLogicController",
"hardware_version"=>"Default", "memoryHotAddEnabled"=>"0",
"cpuHotAddEnabled"=>"0", "start"=>"1",
"volumes_attributes"=>{"0"=>{"_delete"=>"", "datastore"=>"3Par_NL_RAID6_3",
"name"=>"Hard disk", "size_gb"=>"10", "thin"=>"true",
"eager_zero"=>"false"}}, "image_id"=>"Informatics VM's/Ubuntu 16.04
Template"}, "architecture_id"=>"1", "operatingsystem_id"=>"9",
"provision_method"=>"image", "build"=>"1", "disk"=>"",
"root_pass"=>"[FILTERED]", "is_owned_by"=>"4-Users", "enabled"=>"1",
"model_id"=>"", "comment"=>"", "overwrite"=>"false"},
"capabilities"=>"build image", "provider"=>"Vmware",
"bare_metal_capabilities"=>"build"}
2016-05-02T10:51:00 [app] [I] Create DHCP reservation for
foreman-test-100.config.landcareresearch.co.nz-00:50:56:8a:43:c1/192.168.250.53

··· On Friday, April 29, 2016 at 8:48:56 PM UTC+12, Greg Sutcliffe wrote: > > Check the Foreman production logs - the finish process goes like this: > > * SSH to target to check it's up > * SCP rendered script to target > * SSH to target and run script > > So, the final part is where it's hanging, and hopefully it'll be visible > in the Foreman logs >