Skip to content

Commit c8e8b78

Browse files
committed
Add the option display_name to template
To force the hostname used with Insights add the option display_name in the template
1 parent 16de95c commit c8e8b78

File tree

4 files changed

+53
-41
lines changed

4 files changed

+53
-41
lines changed

manifests/current.pp

+15-12
Original file line numberDiff line numberDiff line change
@@ -28,26 +28,29 @@
2828
# Whether to obfuscate IP addresses.
2929
# @param obfuscate_hostname
3030
# Whether to obfuscate hostname.
31+
# @param display_name
32+
# Display name for this system.
3133
#
3234
# @author Lindani Phiri <[email protected]>
3335
# @author Dan Varga <[email protected]>
3436
#
3537
# Copyright 2015 Red Hat Inc.
3638
#
3739
class access_insights_client::current (
38-
$package_name = 'insights-client',
40+
String $package_name = 'insights-client',
3941
Optional[Enum['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL']] $log_level = undef,
40-
$auto_config = 'True',
41-
$authmethod = undef,
42-
$username = undef,
43-
$password = undef,
44-
$base_url = undef,
45-
$proxy = undef,
46-
$cert_verify = undef,
47-
$gpg = undef,
48-
$auto_update = undef,
49-
$obfuscate = undef,
50-
$obfuscate_hostname = undef,
42+
Boolean $auto_config = 'True',
43+
Optional[Enum['BASIC','CERT']] $authmethod = undef,
44+
Optional[String] $username = undef,
45+
Optional[String] $password = undef,
46+
Optional[Stdlib::Fqdn] $base_url = undef,
47+
Optional[Stdlib::HTTPUrl] $proxy = undef,
48+
Optional[Boolean] $cert_verify = undef,
49+
Optional[Boolean] $gpg = undef,
50+
Optional[Boolean] $auto_update = undef,
51+
Optional[Boolean] $obfuscate = undef,
52+
Optional[Boolean] $obfuscate_hostname = undef,
53+
Stdlib::Host $display_name = undef,
5154
) {
5255
package { $package_name:
5356
ensure => installed,

manifests/init.pp

+19-11
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
# The access insights module is intended to deploy and configure the Red Hat
33
# Access Insights client.
44
#
5+
# @param package_name
6+
# Name of the package to install.
57
# @param log_level
68
# Change log level, valid options DEBUG, INFO, WARNING, ERROR, CRITICAL.
79
# @param auto_config
@@ -30,25 +32,29 @@
3032
# @param deployment_style
3133
# How the module should be deploy. Can be undef (auto),
3234
# current (6.10+ or 7.5+) or old.
35+
# @param display_name
36+
# Display name for the client.
3337
#
3438
# @author Lindani Phiri <[email protected]>
3539
# @author Dan Varga <[email protected]>
3640
#
3741
# Copyright 2015 Red Hat Inc.
3842
#
3943
class access_insights_client (
44+
String $package_name = 'insights-client',
4045
Optional[Enum['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL']] $log_level = undef,
41-
$auto_config = 'True',
42-
$authmethod = undef,
43-
$username = undef,
44-
$password = undef,
45-
$base_url = undef,
46-
$proxy = undef,
47-
$cert_verify = undef,
48-
$gpg = undef,
49-
$auto_update = undef,
50-
$obfuscate = undef,
51-
$obfuscate_hostname = undef,
46+
Boolean $auto_config = 'True',
47+
Optional[Enum['BASIC','CERT']] $authmethod = undef,
48+
Optional[String] $username = undef,
49+
Optional[String] $password = undef,
50+
Optional[Stdlib::Fqdn] $base_url = undef,
51+
Optionla[Stdlib::HTTPUrl] $proxy = undef,
52+
Optional[Boolean] $cert_verify = undef,
53+
Optional[Boolean] $gpg = undef,
54+
Optional[Boolean] $auto_update = undef,
55+
Optional[Boolean] $obfuscate = undef,
56+
Optional[Boolean] $obfuscate_hostname = undef,
57+
Optional[Stdlib::Host] $display_name = undef,
5258
Optional[Enum['current', 'old']] $deployment_style = undef,
5359
) {
5460
if $deployment_style {
@@ -63,6 +69,7 @@
6369
}
6470

6571
class { "access_insights_client::${class_name}":
72+
package_name => $package_name,
6673
log_level => $log_level,
6774
auto_config => $auto_config,
6875
authmethod => $authmethod,
@@ -75,6 +82,7 @@
7582
auto_update => $auto_update,
7683
obfuscate => $obfuscate,
7784
obfuscate_hostname => $obfuscate_hostname,
85+
display_name => $display_name,
7886
}
7987
contain "access_insights_client::${class_name}"
8088
}

manifests/old.pp

+16-13
Original file line numberDiff line numberDiff line change
@@ -29,26 +29,29 @@
2929
# Whether to obfuscate IP addresses.
3030
# @param obfuscate_hostname
3131
# Whether to obfuscate hostname.
32+
# @param display_name
33+
# Display name for this system.
3234
#
3335
# @author Lindani Phiri <[email protected]>
3436
# @author Dan Varga <[email protected]>
3537
#
3638
# Copyright 2015 Red Hat Inc.
3739
#
3840
class access_insights_client::old (
39-
$package_name = 'redhat-access-insights',
40-
$log_level = undef,
41-
$auto_config = 'True',
42-
$authmethod = undef,
43-
$username = undef,
44-
$password = undef,
45-
$base_url = undef,
46-
$proxy = undef,
47-
$cert_verify = undef,
48-
$gpg = undef,
49-
$auto_update = undef,
50-
$obfuscate = undef,
51-
$obfuscate_hostname = undef,
41+
String $package_name = 'insights-client',
42+
Optional[Enum['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL']] $log_level = undef,
43+
Boolean $auto_config = 'True',
44+
Optional[Enum['BASIC','CERT']] $authmethod = undef,
45+
Optional[String] $username = undef,
46+
Optional[String] $password = undef,
47+
Optional[Stdlib::Fqdn] $base_url = undef,
48+
Optional[Stdlib::HTTPUrl] $proxy = undef,
49+
Optional[Boolean] $cert_verify = undef,
50+
Optional[Boolean] $gpg = undef,
51+
Optional[Boolean] $auto_update = undef,
52+
Optional[Boolean] $obfuscate = undef,
53+
Optional[Boolean] $obfuscate_hostname = undef,
54+
Optional[Stdlib::Host] $display_name = undef,
5255
) {
5356
package { $package_name:
5457
ensure => installed,

templates/redhat-access-insights.conf.erb

+3-5
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@ obfuscate=<%= @obfuscate %>
4848
obfuscate_hostname=<%= @obfuscate_hostname %>
4949
<%- end -%>
5050

51-
52-
53-
54-
55-
51+
<%- if @display_name -%>
52+
display_name=<%= @display_name %>
53+
<%- end -%>

0 commit comments

Comments
 (0)