-
-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #168 from rski/install_deps
Add a `network` class which installs the packages and gems required by
- Loading branch information
Showing
2 changed files
with
94 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
# = 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 ifupdown-extra package should be in | ||
# | ||
# Default: present | ||
# | ||
|
||
class network( | ||
$ifupdown_extra = 'ifupdown-extra', | ||
$ifupdown_extra_provider = undef, | ||
$manage_ifupdown_extra = true, | ||
$ensure_ifupdown_extra = present, | ||
$ipaddress = 'ipaddress', | ||
$ipaddress_provider = 'gem', | ||
$manage_ipaddress = true, | ||
$ensure_ipaddress = present, | ||
) { | ||
|
||
if $::osfamily == '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 <| |> | ||
} | ||
|
||
} |