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
48
49
50
51
52
53
54
55
56
57
58
|
# File 'manifests/pack.pp', line 18
define st2::pack (
$ensure = present,
$pack = $name,
$repo_url = undef,
$config = undef,
$version = undef,
) {
include st2
$_cli_username = $st2::cli_username
$_cli_password = $st2::cli_password
$_cli_apikey = $st2::cli_apikey
st2_pack { $pack:
ensure => $ensure,
name => $pack,
user => $_cli_username,
password => $_cli_password,
apikey => $_cli_apikey,
source => $repo_url,
version => $version,
}
if $config {
validate_hash($config)
file { "/opt/stackstorm/configs/${pack}.yaml":
ensure => file,
mode => '0640',
owner => 'st2',
group => 'root',
content => template('st2/config.yaml.erb'),
}
# Register package after it is downloaded and configured
St2_pack<| name == $pack |>
-> File["/opt/stackstorm/configs/${pack}.yaml"]
~> Exec<| tag == 'st2::register-configs' |>
}
Service<| tag == 'st2::service' |> -> St2_pack<||>
Exec<| tag == 'st2::reload' |> -> St2_pack<||>
}
|