Suggestions on how to use interface ENC data with Puppet

Having upgraded to Foreman 1.7.3 I'm delighted to see the additional
network interface information that is now available in a host's ENC output.
Before I go and possibly re-invent the wheel, does anyone have suggestions
on how to use this data in Puppet? The output for foreman_subnets and foreman_interfaces
appears to be an Array of Hash objects. My initial idea is that this could
be passed into the create_resources function to some custom defined type
that then defines resources based on the information. I'm currently
relying on razorsedge/network module to define my network interfaces. I've
created a Puppet class for each of my subnets that defines a
network::if::static resource. This is all very manual as I have to provide
the IP address and interface name via Hiera. Would be great to simply rely
on the data provided by Foreman.

Thanks,

  • Trey

Hello,

I don't know about any existing module that would use this data. Please let us
know if you build something as we'd like to provide some built-in
configuration in Foreman in future. Currently there are no hard plans or dates
so I wouldn't wait on it.

Btw I like custom types as it should be easy to add providers that are
platform specific.

··· On Wednesday 18 of March 2015 10:37:25 treydock wrote: > Having upgraded to Foreman 1.7.3 I'm delighted to see the additional > network interface information that is now available in a host's ENC output. > Before I go and possibly re-invent the wheel, does anyone have suggestions > on how to use this data in Puppet? The output for foreman_subnets and > foreman_interfaces appears to be an Array of Hash objects. My initial idea > is that this could be passed into the create_resources function to some > custom defined type that then defines resources based on the information. > I'm currently relying on razorsedge/network module to define my network > interfaces. I've created a Puppet class for each of my subnets that > defines a > network::if::static resource. This is all very manual as I have to provide > the IP address and interface name via Hiera. Would be great to simply rely > on the data provided by Foreman. > > Thanks, > - Trey


Marek

Marek,

When you mention custom type, do you mean for managing the network
interface or for parsing the ENC data?

I've been using https://github.com/razorsedge/puppet-network but have come
across https://github.com/puppet-community/puppet-network which seems
promising.

At the very least a custom function would be needed to convert the ENC data
from an array of hash objects to just a hash in order to use something like
create_resources with existing modules that configure interfaces.

  • Trey
··· On Sun, Mar 22, 2015 at 3:34 AM, Marek Hulan wrote:

On Wednesday 18 of March 2015 10:37:25 treydock wrote:

Having upgraded to Foreman 1.7.3 I’m delighted to see the additional
network interface information that is now available in a host’s ENC
output.
Before I go and possibly re-invent the wheel, does anyone have
suggestions
on how to use this data in Puppet? The output for foreman_subnets and
foreman_interfaces appears to be an Array of Hash objects. My initial
idea
is that this could be passed into the create_resources function to some
custom defined type that then defines resources based on the information.
I’m currently relying on razorsedge/network module to define my network
interfaces. I’ve created a Puppet class for each of my subnets that
defines a
network::if::static resource. This is all very manual as I have to
provide
the IP address and interface name via Hiera. Would be great to simply
rely
on the data provided by Foreman.

Thanks,

  • Trey

Hello,

I don’t know about any existing module that would use this data. Please
let us
know if you build something as we’d like to provide some built-in
configuration in Foreman in future. Currently there are no hard plans or
dates
so I wouldn’t wait on it.

Btw I like custom types as it should be easy to add providers that are
platform specific.


Marek


You received this message because you are subscribed to a topic in the
Google Groups “Foreman users” group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/foreman-users/G6XXgYNbY44/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at http://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.

Hello,

I meant custom types for managing the network interfaces. I agree that custom
function would make using of create_resources much simpler. So the module
would depend on puppet-network an just provided a converting function from one
format to another.

··· -- Marek

On Monday 06 of April 2015 12:45:05 Trey Dockendorf wrote:

Marek,

When you mention custom type, do you mean for managing the network
interface or for parsing the ENC data?

I’ve been using https://github.com/razorsedge/puppet-network but have come
across https://github.com/puppet-community/puppet-network which seems
promising.

At the very least a custom function would be needed to convert the ENC data
from an array of hash objects to just a hash in order to use something like
create_resources with existing modules that configure interfaces.

  • Trey

On Sun, Mar 22, 2015 at 3:34 AM, Marek Hulan mhulan@redhat.com wrote:

On Wednesday 18 of March 2015 10:37:25 treydock wrote:

Having upgraded to Foreman 1.7.3 I’m delighted to see the additional
network interface information that is now available in a host’s ENC

output.

Before I go and possibly re-invent the wheel, does anyone have

suggestions

on how to use this data in Puppet? The output for foreman_subnets and
foreman_interfaces appears to be an Array of Hash objects. My initial

idea

is that this could be passed into the create_resources function to some
custom defined type that then defines resources based on the
information.
I’m currently relying on razorsedge/network module to define my network
interfaces. I’ve created a Puppet class for each of my subnets that
defines a
network::if::static resource. This is all very manual as I have to

provide

the IP address and interface name via Hiera. Would be great to simply

rely

on the data provided by Foreman.

Thanks,

  • Trey

Hello,

I don’t know about any existing module that would use this data. Please
let us
know if you build something as we’d like to provide some built-in
configuration in Foreman in future. Currently there are no hard plans or
dates
so I wouldn’t wait on it.

Btw I like custom types as it should be easy to add providers that are
platform specific.


Marek


You received this message because you are subscribed to a topic in the
Google Groups “Foreman users” group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/foreman-users/G6XXgYNbY44/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at http://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.


Marek

So I have a proof-of-concept ready that could use some input on. I have
not tested it outside of rspec. My goal was to make it somewhat flexible
which in turn made the custom function a bit more complex than I'd like.

https://github.com/treydock/puppet-foreman_networking

I'm just now getting my Foreman 1.8 system setup so the networks in Foreman
are what I want Puppet to setup on the server. The docs are non-existent
for my proof-of-concept until I finalize how this may work but here's
example usage to setup basic static interfaces:

class profile::base {
$static_interfaces = foreman_static_interfaces()
create_resources('network::if::static', $static_interfaces, {'ensure' =>
'up'})
}

That example is using https://forge.puppetlabs.com/razorsedge/network.

Right now one big assumption I've made is that a Foreman interface must be
marked "Managed" (managed: true) to be considered as something to manage in
Puppet. There are also more complex things like bonds I haven't considered
yet.

