|
60 | 60 | # @author Tyler Langlois <[email protected]>
|
61 | 61 | #
|
62 | 62 | define elasticsearch::snapshot_repository (
|
63 |
| - String $location, |
64 |
| - Enum['absent', 'present'] $ensure = 'present', |
65 |
| - Optional[String] $api_basic_auth_password = $elasticsearch::api_basic_auth_password, |
66 |
| - Optional[String] $api_basic_auth_username = $elasticsearch::api_basic_auth_username, |
67 |
| - Optional[Stdlib::Absolutepath] $api_ca_file = $elasticsearch::api_ca_file, |
68 |
| - Optional[Stdlib::Absolutepath] $api_ca_path = $elasticsearch::api_ca_path, |
69 |
| - String $api_host = $elasticsearch::api_host, |
70 |
| - Integer[0, 65535] $api_port = $elasticsearch::api_port, |
71 |
| - Enum['http', 'https'] $api_protocol = $elasticsearch::api_protocol, |
72 |
| - Integer $api_timeout = $elasticsearch::api_timeout, |
73 |
| - Boolean $compress = true, |
74 |
| - Optional[String] $chunk_size = undef, |
75 |
| - Optional[String] $max_restore_rate = undef, |
76 |
| - Optional[String] $max_snapshot_rate = undef, |
77 |
| - Optional[String] $repository_type = undef, |
78 |
| - Boolean $validate_tls = $elasticsearch::validate_tls, |
| 63 | + String $location, |
| 64 | + Enum['absent', 'present'] $ensure = 'present', |
| 65 | + Optional[Variant[String, Sensitive[String]]] $api_basic_auth_password = $elasticsearch::api_basic_auth_password, |
| 66 | + Optional[String] $api_basic_auth_username = $elasticsearch::api_basic_auth_username, |
| 67 | + Optional[Stdlib::Absolutepath] $api_ca_file = $elasticsearch::api_ca_file, |
| 68 | + Optional[Stdlib::Absolutepath] $api_ca_path = $elasticsearch::api_ca_path, |
| 69 | + String $api_host = $elasticsearch::api_host, |
| 70 | + Integer[0, 65535] $api_port = $elasticsearch::api_port, |
| 71 | + Enum['http', 'https'] $api_protocol = $elasticsearch::api_protocol, |
| 72 | + Integer $api_timeout = $elasticsearch::api_timeout, |
| 73 | + Boolean $compress = true, |
| 74 | + Optional[String] $chunk_size = undef, |
| 75 | + Optional[String] $max_restore_rate = undef, |
| 76 | + Optional[String] $max_snapshot_rate = undef, |
| 77 | + Optional[String] $repository_type = undef, |
| 78 | + Boolean $validate_tls = $elasticsearch::validate_tls, |
79 | 79 | ) {
|
| 80 | + $api_basic_auth_password_unsensitive = if $api_basic_auth_password =~ Sensitive { |
| 81 | + $api_basic_auth_password.unwrap |
| 82 | + } else { |
| 83 | + $api_basic_auth_password |
| 84 | + } |
| 85 | + |
80 | 86 | es_instance_conn_validator { "${name}-snapshot":
|
81 | 87 | server => $api_host,
|
82 | 88 | port => $api_port,
|
|
95 | 101 | port => $api_port,
|
96 | 102 | timeout => $api_timeout,
|
97 | 103 | username => $api_basic_auth_username,
|
98 |
| - password => $api_basic_auth_password, |
| 104 | + password => $api_basic_auth_password_unsensitive, |
99 | 105 | ca_file => $api_ca_file,
|
100 | 106 | ca_path => $api_ca_path,
|
101 | 107 | validate_tls => $validate_tls,
|
|
0 commit comments