Skip to content

Commit

Permalink
Merge pull request #103 from Icinga/enhancement/remove-duplicate-unwr…
Browse files Browse the repository at this point in the history
…ap-function

Replace duplicate function icinga::unwrap with built-in unwrap function
  • Loading branch information
lbetz authored Dec 31, 2023
2 parents 93ac089 + 051540a commit aab98ee
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 39 deletions.
19 changes: 0 additions & 19 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ PHP and a Webserver.
with or without TLS information.
* [`icinga::newline`](#icinga--newline): Replace newlines for Windows systems.
* [`icinga::prepare_web`](#icinga--prepare_web): This funktion checks for web preparation and display a warning if fails
* [`icinga::unwrap`](#icinga--unwrap): This function returns an unwrap string if necessary.

### Data types

Expand Down Expand Up @@ -2035,24 +2034,6 @@ Data type: `String`



### <a name="icinga--unwrap"></a>`icinga::unwrap`

Type: Puppet Language

This function returns an unwrap string if necessary.

#### `icinga::unwrap(Optional[Variant[String, Sensitive[String]]] $arg = undef)`

The icinga::unwrap function.

Returns: `Any` The unwraped string.

##### `arg`

Data type: `Optional[Variant[String, Sensitive[String]]]`



## Data types

### <a name="Icinga--Certificate"></a>`Icinga::Certificate`
Expand Down
2 changes: 1 addition & 1 deletion functions/db/connect.pp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ function icinga::db::connect(
'dbname=' => $db['database'],
})), ' '), '= ', '=', 'G')
} else {
$_password = icinga::unwrap($db['password'])
$_password = unwrap($db['password'])
$options = join(any2array(delete_undef_values({
'-h' => $db['host'] ? {
/localhost/ => undef,
Expand Down
16 changes: 0 additions & 16 deletions functions/unwrap.pp

This file was deleted.

2 changes: 1 addition & 1 deletion manifests/cert.pp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
if $args[key] {
file { $args['key_file']:
ensure => file,
content => icinga::newline(icinga::unwrap($args['key'])),
content => icinga::newline(unwrap($args['key'])),
mode => $key_mode,
show_diff => false,
}
Expand Down
2 changes: 1 addition & 1 deletion manifests/database.pp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
}

if versioncmp($facts['puppetversion'], '6.0.0') < 0 or ($facts['os']['family'] == 'redhat' and Integer($facts['os']['release']['major']) < 8) {
$_pass = icinga::unwrap($db_pass)
$_pass = unwrap($db_pass)
} else {
$_pass = postgresql::postgresql_password($db_user, $db_pass, false, $postgresql::server::password_encryption)
}
Expand Down
2 changes: 1 addition & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@
"${icinga_home}/.ssh/id_${ssh_key_type}":
mode => '0600',
show_diff => false,
content => icinga::unwrap($ssh_private_key);
content => unwrap($ssh_private_key);
"${icinga_home}/.ssh/config":
content => "Host *\n StrictHostKeyChecking no\n ControlPath ${icinga_home}/.ssh/controlmasters/%r@%h:%p.socket\n ControlMaster auto\n ControlPersist 5m";
}
Expand Down

0 comments on commit aab98ee

Please sign in to comment.