Deleted hosts keep getting imported

Hi,

I've got Foreman 1.1 set up and deploying VMs. When I delete a VM, it keeps
getting reimported into Foreman (presumably
via puppet:import:hosts_and_facts which I have run every 30 mins). Is there
a way of stopping this happening? I'm not sure if it's a bug or if I've
missed some configuration somewhere…

Cheers,

Andy

Is there any particular reason for running the rake task every 30mins?
Generally one would use the ENC script (node.rb) to upload data for
existing hosts, the import is generally there to provide a way to do a
mass-import when you first start using Foreman.

Cheers,
Greg

··· On 7 March 2013 11:51, Andy Taylor wrote:

Hi,

I’ve got Foreman 1.1 set up and deploying VMs. When I delete a VM, it
keeps getting reimported into Foreman (presumably
via puppet:import:hosts_and_facts which I have run every 30 mins). Is there
a way of stopping this happening? I’m not sure if it’s a bug or if I’ve
missed some configuration somewhere…

Cheers,

Andy

Are you using Foreman as an ENC? If so, the ENC script uploads facts as
the host checks into Puppet so you don't need the
puppet:import:hosts_and_facts rake task on cron. This means only when
the host is live that it'll get created in Foreman.

If you're not using it as an ENC, then I'd suggest adding a cronjob to
remove old facts files, so the data being imported into Foreman is
always fresh, e.g.

find /var/lib/puppet/yaml/facts/ -mtime +1 -delete

··· On 07/03/13 11:51, Andy Taylor wrote: > Hi, > > I've got Foreman 1.1 set up and deploying VMs. When I delete a VM, it > keeps getting reimported into Foreman (presumably > via puppet:import:hosts_and_facts which I have run every 30 mins). Is > there a way of stopping this happening? I'm not sure if it's a bug or if > I've missed some configuration somewhere...


Dominic Cleal
Red Hat Engineering

Thanks for your replies guys.

I'm using the rake import task on a cron as I think that was recommended in
the docs a while back if you weren't using Foreman as an ENC. I'm using
both Foreman and Puppet manifests for node classification, so as far as I
know I need to import the facts (otherwise I'll only see the Foreman
managed hosts in the Foreman interface)

Thanks for the suggestion Dominic, I'll try clearing out the facts folder
on a regular basis.

Cheers,
Andy