razorsedge / puppet-network

Puppet module to manage Red Hat/Fedora traditional network configuration.
http://forge.puppetlabs.com/razorsedge/network
Other
55 stars 138 forks source link

Allow PHYSDEV variable #74

Open opolyakov opened 9 years ago

opolyakov commented 9 years ago

Sometimes one needs to specify PHYSDEV for VLAN interface, for example when interfaces are named vlanXXXX.

Here is the simple patch to add PHYSDEV into puppet-network :

--- manifests/init.pp.orig 2015-10-02 13:25:27.000000000 -0700
+++ manifests/init.pp 2015-10-01 16:45:32.000000000 -0700
@@ -116,6 +116,7 @@
$domain = undef,
$bridge = undef,
$linkdelay = undef,
+ $physdev = undef
) {
# Validate our booleans
validate_bool($userctl)
--- manifests/if/bridge.pp.orig 2015-10-02 13:26:47.000000000 -0700
+++ manifests/if/bridge.pp 2015-10-01 16:43:33.000000000 -0700
@@ -33,6 +33,7 @@
$bridge,
$mtu = undef,
$ethtool_opts = undef,
+ $physdev = undef
) {
# Validate our regular expressions
$states = [ '^up$', '^down$' ]
--- templates/ifcfg-eth.erb.orig 2015-10-02 13:26:00.000000000 -0700
+++ templates/ifcfg-eth.erb 2015-10-01 16:39:11.000000000 -0700
@@ -50,4 +50,6 @@
<% end -%>
<% if @linkdelay %>LINKDELAY=<%= @linkdelay %>
<% end -%>
+<% if @physdev %>PHYSDEV="<%= @physdev %>"
+<% end -%>
NM_CONTROLLED=no

Puppet config for VLAN interface would include line physdev => 'eth0',

It will be shown in configuration file as PHYSDEV="eth0"

It would be also nice to add VLAN_NAME_TYPE variable there.

razorsedge commented 9 years ago

@opolyakov Would you mind submitting that as a PR against the develop branch? Perhaps with some info in the README.md?

opolyakov commented 9 years ago

I can do it, It just may take some time .

 On Tuesday, October 6, 2015 11:22 PM, Mike Arnold <notifications@github.com> wrote:

@opolyakov Would you mind submitting that as a PR against the develop branch? Perhaps with some info in the README.md?— Reply to this email directly or view it on GitHub.