File tree Expand file tree Collapse file tree 6 files changed +28
-14
lines changed Expand file tree Collapse file tree 6 files changed +28
-14
lines changed Original file line number Diff line number Diff line change @@ -247,26 +247,21 @@ Static interface routes (host route):
247
247
248
248
Normal interface - VLAN - no IP:
249
249
250
- class { 'network::global':
251
- vlan => 'yes',
252
- }
253
-
254
250
network::if { 'eth0.330':
255
251
ensure => 'up',
256
- }
252
+ vlan => 'yes',
253
+ }
257
254
258
255
Normal interface - VLAN - static IPv4:
259
256
260
- class { 'network::global':
261
- vlan => 'yes',
262
- }
263
-
264
257
network::if::static { 'eth0.330':
265
258
ensure => 'up',
266
259
ipaddress => '10.2.3.248',
267
260
netmask => '255.255.255.0',
261
+ vlan => 'yes',
268
262
}
269
263
264
+
270
265
Promiscuous interface:
271
266
To set a static or dynamic interface to promiscuous mode (RedHat only), add:
272
267
promisc => true
@@ -333,7 +328,6 @@ Notes
333
328
* It is assumed that if you create a bond that you also create the slave interface(s).
334
329
* It is assumed that if you create an alias that you also create the parent interface.
335
330
* network::route requires the referenced device to also be defined via network::if or network::bond.
336
- * For VLANs to work, ` Class['network::global'] ` must have parameter ` vlan ` set to ` yes ` .
337
331
* To enable IPv6 you have to set both ` ipv6networking ` in ` Class['network::global'] ` to ` true ` and ` ipv6init ` in ` network::if::static ` to ` true ` .
338
332
339
333
Issues
Original file line number Diff line number Diff line change 20
20
# $ipv6defaultdev - optional - Determines the device to use as the default gateway
21
21
# for IPV6 traffic.
22
22
# $nisdomain - optional - Configures the NIS domainname.
23
- # $vlan - optional - yes|no to enable VLAN kernel module
23
+ # $vlan - optional - ' yes' or 'no' [deprecated] use on device level
24
24
# $ipv6networking - optional - enables / disables IPv6 globally
25
25
# $nozeroconf - optional
26
26
# $restart - optional - defaults to true
43
43
# ipv6gateway => '123:4567:89ab:cdef:123:4567:89ab:1',
44
44
# ipv6defaultdev => 'eth0',
45
45
# nisdomain => 'domain.tld',
46
- # vlan => 'yes',
47
46
# ipv6networking => true,
48
47
# nozeroconf => 'yes',
49
48
# requestreopen => false,
65
64
$hostname = undef ,
66
65
$gateway = undef ,
67
66
$gatewaydev = undef ,
67
+ $vlan = undef ,
68
68
$ipv6gateway = undef ,
69
69
$ipv6defaultdev = undef ,
70
70
$nisdomain = undef ,
71
- $vlan = undef ,
72
71
$ipv6networking = false ,
73
72
$nozeroconf = undef ,
74
73
$restart = true ,
Original file line number Diff line number Diff line change 29
29
# $defroute - optional
30
30
# $restart - optional - defaults to true
31
31
# $arpcheck - optional - defaults to true
32
+ # $vlan - optional - yes|no defaults to no
32
33
#
33
34
# === Actions:
34
35
#
82
83
$metric = undef ,
83
84
$restart = true ,
84
85
$arpcheck = true ,
86
+ $vlan = undef ,
85
87
) {
86
88
# Validate our data
87
89
if $ipaddress {
119
121
validate_bool($flush )
120
122
validate_bool($arpcheck )
121
123
124
+ # Validate our regular expressions
125
+ if $vlan {
126
+ $states = [ ' ^yes$' , ' ^no$' ]
127
+ validate_re($vlan , $states , ' $vlan must be either "yes" or "no".' )
128
+ }
129
+
122
130
network_if_base { $title:
123
131
ensure => $ensure ,
124
132
ipv6init => $ipv6init ,
148
156
metric => $metric ,
149
157
restart => $restart ,
150
158
arpcheck => $arpcheck ,
159
+ vlan => $vlan ,
151
160
}
152
161
} # define network::if::static
Original file line number Diff line number Diff line change 79
79
# $promisc - optional - defaults to false
80
80
# $restart - optional - defaults to true
81
81
# $arpcheck - optional - defaults to true
82
+ # $vlan - optional - defaults to 'no'
82
83
#
83
84
# === Actions:
84
85
#
140
141
$promisc = false ,
141
142
$restart = true ,
142
143
$arpcheck = true ,
144
+ $vlan = undef ,
143
145
) {
144
146
# Validate our booleans
145
147
validate_bool($noaliasrouting )
158
160
# Validate our regular expressions
159
161
$states = [ ' ^up$' , ' ^down$' ]
160
162
validate_re($ensure , $states , ' $ensure must be either "up" or "down".' )
163
+ if ($vlan ) {
164
+ $vlanstates = [ ' ^yes$' , ' ^no$' ]
165
+ validate_re($vlan , $vlanstates , ' $vlan must be either "yes" or "no".' )
166
+ }
161
167
162
168
include '::network'
163
169
Original file line number Diff line number Diff line change 169
169
:metric => '10' ,
170
170
:zone => 'trusted' ,
171
171
:arpcheck => false ,
172
+ :vlan => 'yes' ,
172
173
}
173
174
end
174
175
let :facts do {
212
213
'DEFROUTE=yes' ,
213
214
'ZONE=trusted' ,
214
215
'METRIC=10' ,
215
- 'ARPCHECK=no' ,
216
+ 'ARPCHECK=no' ,
217
+ 'VLAN=yes' ,
216
218
'NM_CONTROLLED=no' ,
217
219
] )
218
220
end
225
227
:ensure => 'up' ,
226
228
:ipaddress => '1.2.3.4' ,
227
229
:netmask => '255.255.255.0' ,
230
+ :vlan => 'yes' ,
228
231
}
229
232
end
230
233
let :facts do {
250
253
'TYPE=Ethernet' ,
251
254
'IPADDR=1.2.3.4' ,
252
255
'NETMASK=255.255.255.0' ,
256
+ 'VLAN=yes' ,
253
257
'NM_CONTROLLED=no' ,
254
258
] )
255
259
end
Original file line number Diff line number Diff line change @@ -70,4 +70,6 @@ check_link_down() {
70
70
<% end -%>
71
71
<% if !@arpcheck %> ARPCHECK=no
72
72
<% end -%>
73
+ <% if @vlan %> VLAN=<%= @vlan %>
74
+ <% end -%>
73
75
NM_CONTROLLED=no
You can’t perform that action at this time.
0 commit comments