Simplify the definition of required parameters
This patch removes the redundant logics to fail when some of the required parameters are missing, by the built-in behavior to define required parameters. Change-Id: Ieebd67e2551709731ebd11957d28d1762ec308d4
This commit is contained in:
parent
432a34e076
commit
6ffe4898a9
|
@ -4,6 +4,12 @@
|
||||||
#
|
#
|
||||||
# === Parameters
|
# === Parameters
|
||||||
#
|
#
|
||||||
|
# [*kmip_plugin_host*]
|
||||||
|
# (required) username for KMIP device
|
||||||
|
#
|
||||||
|
# [*kmip_plugin_port*]
|
||||||
|
# (required) port for KMIP device
|
||||||
|
#
|
||||||
# [*kmip_plugin_username*]
|
# [*kmip_plugin_username*]
|
||||||
# (optional) username for KMIP device
|
# (optional) username for KMIP device
|
||||||
# Defaults to undef
|
# Defaults to undef
|
||||||
|
@ -13,12 +19,6 @@
|
||||||
# when the kmip_plugin_username parameter is set.
|
# when the kmip_plugin_username parameter is set.
|
||||||
# Defaults to undef
|
# Defaults to undef
|
||||||
#
|
#
|
||||||
# [*kmip_plugin_host*]
|
|
||||||
# (required) username for KMIP device
|
|
||||||
#
|
|
||||||
# [*kmip_plugin_port*]
|
|
||||||
# (required) port for KMIP device
|
|
||||||
#
|
|
||||||
# [*kmip_plugin_keyfile*]
|
# [*kmip_plugin_keyfile*]
|
||||||
# (optional) key file for KMIP device. This parameter is required when
|
# (optional) key file for KMIP device. This parameter is required when
|
||||||
# the kmip_plugin_username parameter is not set.
|
# the kmip_plugin_username parameter is not set.
|
||||||
|
@ -39,10 +39,10 @@
|
||||||
# Defaults to false
|
# Defaults to false
|
||||||
#
|
#
|
||||||
class barbican::plugins::kmip (
|
class barbican::plugins::kmip (
|
||||||
|
$kmip_plugin_host,
|
||||||
|
$kmip_plugin_port,
|
||||||
$kmip_plugin_username = undef,
|
$kmip_plugin_username = undef,
|
||||||
$kmip_plugin_password = undef,
|
$kmip_plugin_password = undef,
|
||||||
$kmip_plugin_host = undef,
|
|
||||||
$kmip_plugin_port = undef,
|
|
||||||
$kmip_plugin_keyfile = undef,
|
$kmip_plugin_keyfile = undef,
|
||||||
$kmip_plugin_certfile = undef,
|
$kmip_plugin_certfile = undef,
|
||||||
$kmip_plugin_ca_certs = undef,
|
$kmip_plugin_ca_certs = undef,
|
||||||
|
@ -51,12 +51,6 @@ class barbican::plugins::kmip (
|
||||||
|
|
||||||
include barbican::deps
|
include barbican::deps
|
||||||
|
|
||||||
if $kmip_plugin_host == undef {
|
|
||||||
fail('kmip_plugin_host must be defined')
|
|
||||||
}
|
|
||||||
if $kmip_plugin_port == undef {
|
|
||||||
fail('kmip_plugin_port must be defined')
|
|
||||||
}
|
|
||||||
if $kmip_plugin_username != undef {
|
if $kmip_plugin_username != undef {
|
||||||
if $kmip_plugin_password == undef {
|
if $kmip_plugin_password == undef {
|
||||||
fail('kmip_plugin_password must be defined if kmip_plugin_username is defined')
|
fail('kmip_plugin_password must be defined if kmip_plugin_username is defined')
|
||||||
|
|
|
@ -56,11 +56,11 @@
|
||||||
# Defaults to false
|
# Defaults to false
|
||||||
#
|
#
|
||||||
class barbican::plugins::p11_crypto (
|
class barbican::plugins::p11_crypto (
|
||||||
$p11_crypto_plugin_library_path = undef,
|
$p11_crypto_plugin_library_path,
|
||||||
$p11_crypto_plugin_login = undef,
|
$p11_crypto_plugin_login,
|
||||||
$p11_crypto_plugin_mkek_label = undef,
|
$p11_crypto_plugin_mkek_label,
|
||||||
$p11_crypto_plugin_mkek_length = undef,
|
$p11_crypto_plugin_mkek_length,
|
||||||
$p11_crypto_plugin_hmac_label = undef,
|
$p11_crypto_plugin_hmac_label,
|
||||||
$p11_crypto_plugin_token_serial_number = $::os_service_default,
|
$p11_crypto_plugin_token_serial_number = $::os_service_default,
|
||||||
$p11_crypto_plugin_token_label = $::os_service_default,
|
$p11_crypto_plugin_token_label = $::os_service_default,
|
||||||
$p11_crypto_plugin_slot_id = $::os_service_default,
|
$p11_crypto_plugin_slot_id = $::os_service_default,
|
||||||
|
@ -73,22 +73,6 @@ class barbican::plugins::p11_crypto (
|
||||||
|
|
||||||
include barbican::deps
|
include barbican::deps
|
||||||
|
|
||||||
if $p11_crypto_plugin_library_path == undef {
|
|
||||||
fail('p11_crypto_plugin_library_path must be defined')
|
|
||||||
}
|
|
||||||
if $p11_crypto_plugin_login == undef {
|
|
||||||
fail('p11_crypto_plugin_login must be defined')
|
|
||||||
}
|
|
||||||
if $p11_crypto_plugin_mkek_label == undef {
|
|
||||||
fail('p11_crypto_plugin_mkek_label must be defined')
|
|
||||||
}
|
|
||||||
if $p11_crypto_plugin_mkek_length == undef {
|
|
||||||
fail('p11_crypto_plugin_mkek_length must be defined')
|
|
||||||
}
|
|
||||||
if $p11_crypto_plugin_hmac_label == undef {
|
|
||||||
fail('p11_crypto_plugin_hmac_label must be defined')
|
|
||||||
}
|
|
||||||
|
|
||||||
barbican_config {
|
barbican_config {
|
||||||
'p11_crypto_plugin/library_path': value => $p11_crypto_plugin_library_path;
|
'p11_crypto_plugin/library_path': value => $p11_crypto_plugin_library_path;
|
||||||
'p11_crypto_plugin/login': value => $p11_crypto_plugin_login;
|
'p11_crypto_plugin/login': value => $p11_crypto_plugin_login;
|
||||||
|
|
Loading…
Reference in New Issue