The data needed for this is already in the YAML generated by Foreman (and 
hence, the host facts).  I was just hoping that someone else had already gone 
through the work of parsing it as it is buried in hashes so you have to loop 
and test to pull it out.  :-D

It turns out that Puppet (4, at least) does a good enough job at figuring out 
what the "primary" IP of a host is for my needs.  So I can just use ::ipaddress.

Thanks for link to Vox, though.  I'll see if there are any other goodies in 
there I could make use of.

j


----- Original Message -----
From: "Greg Sutcliffe" <greg.sutcli...@gmail.com>
To: "Foreman Users" <foreman-users@googlegroups.com>
Sent: Monday, April 3, 2017 6:49:39 AM
Subject: Re: [foreman-users] "provisioning" IP for Puppet

On Tuesday, 28 March 2017 23:04:09 BST 'Jason B. Nance' via Foreman users 
wrote:
> Hello,
> 
> Has anyone happened to already have written some code to get the
> "provisioning" IP (provision: true in the foreman_interfaces array) for a
> host for use in a Puppet ERB template?

I'm not aware of any puppet module for working with foreman_interfaces, 
although that would be cool :)

You could use something more generic (like https://github.com/voxpupuli/
puppet-network) and pass in data via the smart parameters - then you'd put 
something like <%= @host.provision_interface.ip %> in your matcher

HTH
Greg

-- 
You received this message because you are subscribed to the Google Groups 
"Foreman users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to foreman-users+unsubscr...@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Foreman users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to foreman-users+unsubscr...@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to