Skip to content

Commit

Permalink
Add the option display_name to template
Browse files Browse the repository at this point in the history
To force the hostname used with Insights
add the option display_name in the template
  • Loading branch information
ralfbosz committed Sep 19, 2023
1 parent 16de95c commit f1f9807
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 41 deletions.
27 changes: 15 additions & 12 deletions manifests/current.pp
Original file line number Diff line number Diff line change
Expand Up @@ -28,26 +28,29 @@
# Whether to obfuscate IP addresses.
# @param obfuscate_hostname
# Whether to obfuscate hostname.
# @param display_name
# Display name for this system.
#
# @author Lindani Phiri <[email protected]>
# @author Dan Varga <[email protected]>
#
# Copyright 2015 Red Hat Inc.
#
class access_insights_client::current (
$package_name = 'insights-client',
String $package_name = 'insights-client',
Optional[Enum['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL']] $log_level = undef,
$auto_config = 'True',
$authmethod = undef,
$username = undef,
$password = undef,
$base_url = undef,
$proxy = undef,
$cert_verify = undef,
$gpg = undef,
$auto_update = undef,
$obfuscate = undef,
$obfuscate_hostname = undef,
Optional[Boolean]] $auto_config = 'True',
Optional[Enum['BASIC','CERT']] $authmethod = undef,
String $username = undef,
String $password = undef,
Stdlib::Fqdn $base_url = undef,
Stdlib::HTTPUrl $proxy = undef,
Optional[Boolean]] $cert_verify = undef,
Optional[Boolean]] $gpg = undef,
Optional[Boolean]] $auto_update = undef,
Optional[Boolean]] $obfuscate = undef,
Optional[Boolean]] $obfuscate_hostname = undef,
Stdlib::Host $display_name = undef,
) {
package { $package_name:
ensure => installed,
Expand Down
30 changes: 19 additions & 11 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# The access insights module is intended to deploy and configure the Red Hat
# Access Insights client.
#
# @param package_name
# Name of the package to install.
# @param log_level
# Change log level, valid options DEBUG, INFO, WARNING, ERROR, CRITICAL.
# @param auto_config
Expand Down Expand Up @@ -30,25 +32,29 @@
# @param deployment_style
# How the module should be deploy. Can be undef (auto),
# current (6.10+ or 7.5+) or old.
# @param display_name
# Display name for the client.
#
# @author Lindani Phiri <[email protected]>
# @author Dan Varga <[email protected]>
#
# Copyright 2015 Red Hat Inc.
#
class access_insights_client (
String $package_name = 'insights-client',
Optional[Enum['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL']] $log_level = undef,
$auto_config = 'True',
$authmethod = undef,
$username = undef,
$password = undef,
$base_url = undef,
$proxy = undef,
$cert_verify = undef,
$gpg = undef,
$auto_update = undef,
$obfuscate = undef,
$obfuscate_hostname = undef,
Boolean $auto_config = 'True',
Optional[Enum['BASIC','CERT']] $authmethod = undef,
String $username = undef,
String $password = undef,
Stdlib::Fqdn $base_url = undef,
Stdlib::HTTPUrl $proxy = undef,
Optional[Boolean] $cert_verify = undef,
Optional[Boolean] $gpg = undef,
Optional[Boolean] $auto_update = undef,
Optional[Boolean] $obfuscate = undef,
Optional[Boolean] $obfuscate_hostname = undef,
Stdlib::Host $display_name = undef,
Optional[Enum['current', 'old']] $deployment_style = undef,
) {
if $deployment_style {
Expand All @@ -63,6 +69,7 @@
}

class { "access_insights_client::${class_name}":
package_name => $package_name,
log_level => $log_level,
auto_config => $auto_config,
authmethod => $authmethod,
Expand All @@ -75,6 +82,7 @@
auto_update => $auto_update,
obfuscate => $obfuscate,
obfuscate_hostname => $obfuscate_hostname,
display_name => $display_name,
}
contain "access_insights_client::${class_name}"
}
29 changes: 16 additions & 13 deletions manifests/old.pp
Original file line number Diff line number Diff line change
Expand Up @@ -29,26 +29,29 @@
# Whether to obfuscate IP addresses.
# @param obfuscate_hostname
# Whether to obfuscate hostname.
# @param display_name
# Display name for this system.
#
# @author Lindani Phiri <[email protected]>
# @author Dan Varga <[email protected]>
#
# Copyright 2015 Red Hat Inc.
#
class access_insights_client::old (
$package_name = 'redhat-access-insights',
$log_level = undef,
$auto_config = 'True',
$authmethod = undef,
$username = undef,
$password = undef,
$base_url = undef,
$proxy = undef,
$cert_verify = undef,
$gpg = undef,
$auto_update = undef,
$obfuscate = undef,
$obfuscate_hostname = undef,
String $package_name = 'insights-client',
Optional[Enum['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL']] $log_level = undef,
Boolean $auto_config = 'True',
Optional[Enum['BASIC','CERT']] $authmethod = undef,
String $username = undef,
String $password = undef,
Stdlib::Fqdn $base_url = undef,
Stdlib::HTTPUrl $proxy = undef,
Optional[Boolean] $cert_verify = undef,
Optional[Boolean] $gpg = undef,
Optional[Boolean] $auto_update = undef,
Optional[Boolean] $obfuscate = undef,
Optional[Boolean] $obfuscate_hostname = undef,
Stdlib::Host $display_name = undef,
) {
package { $package_name:
ensure => installed,
Expand Down
8 changes: 3 additions & 5 deletions templates/redhat-access-insights.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ obfuscate=<%= @obfuscate %>
obfuscate_hostname=<%= @obfuscate_hostname %>
<%- end -%>





<%- if @display_name -%>
display_name=<%= @display_name %>
<%- end -%>

0 comments on commit f1f9807

Please sign in to comment.