-
-
Notifications
You must be signed in to change notification settings - Fork 33
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 #31 from dhollinger/21-pkg-svc-params
Add parameters for configuring package and service
- Loading branch information
Showing
10 changed files
with
141 additions
and
77 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 |
---|---|---|
|
@@ -12,9 +12,24 @@ | |
# @author Vox Pupuli <[email protected]> | ||
# @author David Hollinger III <[email protected]> | ||
# | ||
# To use this module, simply declare it in your manifest. | ||
# @example Declaring the autofs class | ||
# include autofs | ||
# | ||
# The module now supports the ability to not only enable autofs, | ||
# but to also disable or uninstall it completely. | ||
# @example Removing the package | ||
# class { 'autofs': | ||
# package_ensure => 'absent', | ||
# } | ||
# | ||
# @example Disable the autofs service | ||
# class { 'autofs': | ||
# service_ensure => 'stopped', | ||
# service_enable => false, | ||
# } | ||
# | ||
# | ||
# @example using hiera with automatic lookup | ||
# --- | ||
# autofs::mounts: | ||
|
@@ -44,12 +59,22 @@ | |
# @option mounts [Array] :mapcontents Mount point options and parameters. Each | ||
# array element represents a line in the configuration file. | ||
# @option mounts [Boolean] :replace Enforce the configuration state or not. | ||
# @param package_ensure Determines the state of the package. Can be set to: installed, absent, lastest, or a specific version string. | ||
# @param service_ensure Determines state of the service. Can be set to: running or stopped. | ||
# @param service_enable Determines if the service should start with the system boot. true | ||
# will start the autofs service on boot. false will not start the autofs service | ||
# on boot. | ||
# | ||
class autofs ( | ||
Optional[Hash] $mounts = undef | ||
Optional[Hash] $mounts = undef, | ||
String $package_ensure = 'installed', | ||
Enum[ 'stopped', 'running' ] $service_ensure = 'running', | ||
Boolean $service_enable = true, | ||
) { | ||
contain '::autofs::package' | ||
contain '::autofs::service' | ||
unless $package_ensure == 'absent' { | ||
contain '::autofs::service' | ||
} | ||
|
||
if $mounts { | ||
$data = hiera_hash('autofs::mounts', $mounts) | ||
|
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 |
---|---|---|
|
@@ -13,26 +13,12 @@ | |
# @author Vox Pupuli <[email protected]> | ||
# @author David Hollinger III <[email protected]> | ||
# | ||
# @param ensure Determines state of the service. Can be set to: running or stopped. | ||
# @param enable Determines if the service should start with the system boot. true | ||
# will start the autofs service on boot. false will not start the autofs service | ||
# on boot. | ||
# @param service_restart Determines if the service has a restart command. If true, | ||
# puppet will use the restart command to restart the service. If false, the | ||
# stop, then start commands will be used instead. | ||
# @param service_status Determines if service has a status command. | ||
# | ||
class autofs::service ( | ||
String $ensure = running, | ||
Boolean $enable = true, | ||
Boolean $service_restart = true, | ||
Boolean $service_status = true | ||
){ | ||
class autofs::service { | ||
service { 'autofs': | ||
ensure => $ensure, | ||
enable => $enable, | ||
hasstatus => $service_status, | ||
hasrestart => $service_restart, | ||
ensure => $autofs::service_ensure, | ||
enable => $autofs::service_enable, | ||
hasstatus => true, | ||
hasrestart => true, | ||
require => Package['autofs'], | ||
} | ||
} |
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
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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