Skip to content

Commit 1b5cb9e

Browse files
feat: add show_diff option
1 parent 739895f commit 1b5cb9e

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

REFERENCE.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ The following parameters are available in the `yum` class:
132132
* [`gpgkeys`](#-yum--gpgkeys)
133133
* [`utils_package_name`](#-yum--utils_package_name)
134134
* [`groups`](#-yum--groups)
135+
* [`show_diff`](#-yum--show_diff)
135136

136137
##### <a name="-yum--clean_old_kernels"></a>`clean_old_kernels`
137138

@@ -245,6 +246,15 @@ A hash of yum::group instances to manage.
245246

246247
Default value: `{}`
247248

249+
##### <a name="-yum--show_diff"></a>`show_diff`
250+
251+
Data type: `Boolean`
252+
253+
Wether to display diff when a config is changed. It is useful when there is confidental
254+
information that you do not want displayed in the puppet logs.
255+
256+
Default value: `true`
257+
248258
### <a name="yum--clean"></a>`yum::clean`
249259

250260
A $(yum clean all) Exec to be notified if desired.

manifests/config.pp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
Variant[Boolean, Integer, Enum['absent'], String, Sensitive[String]] $ensure,
1919
String $key = $title,
2020
) {
21+
include yum
2122
include yum::settings
2223
$_mainconf = $yum::settings::mainconf
2324

@@ -34,7 +35,7 @@
3435

3536
$_show_diff = $ensure ? {
3637
Sensitive => false,
37-
default => true,
38+
default => $yum::show_diff,
3839
}
3940

4041
augeas { "${facts['package_provider']}.conf_${key}":

manifests/init.pp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@
5858
# @param groups
5959
# A hash of yum::group instances to manage.
6060
#
61+
# @param show_diff
62+
# Wether to display diff when a config is changed. It is useful when there is confidental
63+
# information that you do not want displayed in the puppet logs.
64+
#
6165
# @example Enable management of the default repos for a supported OS:
6266
# ---
6367
# yum::manage_os_default_repos: true
@@ -116,7 +120,8 @@
116120
Array[String] $repo_exclusions = [],
117121
Hash[String, Hash[String, String]] $gpgkeys = {},
118122
String $utils_package_name = 'yum-utils',
119-
Stdlib::CreateResources $groups = {}
123+
Stdlib::CreateResources $groups = {},
124+
Boolean $show_diff = true,
120125
) {
121126
$module_metadata = load_module_metadata($module_name)
122127
$supported_operatingsystems = $module_metadata['operatingsystem_support']

0 commit comments

Comments
 (0)