Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ previous commits.

On RHEL/CentOS platforms you will need to have access to the EPEL repository
by using [puppet/epel](https://forge.puppet.com/puppet/epel) or by other
means.
means. If using the EPEL repository module, this module will include it by
default. To override, set `assume_epel` to True.

### Beginning with etckeeper

Expand Down Expand Up @@ -75,7 +76,7 @@ This module has been built on and tested against Puppet 5 and higher.

The module has been tested on:

* Red Hat/CentOS Enterprise Linux 6/7
* RedHat Enterprise/CentOS Linux 6/7/8
* Ubuntu 14.04/16.04
* Debian 7/8

Expand Down
1 change: 1 addition & 0 deletions data/common.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
etckeeper::assume_epel: ~
etckeeper::avoid_commit_before_install: ~
etckeeper::avoid_daily_autocommits: ~
etckeeper::avoid_special_file_warning: ~
Expand Down
1 change: 1 addition & 0 deletions manifests/config.pp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# @!visibility private
class etckeeper::config {

$assume_epel = $etckeeper::assume_epel
$avoid_commit_before_install = $etckeeper::avoid_commit_before_install
$avoid_daily_autocommits = $etckeeper::avoid_daily_autocommits
$avoid_special_file_warning = $etckeeper::avoid_special_file_warning
Expand Down
2 changes: 2 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# vcs_user_email => 'alice@example.com',
# }
#
# @param assume_epel Assume EPEL repository installed (Red Hat variants only)
# @param avoid_commit_before_install
# @param avoid_daily_autocommits
# @param avoid_special_file_warning
Expand All @@ -37,6 +38,7 @@
#
# @since 1.0.0
class etckeeper (
Optional[Boolean] $assume_epel,
Optional[Boolean] $avoid_commit_before_install,
Optional[Boolean] $avoid_daily_autocommits,
Optional[Boolean] $avoid_special_file_warning,
Expand Down
11 changes: 10 additions & 1 deletion manifests/install.pp
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
# @!visibility private
class etckeeper::install {

package { $etckeeper::package_name:
# if RedHat, need to have EPEL installed
if $::osfamily == 'RedHat' and ! $::etckeeper::assume_epel {
if defined(Class['epel']) {
Class['epel'] -> Package[$::etckeeper::package_name]
}
else {
warning("Without EPEL repository configured, I probably won't be able to find package ${::etckeeper::package_name}. See \$assume_epel for more information.")
}
}
package { $::etckeeper::package_name:
ensure => present,
}

Expand Down