diff --git a/README.md b/README.md index 8861054..dc006b6 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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 diff --git a/data/common.yaml b/data/common.yaml index e35fc2c..34f7980 100644 --- a/data/common.yaml +++ b/data/common.yaml @@ -1,4 +1,5 @@ --- +etckeeper::assume_epel: ~ etckeeper::avoid_commit_before_install: ~ etckeeper::avoid_daily_autocommits: ~ etckeeper::avoid_special_file_warning: ~ diff --git a/manifests/config.pp b/manifests/config.pp index 9e51d9a..f30178d 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -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 diff --git a/manifests/init.pp b/manifests/init.pp index 1190d69..381b40a 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -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 @@ -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, diff --git a/manifests/install.pp b/manifests/install.pp index 5450b0f..15f0580 100644 --- a/manifests/install.pp +++ b/manifests/install.pp @@ -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, }