-
-
Notifications
You must be signed in to change notification settings - Fork 108
/
init.pp
81 lines (79 loc) · 1.62 KB
/
init.pp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# = Class: network
#
# Install the packages and gems required by the network_route and network_config resources
#
# == Parameters
#
# [*ifupdown_extra*]
#
# The name of the ifupdown-extra package
#
# Default: ifupdown-extra
#
# [*ifupdown_extra_provider*]
#
# The provider of the ifupdown-extra package
#
# Default: undef
#
# [*manage_ifupdown_extra*]
#
# Whether this class should manage the ifupdown-extra package
#
# Default: true
#
# [*ensure_ifupdown_extra*]
#
# What state the ifupdown-extra package should be in
#
# Default: present
#
# [*ipaddress*]
#
# The name of the ipaddress gems
#
# Default: ipaddress
#
# [*ipaddress_provider*]
#
# The provider of the ipaddress gem
#
# Default: gem
#
# [*manage_ipaddress*]
#
# Whether this class should manage the ipaddress gem
#
# Default: true
#
# [*ensure_ipaddress*]
#
# What state the ipaddress package should be in
#
# Default: absent
#
class network (
$ifupdown_extra = 'ifupdown-extra',
$ifupdown_extra_provider = undef,
$manage_ifupdown_extra = true,
$ensure_ifupdown_extra = present,
$ipaddress = 'ipaddress',
$ipaddress_provider = 'puppet_gem',
$manage_ipaddress = true,
$ensure_ipaddress = absent,
) {
if $facts['os']['family'] == 'Debian' and $manage_ifupdown_extra {
package { $ifupdown_extra:
ensure => $ensure_ifupdown_extra,
provider => $ifupdown_extra_provider,
}
Package[$ifupdown_extra] -> Network_route <| |>
}
if $manage_ipaddress {
package { $ipaddress:
ensure => $ensure_ipaddress,
provider => $ipaddress_provider,
}
Package[$ipaddress] -> Network_config <| |>
}
}