Add second NIC as fixed IP

Hi,

I have been working with Foreman for about 2 months now but I reached a
roadblock and don't know how to continue. Here is the situation:

I am trying to provision a static IP on a physical computer that has two
NIC cards. I can set the first NIC as fixed through the kickstart using the
following entry:

network --bootproto static --ip=<%= @host.ip %> --netmask=<%=
@host.subnet.mask %> --gateway=<%= @host.subnet.gateway %> --nameserver=<%=
@host.subnet.dns_primary %> --hostname <%= @host %>

This will setup the IP as it is defined in the GUI of Foreman.

As for the second NIC, I want it to be configured through puppet, but so
far I have not found a way to do so. I tried using the definitions from
razorsedge ( https://forge.puppetlabs.com/razorsedge/network ) but there
are no variables that are added to foreman once I update foreman with the
latest puppet modules. FYI, in this manifest the NIC card configurations
are set as defined and the author recommends adding a simple node
configuration as follows:

node default {
include network
network::if::static { "eth1":
ipaddress => "1.2.3.248",
netmask => "255.255.255.128",
ensure => "up",
}
include groups
}

Problem is, I don't know how to include these statements in the foreman gui. I read about using External nodes, but the instructions on how to use it are not clear to me. I also tried looking for youtube videos to see if somebody was using external nodes but couldnt' find anything.

This might not be the best way to add a second static NIC, so I am open to alternatives to complete this task.

Thanks for your help.
IB

Hello,

> Problem is, I don't know how to include these statements in the
> foreman gui. I read about using External nodes, but the instructions
> on how to use it are not clear to me. I also tried looking for youtube
> videos to see if somebody was using external nodes but couldnt' find
> anything.

As long as your puppet module provides Parametrized Classes, you can
import them into Foreman and then assign them to hosts giving them
required parameters.

Read the manual:

http://theforeman.org/manuals/1.4/#4.2ManagingPuppet

··· -- Later,

Lukas “lzap” Zapletal
irc: lzap #theforeman

razorsedge/puppet-network <https://github.com/razorsedge/puppet-network> is
focused on using resource definitions more than parametrized classes. I
think OP's best bet might be to write a wrapper class to import into
Foreman.

I use a similar hack-ish tactic to use params to convert from dhcp to
static post provision…

$use_gateway = $::default_gateway_interface ? {
  $udnet::interface =&gt; $::default_gateway,
  default           =&gt; undef,
}
case $udnet::ip_method {
  /(?i:static)/: {
    network::if::static { $udnet::interface:
      ensure     =&gt; &#39;up&#39;,
      ipaddress  =&gt; inline_template(&quot;&lt;%=

scope.lookupvar('::ipaddress_${udnet::interface}') %>"),
netmask => inline_template("<%=
scope.lookupvar('::netmask_${udnet::interface}') %>"),
gateway => $use_gateway,
macaddress => inline_template("<%=
scope.lookupvar('::macaddress_${udnet::interface}') %>"),
}
}
/(?i:dynamic|dhcp)/: {
network::if::dynamic { $udnet::interface:
ensure => 'up',
}
}

I've also found that doing such host specific things with an arbitrary
class can be quite difficult. As a result, I've created a "hosts" class
which is designed to contain manifests for specific hosts. I often end up
using these only for host specific resource definitions like firewall
rules, nagios monitors, or apache vhosts.

Sean M. Alderman
Senior Engineer, UDit Systems Integration and Engineering
University of Dayton
salderman1@udayton.edu

"We are not some casual and meaningless product of evolution. Each of us
is the result of a thought of God. Each of us is willed. Each of us is
loved. Each of us is necessary."
- BXVI

··· On Tue, Apr 1, 2014 at 9:05 AM, Lukas Zapletal wrote:

Hello,

Problem is, I don’t know how to include these statements in the
foreman gui. I read about using External nodes, but the instructions
on how to use it are not clear to me. I also tried looking for youtube
videos to see if somebody was using external nodes but couldnt’ find
anything.

As long as your puppet module provides Parametrized Classes, you can
import them into Foreman and then assign them to hosts giving them
required parameters.

Read the manual:

Foreman :: Manual


Later,

Lukas “lzap” Zapletal
irc: lzap #theforeman


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+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.