-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathconfig_ci.pp
executable file
·47 lines (45 loc) · 1.48 KB
/
config_ci.pp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# define: config_ci
#
# This define handles the export of xldeploy_ci if this module is used in conjunction with shared resources
# The trick here is that the puppet run is able to determine if a xldeploy ci is too old to maintain
# and should be removed from the xldeploy configuration once the last export is too long ago.
#
#
# == parameters
#
# [*type*]
# [*properties*]
# [*discovery*]
# [*discovery_max_wait*]
# [*id*]
# [*export_timestamp*]
# [*remove_when_expired*]
# [*export_maxage*]
define xldeploy::client::config_ci(
$type,
$ensure = 'present',
$properties = {},
$rest_url = $xldeploy::client::rest_url,
$discovery = false,
$discovery_max_wait = '120',
$use_exported_resources = $xldeploy::client::use_exported_resources
){
# if the age exceeds the export_maxage and remove_when_expired is set to true then set ensure to absent
if str2bool($use_exported_resources) {
@@xldeploy::client::exported_ci{"${::hostname}__${name}":
type => $type,
properties => $properties,
rest_url => $rest_url,
discovery => $discovery,
discovery_max_wait => $discovery_max_wait
}
}else{
xldeploy_ci{ $name:
ensure => $ensure,
type => $type,
properties => $properties,
discovery => $discovery,
discovery_max_wait => $discovery_max_wait,
rest_url => $rest_url }
}
}