Defined Type: keycloak::spi_deployment
- Defined in:
- manifests/spi_deployment.pp
Summary
Manage Keycloak SPI deploymentOverview
}
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 |
# File 'manifests/spi_deployment.pp', line 38
define keycloak::spi_deployment (
Variant[Stdlib::Filesource, Stdlib::HTTPSUrl] $source,
Enum['present', 'absent'] $ensure = 'present',
String[1] $deployed_name = $name,
Optional[String] $test_url = undef,
Optional[String] $test_key = undef,
Optional[String] $test_value = undef,
Optional[String] $test_realm = undef,
Optional[Array] $test_before = undef,
) {
include keycloak
$basename = basename($source)
$dest = "${keycloak::providers_dir}/${deployed_name}"
$tmp = "${keycloak::tmp_dir}/${basename}"
if $ensure == 'present' {
if $source =~ Stdlib::HTTPUrl or $source =~ Stdlib::HTTPSUrl {
$_source = $tmp
archive { $name:
ensure => 'present',
extract => false,
path => $tmp,
source => $source,
creates => $tmp,
cleanup => false,
user => $keycloak::user,
group => $keycloak::group,
require => File[$keycloak::tmp_dir],
before => File[$dest],
}
} else {
$_source = $source
}
file { $dest:
ensure => 'file',
source => $_source,
owner => $keycloak::user,
group => $keycloak::group,
mode => '0644',
require => Class['keycloak::install'],
notify => Class['keycloak::service'],
}
if $test_url and $test_key and $test_value {
keycloak_resource_validator { $name:
test_url => $test_url,
test_key => $test_key,
test_value => $test_value,
realm => $test_realm,
dependent_resources => $test_before,
require => Class['keycloak::service'],
}
}
}
if $ensure == 'absent' {
file { $dest:
ensure => 'absent',
require => Class['keycloak::install'],
notify => Class['keycloak::service'],
}
}
}
|