Kickstart puppet run registers duplicate host in Foreman as 'localhost.localdomain'

Morning all

I'm currently testing building some Centos systems using Foreman.

I've managed to get nodes kickstarting and building without any issues,
however my challenge seems to come in when the node is trying to register
itself as built.

Below is an example from foreman production.log:

Started GET "/node/act-star-lrs01.card.co.uk?format=yml" for 10.0.31.149 at
> 2013-10-24 10:57:43 +0100
> Processing by HostsController#externalNodes as YML
> Parameters: {"name"=>"act-star-lrs01.card.co.uk"}
> Rendered text template (0.0ms)
> Completed 200 OK in 86ms (Views: 2.4ms | ActiveRecord: 9.7ms)
>
>
> Started POST "/reports/create?format=yml" for 10.0.31.149 at 2013-10-24
> 10:57:46 +0100
> Processing by ReportsController#create as YML
> Parameters: {"report"=>"[FILTERED]"}
> processing report for act-star-lrs01.card.co.uk
> Rendered text template (0.0ms)
> Completed 200 OK in 4171ms (Views: 2.4ms | ActiveRecord: 1306.5ms)
>
>
> Started GET "/unattended/built" for 10.0.0.108 at 2013-10-24 10:57:50 +0100
> Processing by UnattendedController#built as /
> Found act-star-lrs01.card.co.uk
> unattended: act-star-lrs01.card.co.uk is Built!
> Completed 409 Conflict in 3362ms (ActiveRecord: 64.3ms)
>
>
However the system is still showing as 'Building'. When I try to manually
mark the system as built, then I get an error message of:

> Failed to cancel pending build for act-star-lrs01.card.co.uk

Again looking in production.log, I get:

> Started GET "/hosts/act-star-lrs01.card.co.uk/cancelBuild" for
> 172.30.17.2 at 2013-10-24 11:52:09 +0100
> Processing by HostsController#cancelBuild as HTML
> Parameters: {"id"=>"act-star-lrs01.card.co.uk"}
> Failed to save: Ip has already been taken, Mac has already been taken
> Redirected to https://foreman/hosts/act-star-lrs01.card.co.uk
> Completed 302 Found in 228ms (ActiveRecord: 27.7ms)
>

This lead me to look for other hosts with the same IP address, which gives
me a host called 'localhost.localdomain'.

I can only assume that when the kickstart %post section runs Puppet, the
hostname either isn't set correctly, or Facter is mis-reading it?

A copy of my kickstart is available here:

Any ideas?

Cheers
Gavin