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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
|
# File 'manifests/client/settings.pp', line 40
define st2::client::settings(
$user = $name,
$homedir = "/home/${name}",
$auth = $st2::auth,
$api_url = $st2::cli_api_url,
$auth_url = $st2::cli_auth_url,
$base_url = $st2::cli_base_url,
$username = $st2::cli_username,
$password = $st2::cli_password,
$disable_credentials = false,
$api_version = $st2::cli_api_version,
$cacert = $st2::cli_cacert,
$debug = $st2::cli_debug,
$cache_token = $st2::cli_cache_token,
$silence_ssl_warnings = $st2::cli_silence_ssl_warnings,
) {
Ini_setting {
ensure => present,
path => "${homedir}/.st2/config",
require => File["${homedir}/.st2"],
}
file { "${homedir}/.st2":
ensure => directory,
owner => $user,
mode => '0700',
}
ini_setting { "${user}-st2_cli_api_url":
section => 'api',
setting => 'url',
value => $api_url,
}
ini_setting { "${user}-st2_cli_general_base_url":
section => 'general',
setting => 'base_url',
value => $base_url,
}
ini_setting { "${user}-st2_cli_general_api_version":
section => 'general',
setting => 'api_version',
value => $api_version,
}
ini_setting { "${user}-st2_cli_general_cacert":
section => 'general',
setting => 'cacert',
value => $cacert,
}
$_cli_debug = $debug ? {
true => 'True',
default => 'False',
}
ini_setting { "${user}-st2_cli_cli_debug":
section => 'cli',
setting => 'debug',
value => $_cli_debug,
}
$_cache_token = $cache_token ? {
true => 'True',
default => 'False',
}
ini_setting { "${user}-st2_cli_cache_token":
section => 'cli',
setting => 'cache_token',
value => $_cache_token,
}
$_silence_ssl_warnings = $silence_ssl_warnings ? {
true => 'True',
default => 'False',
}
ini_setting { "${user}-st2_general_silence_ssl_warnings":
section => 'general',
setting => 'silence_ssl_warnings',
value => $_silence_ssl_warnings,
}
if $auth {
if ! $disable_credentials {
ini_setting { "${user}-st2_cli_credentials_username":
section => 'credentials',
setting => 'username',
value => $username,
}
ini_setting { "${user}-st2_cli_credentials_password":
section => 'credentials',
setting => 'password',
value => $password,
}
}
ini_setting { "${user}-st2_cli_auth_url":
section => 'auth',
setting => 'url',
value => $auth_url,
}
}
}
|