I'm having issues testing other providers since the modules have the same
name and loading them as fixtures with a made-up name doesn't seem to work.
There are other network management modules
like https://github.com/puppet-community/puppet-network but that module
doesn't manage the state of the currently running interfaces, just updates
the config files (at least that's how it appears from reading provider).

  • Trey
··· On Tuesday, April 7, 2015 at 1:47:08 AM UTC-5, Marek Hulan wrote: > > Hello, > > I meant custom types for managing the network interfaces. I agree that > custom > function would make using of create_resources much simpler. So the module > would depend on puppet-network an just provided a converting function from > one > format to another. > > -- > Marek > > On Monday 06 of April 2015 12:45:05 Trey Dockendorf wrote: > > Marek, > > > > When you mention custom type, do you mean for managing the network > > interface or for parsing the ENC data? > > > > I've been using https://github.com/razorsedge/puppet-network but have > come > > across https://github.com/puppet-community/puppet-network which seems > > promising. > > > > At the very least a custom function would be needed to convert the ENC > data > > from an array of hash objects to just a hash in order to use something > like > > create_resources with existing modules that configure interfaces. > > > > - Trey > > > > On Sun, Mar 22, 2015 at 3:34 AM, Marek Hulan > wrote: > > > On Wednesday 18 of March 2015 10:37:25 treydock wrote: > > > > Having upgraded to Foreman 1.7.3 I'm delighted to see the additional > > > > network interface information that is now available in a host's ENC > > > > > > output. > > > > > > > Before I go and possibly re-invent the wheel, does anyone have > > > > > > suggestions > > > > > > > on how to use this data in Puppet? The output for foreman_subnets > and > > > > foreman_interfaces appears to be an Array of Hash objects. My > initial > > > > > > idea > > > > > > > is that this could be passed into the create_resources function to > some > > > > custom defined type that then defines resources based on the > > > > information. > > > > I'm currently relying on razorsedge/network module to define my > network > > > > interfaces. I've created a Puppet class for each of my subnets that > > > > defines a > > > > network::if::static resource. This is all very manual as I have to > > > > > > provide > > > > > > > the IP address and interface name via Hiera. Would be great to > simply > > > > > > rely > > > > > > > on the data provided by Foreman. > > > > > > > > Thanks, > > > > - Trey > > > > > > Hello, > > > > > > I don't know about any existing module that would use this data. > Please > > > let us > > > know if you build something as we'd like to provide some built-in > > > configuration in Foreman in future. Currently there are no hard plans > or > > > dates > > > so I wouldn't wait on it. > > > > > > Btw I like custom types as it should be easy to add providers that are > > > platform specific. > > > > > > -- > > > Marek > > > > > > -- > > > You received this message because you are subscribed to a topic in the > > > Google Groups "Foreman users" group. > > > To unsubscribe from this topic, visit > > > > https://groups.google.com/d/topic/foreman-users/G6XXgYNbY44/unsubscribe. > > > To unsubscribe from this group and all its topics, send an email to > > > foreman-user...@googlegroups.com . > > > To post to this group, send email to forema...@googlegroups.com > . > > > Visit this group at http://groups.google.com/group/foreman-users. > > > For more options, visit https://groups.google.com/d/optout. > > -- > Marek >

Hello Trey,

I was also looking for a way to consume Foreman's network parameters and
I'm glad I found your post. Thanks for your work.
It would be great to merge your efforts into one of the existing networking
modules. I've been playing with example42-network and seems very
capable: https://github.com/example42/puppet-network.

Anyway, I'll test your module a bit, it's promising.

Thanks,
Nicola

··· On Friday, May 15, 2015 at 10:01:49 PM UTC+2, treydock wrote: > > So I have a proof-of-concept ready that could use some input on. I have > not tested it outside of rspec. My goal was to make it somewhat flexible > which in turn made the custom function a bit more complex than I'd like. >

I think the path of least resistance would be to make this module separate
given it's very specific to Foreman and it will need to adapt as Foreman
changes. Also allowing the use of different networking modules was my
primary goal, rather than making the module only work with one implantation
of network management.

I'd very much like to support more than razorsedge-network, and from
looking at example42's module it seems possible. I will try and see if I
can make the unit tests alternate between two fixtures of the same name for
testing purposes.

Do let me know if you have any issues. My goal was to make the module
flexible, but I've only been able to test it on basic networking and
razorsedge module.

··· On Jun 30, 2015 8:31 AM, "Nicola V" wrote:

On Friday, May 15, 2015 at 10:01:49 PM UTC+2, treydock wrote:

So I have a proof-of-concept ready that could use some input on. I have
not tested it outside of rspec. My goal was to make it somewhat flexible
which in turn made the custom function a bit more complex than I’d like.

Hello Trey,

I was also looking for a way to consume Foreman’s network parameters and
I’m glad I found your post. Thanks for your work.
It would be great to merge your efforts into one of the existing
networking modules. I’ve been playing with example42-network and seems very
capable: https://github.com/example42/puppet-network.

Anyway, I’ll test your module a bit, it’s promising.

Thanks,
Nicola


You received this message because you are subscribed to a topic in the
Google Groups “Foreman users” group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/foreman-users/G6XXgYNbY44/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at http://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.

Thanks Trey, I'll keep an eye on your work. I'll try to provide some
contribution in case my code proves to be decent enough.

Nicola

··· On Tuesday, June 30, 2015 at 4:50:28 PM UTC+2, treydock wrote: > > I think the path of least resistance would be to make this module separate > given it's very specific to Foreman and it will need to adapt as Foreman > changes. Also allowing the use of different networking modules was my > primary goal, rather than making the module only work with one implantation > of network management. > > I'd very much like to support more than razorsedge-network, and from > looking at example42's module it seems possible. I will try and see if I > can make the unit tests alternate between two fixtures of the same name for > testing purposes. > > Do let me know if you have any issues. My goal was to make the module > flexible, but I've only been able to test it on basic networking and > razorsedge module. > On Jun 30, 2015 8:31 AM, "Nicola V" <volpini...@gmail.com > > wrote: > >> On Friday, May 15, 2015 at 10:01:49 PM UTC+2, treydock wrote: >>> >>> So I have a proof-of-concept ready that could use some input on. I have >>> not tested it outside of rspec. My goal was to make it somewhat flexible >>> which in turn made the custom function a bit more complex than I'd like. >>> >> >> Hello Trey, >> >> I was also looking for a way to consume Foreman's network parameters and >> I'm glad I found your post. Thanks for your work. >> It would be great to merge your efforts into one of the existing >> networking modules. I've been playing with example42-network and seems very >> capable: https://github.com/example42/puppet-network. >> >> Anyway, I'll test your module a bit, it's promising. >> >> Thanks, >> Nicola >> >> -- >> You received this message because you are subscribed to a topic in the >> Google Groups "Foreman users" group. >> To unsubscribe from this topic, visit >> https://groups.google.com/d/topic/foreman-users/G6XXgYNbY44/unsubscribe. >> To unsubscribe from this group and all its topics, send an email to >> foreman-user...@googlegroups.com . >> To post to this group, send email to forema...@googlegroups.com >> . >> Visit this group at http://groups.google.com/group/foreman-users. >> For more options, visit https://groups.google.com/d/optout. >> >