Skip to content
Snippets Groups Projects
Commit 21671e06 authored by Thomas Bellman's avatar Thomas Bellman
Browse files

Rename rh_interface to networking::rh_interface.

This will make the Puppet autoloader find the definition.

In the future, we should introduce a "networking::interface" definition
that handles more OS:es than just RHEL and Fedora, and rh_interface
would just be the RedHat implementation (and renamed interface::redhat).
But for now, this will have to do.
parent 0ce807ec
No related branches found
No related tags found
No related merge requests found
...@@ -2,332 +2,4 @@ ...@@ -2,332 +2,4 @@
# Licensed under the GNU LGPL v3+; see the README file for more information. # Licensed under the GNU LGPL v3+; see the README file for more information.
/* # This file intentionally left blank
* Configure a network interface, on a RedHat:ish system.
*
* Parameters:
*
* - bootproto:
* The method to use for configuring IPv4 addresses:
* - dhcp: Use DHCP for configuring IP. The IPv4 addresses in
* the 'ipv4addr' and 'ipaddress' parameters will be
* ignored.
* - static: Do make use of the addresses in 'ipaddress'.
* - unconfigured: No IP configuration, but one can still configure the
* interface to be up. This is equivalent to using the
* static method without any IPv4 addresses.
*
* - ipv4addr:
* IPv4 address or list of IPv4 addresses with prefix length or netmask,
* separated by a slash (/), e.g. "192.168.199.145/255.255.248.0" or
* "10.20.30.40/28". Note that e.g. RHEL 5 only supports a single IPv4
* address per interface.
*
* - ipv6addr:
* IPv6 address or list of IPv6 addresses with prefix length, separated
* by a slash (/), e.g. "2001:db8:17:23::45/64". The special format
* "::ffff:192.0.2.128" for IPv4-mapped IPv6 addresses is not supported.
* Special "addresses":
* - "AUTOCONF": Enable autonomous address configuration (if router
* advertisments specify the autonomous flag). By
* default, autoconf will be disabled.
* - "LINKLOCAL": Enable IPv6 with a link-local address. This is
* implied if any other address (including autoconf)
* is specified, but can be used if one wants only a
* link-local address, as an empty address list will
* otherwise disable IPv6 entirely on the interface.
*
* - ipaddress:
* IPv4 and/or IPv6 addresses, with prefix length or netmask. Using
* this parameter is equivalent to using the 'ipv4addr' and 'ipv6addr'
* parameters, but you can mix IPv4 and IPv6 addresses in a single
* list. Addresses can optionally be prefixed by "ipv4:" or "ipv6:" to
* indicate which family they are; this is mandatory for the special
* keyword "addresses" ("AUTOCONF", "LINKLOCAL").
* This parameter, and the ipv4addr and ipv6addr parameters, must
* not be used at the same time.
*
* - gateway:
* Default IPv4 router to configure when the interface is up. See also
* the 'ipv4routes' parameter.
*
* - ipv4routes:
* Hash of static IPv4 routes to configure on the interface. The keys
* should be IPv4 network specifications on the format "1.2.3.0/24" or
* "1.2.3.4/255.255.255.0", or the special value "default". The values
* should be the nexthop for that destination. The special nexthop
* value "LOCAL" means that the network exists locally on the link and
* does not go via a router.
* The default IPv4 route can be specified either using an element in
* this hash (target "0.0.0.0/0" or "default"), or using the 'gateway'
* parameter, but not both at the same time.
*
* - ipv6routes:
* Hash of static IPv6 routes to configure on the interface. The keys
* should be IPv6 network specifications on the format "1:2:3::18/127",
* or the special value "default". The values should be the nexthop for
* that destination. The special nexthop value "LOCAL" means that the
* network exists locally on the link and does not to go via a router.
*
* - onboot:
* Whether the interface should be brought up automatically when the
* machine boots ("yes") or not ("no").
*
* - ensure:
* What state Puppet should set the interface to ("up" or "down") when
* run. Can also be set to "absent" to remove configuration for it.
* Udev rules are not removed when setting to absent, so the interface
* may still show up in e.g. 'ifconfig' output.
*
* - persistent_dhcp:
* Whether the DHCP client should continue to request an address when it
* does not get one ("yes") or not ("no").
*
* - bonding_slaves:
* If bonding_slaves is set to a non-empty list, this interface will be
* configured as a bonding interface ("link aggregation group"), with
* the interfaces in bonding_slaves as its slaves. The slave interfaces
* will be automatically configured as well.
*
* - bonding_opts:
* Hash of options to pass to the bonding driver, if this is a bonding
* interface (i.e. if bonding_slaves is non-empty). The 'miimon' option
* will be set to a reasonable (non-zero) interval (currently 250 ms)
* unless explicitly overridden, as you almost always want monitoring of
* the slave links in order for the bond master to not break when one
* link goes down.
*
* - extraparams:
* Hash of extra parameters to set in the ifcfg-<$name> sysconfig file.
* Each element should be a pair on the form "PARAM" => "value". No
* quoting is done, one should be careful about shell metacharacters.
* Parameters set here will override those calculated in other ways by
* this definition, and if a parameter is set to the value ``false''
* (not the string "false"), it will be deleted from the sysconfig file.
* For backwards compatibility, this can also be a list, where each
* element is a string on the form "PARAM=value"; in this variant, it is
* not possible to delete a parameter from the sysconfig file.
*
*
* Notes:
*
* - The ifup(8) command in RHEL 5 only supports a single IPv4 address
* per interface. You need to use alias interfaces (e.g. "eth0:1")
* to have more than one IPv4 address.
*
* - Alias interfaces can interact badly with IPv6. 'ifdown' on the
* alias interface can remove the IPv6 addresses set on the main
* interface. If possible (see above), set multiple IP addresses on
* the main interface instead.
*
* - When setting an interface to absent, it will be unconfigured
* separately from other interfaces. The network on the node may
* break for a while during the Puppet run, if addresses or routes
* are moved from this interface to another.
*/
define rh_interface($bootproto='static',# 'static', 'dhcp' or 'unconfigured'
$ipaddress=[], # <IP>/<MASK> or <IP>/<BITS>
$ipv4addr=[], # <IP>/<BITS>
$ipv6addr=[], # <IP>/<BITS>
$gateway='',
$ipv4routes={},
$ipv6routes={},
$onboot='yes',
$ensure='up',
$persistent_dhcp='yes',
$bonding_slaves=[],
$bonding_opts={},
$extraparams=[])
{
if $ipaddress != [] and ($ipv4addr != [] or $ipv6addr != []) {
fail("Rh_interface[${title}]:",
"ipaddress param is mutually exclusive with ipv4addr/ipv6addr")
}
if $ipaddress != [] {
$family_ipaddress = ipaddrs_by_family($ipaddress, 'ipv4', 'ipv6')
$x_ipv4addr = $family_ipaddress['ipv4']
$x_ipv6addr = $family_ipaddress['ipv6']
} else {
$x_ipv4addr = $ipv4addr
$x_ipv6addr = $ipv6addr
}
$ipv4_inuse = ($x_ipv4addr != [])
$ipv6_inuse = ($x_ipv6addr != [])
$qname = shellquote($name)
rh_interface::network_service::wrapper { $name: ; }
if ($bonding_slaves != [])
{
rh_interface {
$bonding_slaves:
bootproto => 'unconfigured',
onboot => $onboot, ensure => $ensure,
extraparams => {
# Must not set HWADDR, since the MAC address of bonding
# slaves are changed by the bonding driver, and there is
# no way of finding the "real" MAC address of the slave.
'MASTER' => $name, 'SLAVE' => 'yes', 'HWADDR' => false,
};
}
}
case $ensure
{
'up', 'down': {
file {
"/etc/sysconfig/network-scripts/ifcfg-${name}":
ensure => file,
content => template('networking/rh-ifcfg.erb'),
owner => 'root', group => 'root', mode => '0444',
notify => Class[rh_interface::network_service];
"/etc/sysconfig/network-scripts/route-${name}":
ensure => $ipv4_inuse ? { true => file, default => absent },
content => template('networking/rh-ifroute-v4.erb'),
owner => 'root', group => 'root', mode => '0444',
notify => Class[rh_interface::network_service];
"/etc/sysconfig/network-scripts/route6-${name}":
ensure => $ipv6_inuse ? { true => file, default => absent },
content => template('networking/rh-ifroute-v6.erb'),
owner => 'root', group => 'root', mode => '0444',
notify => Class[rh_interface::network_service];
}
}
'absent': {
file {
[ "/etc/sysconfig/network-scripts/ifcfg-${name}",
"/etc/sysconfig/network-scripts/route-${name}",
"/etc/sysconfig/network-scripts/route6-${name}",
]:
ensure => absent,
before => Exec["rh_interface::absent::${name}"];
}
$isup = shellquote('<(.*,|)UP(|,.*)>| state UP( |$)|^ *inet6? ')
$checkcmd = [
"{ ip addr show ${qname} | egrep ${isup}; }",
"[ -d /sys/class/net/${qname}/bridge ]",
"[ -f /proc/net/vlan/${qname} ]",
]
$downcmd = [
"ip addr flush dev ${qname}",
"ip link set dev ${qname} down",
"if [ -d /sys/class/net/${qname}/bridge ]",
" then brctl delbr ${qname}; fi",
"if [ -f /proc/net/vlan/${qname} ]",
" then ip link del dev ${qname} type vlan; fi",
]
exec {
# This case will not be handled by 'service network restart',
# as we have removed the sysconfig files for the interface.
# The network service will not touch interfaces without any
# sysconfig files. However, we will not get the atomicity
# that 'service network restart' gives us.
"rh_interface::absent::${name}":
command => inline_template('<%= @downcmd.join "; " %>'),
onlyif => inline_template('<%= @checkcmd.join " || " %>'),
provider => shell,
path => '/bin:/usr/bin:/sbin:/usr/sbin',
notify => Class[rh_interface::network_service];
}
}
default: {
fail("Bad ensure parameter to rh_interface ${title}: ${ensure}")
}
}
if $name !~ /:/
{
# Alias interfaces do not really exist independantly, so it is
# not possible to set sysctl:s on them.
# Interfaces with "." in their names (VLAN interfaces) have that
# replaced with "/" in the sysctl variable name.
$sysctl_ifname = regsubst($name, '[.]', '/')
$ipv6_sysctl_value = $ensure ? {
'absent' => '',
default => $ipv6_inuse ? { true => 0, default => 1 },
}
$if_re = sprintf('(^|.*,)%s(,.*|$)', regexp_quote($name))
if regsubst($::interfaces, $if_re, $name) == $name
{
# Interface already exists, so it should be OK to do a sysctl
# on it.
sysctl {
"net.ipv6.conf.${sysctl_ifname}.disable_ipv6":
value => $ipv6_sysctl_value,
ignoremissing => true,
notify => Class[rh_interface::network_service];
}
} else {
# Probably some kind of virtual interface (bonding interface,
# VLAN interface, bridge). Those do not exist until ifup(8)
# brings them up, and it is thus impossible to execute the
# sysctl on them until then. But that is too late, as ifup(8)
# will already have failed to set the addresses we want.
#
# Luckily, ifup in EL-6 and EL-7 executes the sysctl:s in
# /etc/sysctl.conf for the interface at the right time, before
# it sets addresses. Not so in EL-5, but the disable_ipv6
# setting defaults to 0 anyway, so if we do want IPv6 addresses,
# ifup will be able to set them. If we don't, then performing
# the sysctl after bringing up the interface, will remove the
# link-local address, but we will have an interval where it
# exists. Splitting it this way seem to be the best we can do.
sysctl::sysctl_conf {
"net.ipv6.conf.${sysctl_ifname}.disable_ipv6":
value => $ipv6_sysctl_value,
notify => Class[rh_interface::network_service];
}
sysctl::exec {
"net.ipv6.conf.${sysctl_ifname}.disable_ipv6":
value => $ipv6_sysctl_value,
ignoremissing => true,
require => Class[rh_interface::network_service];
}
}
}
}
# Helper class for rh_interface
#
# When changes to more than one interface are performed, e.g. moving a
# route, changing between bonded and non-bonded interfaces, et.c, we
# want to apply all changes in one go, with no Puppet resources applied
# between changing interface A and interface B, as we might be in a
# state without working network then.
# The disadvantage is that all interfaces will be brought down for a
# while, even if only one interface has changes.
class rh_interface::network_service
{
service {
'network':
enable => 'true', ensure => running,
hasstatus => true, hasrestart => true;
}
}
# Helper-wrapper for rh_interface::network_service...
# If someone does 'require => Rh_interface["eth0"]', we want the network
# service to be restarted before the requirement is fulfilled. A simple
# 'include rh_interface::network_service' inside rh_interface is not
# enough to do so, but 'require' is. However, we then get a dependency
# cycle, since resources inside rh_interface does notify on that class.
# We work around that with this wrapper definition. Puppet will
# then not see it as a cycle, but instead do what we want.
define rh_interface::network_service::wrapper()
{
require rh_interface::network_service
}
# Copyright (C) 2008-2020 Thomas Bellman.
# Licensed under the GNU LGPL v3+; see the README file for more information.
/*
* Configure a network interface, on a RedHat:ish system.
*
* Parameters:
*
* - bootproto:
* The method to use for configuring IPv4 addresses:
* - dhcp: Use DHCP for configuring IP. The IPv4 addresses in
* the 'ipv4addr' and 'ipaddress' parameters will be
* ignored.
* - static: Do make use of the addresses in 'ipaddress'.
* - unconfigured: No IP configuration, but one can still configure the
* interface to be up. This is equivalent to using the
* static method without any IPv4 addresses.
*
* - ipv4addr:
* IPv4 address or list of IPv4 addresses with prefix length or netmask,
* separated by a slash (/), e.g. "192.168.199.145/255.255.248.0" or
* "10.20.30.40/28". Note that e.g. RHEL 5 only supports a single IPv4
* address per interface.
*
* - ipv6addr:
* IPv6 address or list of IPv6 addresses with prefix length, separated
* by a slash (/), e.g. "2001:db8:17:23::45/64". The special format
* "::ffff:192.0.2.128" for IPv4-mapped IPv6 addresses is not supported.
* Special "addresses":
* - "AUTOCONF": Enable autonomous address configuration (if router
* advertisments specify the autonomous flag). By
* default, autoconf will be disabled.
* - "LINKLOCAL": Enable IPv6 with a link-local address. This is
* implied if any other address (including autoconf)
* is specified, but can be used if one wants only a
* link-local address, as an empty address list will
* otherwise disable IPv6 entirely on the interface.
*
* - ipaddress:
* IPv4 and/or IPv6 addresses, with prefix length or netmask. Using
* this parameter is equivalent to using the 'ipv4addr' and 'ipv6addr'
* parameters, but you can mix IPv4 and IPv6 addresses in a single
* list. Addresses can optionally be prefixed by "ipv4:" or "ipv6:" to
* indicate which family they are; this is mandatory for the special
* keyword "addresses" ("AUTOCONF", "LINKLOCAL").
* This parameter, and the ipv4addr and ipv6addr parameters, must
* not be used at the same time.
*
* - gateway:
* Default IPv4 router to configure when the interface is up. See also
* the 'ipv4routes' parameter.
*
* - ipv4routes:
* Hash of static IPv4 routes to configure on the interface. The keys
* should be IPv4 network specifications on the format "1.2.3.0/24" or
* "1.2.3.4/255.255.255.0", or the special value "default". The values
* should be the nexthop for that destination. The special nexthop
* value "LOCAL" means that the network exists locally on the link and
* does not go via a router.
* The default IPv4 route can be specified either using an element in
* this hash (target "0.0.0.0/0" or "default"), or using the 'gateway'
* parameter, but not both at the same time.
*
* - ipv6routes:
* Hash of static IPv6 routes to configure on the interface. The keys
* should be IPv6 network specifications on the format "1:2:3::18/127",
* or the special value "default". The values should be the nexthop for
* that destination. The special nexthop value "LOCAL" means that the
* network exists locally on the link and does not to go via a router.
*
* - onboot:
* Whether the interface should be brought up automatically when the
* machine boots ("yes") or not ("no").
*
* - ensure:
* What state Puppet should set the interface to ("up" or "down") when
* run. Can also be set to "absent" to remove configuration for it.
* Udev rules are not removed when setting to absent, so the interface
* may still show up in e.g. 'ifconfig' output.
*
* - persistent_dhcp:
* Whether the DHCP client should continue to request an address when it
* does not get one ("yes") or not ("no").
*
* - bonding_slaves:
* If bonding_slaves is set to a non-empty list, this interface will be
* configured as a bonding interface ("link aggregation group"), with
* the interfaces in bonding_slaves as its slaves. The slave interfaces
* will be automatically configured as well.
*
* - bonding_opts:
* Hash of options to pass to the bonding driver, if this is a bonding
* interface (i.e. if bonding_slaves is non-empty). The 'miimon' option
* will be set to a reasonable (non-zero) interval (currently 250 ms)
* unless explicitly overridden, as you almost always want monitoring of
* the slave links in order for the bond master to not break when one
* link goes down.
*
* - extraparams:
* Hash of extra parameters to set in the ifcfg-<$name> sysconfig file.
* Each element should be a pair on the form "PARAM" => "value". No
* quoting is done, one should be careful about shell metacharacters.
* Parameters set here will override those calculated in other ways by
* this definition, and if a parameter is set to the value ``false''
* (not the string "false"), it will be deleted from the sysconfig file.
* For backwards compatibility, this can also be a list, where each
* element is a string on the form "PARAM=value"; in this variant, it is
* not possible to delete a parameter from the sysconfig file.
*
*
* Notes:
*
* - The ifup(8) command in RHEL 5 only supports a single IPv4 address
* per interface. You need to use alias interfaces (e.g. "eth0:1")
* to have more than one IPv4 address.
*
* - Alias interfaces can interact badly with IPv6. 'ifdown' on the
* alias interface can remove the IPv6 addresses set on the main
* interface. If possible (see above), set multiple IP addresses on
* the main interface instead.
*
* - When setting an interface to absent, it will be unconfigured
* separately from other interfaces. The network on the node may
* break for a while during the Puppet run, if addresses or routes
* are moved from this interface to another.
*/
define networking::rh_interface(
$bootproto='static',# 'static', 'dhcp' or 'unconfigured'
$ipaddress=[], # <IP>/<MASK> or <IP>/<BITS>
$ipv4addr=[], # <IP>/<BITS>
$ipv6addr=[], # <IP>/<BITS>
$gateway='',
$ipv4routes={},
$ipv6routes={},
$onboot='yes',
$ensure='up',
$persistent_dhcp='yes',
$bonding_slaves=[],
$bonding_opts={},
$extraparams=[])
{
if $ipaddress != [] and ($ipv4addr != [] or $ipv6addr != []) {
fail("Networking::Rh_interface[${title}]: ",
"ipaddress param is mutually exclusive with ipv4addr/ipv6addr")
}
if $ipaddress != [] {
$family_ipaddress = ipaddrs_by_family($ipaddress, 'ipv4', 'ipv6')
$x_ipv4addr = $family_ipaddress['ipv4']
$x_ipv6addr = $family_ipaddress['ipv6']
} else {
$x_ipv4addr = $ipv4addr
$x_ipv6addr = $ipv6addr
}
$ipv4_inuse = ($x_ipv4addr != [])
$ipv6_inuse = ($x_ipv6addr != [])
$qname = shellquote($name)
networking::rh_interface::network_service::wrapper { $name: ; }
if ($bonding_slaves != [])
{
networking::rh_interface {
$bonding_slaves:
bootproto => 'unconfigured',
onboot => $onboot, ensure => $ensure,
extraparams => {
# Must not set HWADDR, since the MAC address of bonding
# slaves are changed by the bonding driver, and there is
# no way of finding the "real" MAC address of the slave.
'MASTER' => $name, 'SLAVE' => 'yes', 'HWADDR' => false,
};
}
}
case $ensure
{
'up', 'down': {
file {
"/etc/sysconfig/network-scripts/ifcfg-${name}":
ensure => file,
content => template('networking/rh-ifcfg.erb'),
owner => 'root', group => 'root', mode => '0444',
notify => Class[networking::rh_interface::network_service];
"/etc/sysconfig/network-scripts/route-${name}":
ensure => $ipv4_inuse ? { true => file, default => absent },
content => template('networking/rh-ifroute-v4.erb'),
owner => 'root', group => 'root', mode => '0444',
notify => Class[networking::rh_interface::network_service];
"/etc/sysconfig/network-scripts/route6-${name}":
ensure => $ipv6_inuse ? { true => file, default => absent },
content => template('networking/rh-ifroute-v6.erb'),
owner => 'root', group => 'root', mode => '0444',
notify => Class[networking::rh_interface::network_service];
}
}
'absent': {
file {
[ "/etc/sysconfig/network-scripts/ifcfg-${name}",
"/etc/sysconfig/network-scripts/route-${name}",
"/etc/sysconfig/network-scripts/route6-${name}",
]:
ensure => absent,
before => Exec["networking::rh_interface::absent::${name}"];
}
$isup = shellquote('<(.*,|)UP(|,.*)>| state UP( |$)|^ *inet6? ')
$checkcmd = [
"{ ip addr show ${qname} | egrep ${isup}; }",
"[ -d /sys/class/net/${qname}/bridge ]",
"[ -f /proc/net/vlan/${qname} ]",
]
$downcmd = [
"ip addr flush dev ${qname}",
"ip link set dev ${qname} down",
"if [ -d /sys/class/net/${qname}/bridge ]",
" then brctl delbr ${qname}; fi",
"if [ -f /proc/net/vlan/${qname} ]",
" then ip link del dev ${qname} type vlan; fi",
]
exec {
# This case will not be handled by 'service network restart',
# as we have removed the sysconfig files for the interface.
# The network service will not touch interfaces without any
# sysconfig files. However, we will not get the atomicity
# that 'service network restart' gives us.
"networking::rh_interface::absent::${name}":
command => inline_template('<%= @downcmd.join "; " %>'),
onlyif => inline_template('<%= @checkcmd.join " || " %>'),
provider => shell,
path => '/bin:/usr/bin:/sbin:/usr/sbin',
notify => Class[networking::rh_interface::network_service];
}
}
default: {
fail("Networking::Rh_interface[${title}]: ",
"Bad ensure parameter, ${ensure}")
}
}
if $name !~ /:/
{
# Alias interfaces do not really exist independantly, so it is
# not possible to set sysctl:s on them.
# Interfaces with "." in their names (VLAN interfaces) have that
# replaced with "/" in the sysctl variable name.
$sysctl_ifname = regsubst($name, '[.]', '/')
$ipv6_sysctl_value = $ensure ? {
'absent' => '',
default => $ipv6_inuse ? { true => 0, default => 1 },
}
$if_re = sprintf('(^|.*,)%s(,.*|$)', regexp_quote($name))
if regsubst($::interfaces, $if_re, $name) == $name
{
# Interface already exists, so it should be OK to do a sysctl
# on it.
sysctl {
"net.ipv6.conf.${sysctl_ifname}.disable_ipv6":
value => $ipv6_sysctl_value,
ignoremissing => true,
notify => Class[networking::rh_interface::network_service];
}
} else {
# Probably some kind of virtual interface (bonding interface,
# VLAN interface, bridge). Those do not exist until ifup(8)
# brings them up, and it is thus impossible to execute the
# sysctl on them until then. But that is too late, as ifup(8)
# will already have failed to set the addresses we want.
#
# Luckily, ifup in EL-6 and EL-7 executes the sysctl:s in
# /etc/sysctl.conf for the interface at the right time, before
# it sets addresses. Not so in EL-5, but the disable_ipv6
# setting defaults to 0 anyway, so if we do want IPv6 addresses,
# ifup will be able to set them. If we don't, then performing
# the sysctl after bringing up the interface, will remove the
# link-local address, but we will have an interval where it
# exists. Splitting it this way seem to be the best we can do.
sysctl::sysctl_conf {
"net.ipv6.conf.${sysctl_ifname}.disable_ipv6":
value => $ipv6_sysctl_value,
notify => Class[networking::rh_interface::network_service];
}
sysctl::exec {
"net.ipv6.conf.${sysctl_ifname}.disable_ipv6":
value => $ipv6_sysctl_value,
ignoremissing => true,
require => Class[networking::rh_interface::network_service];
}
}
}
}
# Helper class for networking::rh_interface
#
# When changes to more than one interface are performed, e.g. moving a
# route, changing between bonded and non-bonded interfaces, et.c, we
# want to apply all changes in one go, with no Puppet resources applied
# between changing interface A and interface B, as we might be in a
# state without working network then.
# The disadvantage is that all interfaces will be brought down for a
# while, even if only one interface has changes.
class networking::rh_interface::network_service
{
service {
'network':
enable => 'true', ensure => running,
hasstatus => true, hasrestart => true;
}
}
# Helper-wrapper for networking::rh_interface::network_service...
# If someone does 'require => Networking::Rh_interface["eth0"]', we
# want the network service to be restarted before the requirement is
# fulfilled. 'include networking::rh_interface::network_service'
# inside networking::rh_interface is not enough to do so, but using
# 'require' is. However, we then get a dependency cycle, since
# resources inside networking::rh_interface does notify on that
# class.
# We work around that with this wrapper definition. Puppet will
# then not see it as a cycle, but instead do what we want.
define networking::rh_interface::network_service::wrapper()
{
require networking::rh_interface::network_service
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment