Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F8391224
domain.pp
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
domain.pp
View Options
# == Define hitch::domain
#
# This define installs pem files to the config root, and configures
# them in the hitch config file
#
define
hitch
::
domain
(
$key,
$cert,
$ensure
=
present
,
$cacert
=
''
,
$dhparams
=
''
,
)
{
include
::
hitch
include
::
hitch
::
config
$config_file
=
$::hitch::config_file
validate_absolute_path
(
$config_file)
$pem_file="${::hitch::config_root}/${title}.pem"
validate_absolute_path
(
$pem_file)
validate_re
(
$key,
'BEGIN PRIVATE KEY'
)
validate_re
(
$cert,
'BEGIN CERTIFICATE'
)
if
$cacert
{
validate_re
(
$cacert,
'BEGIN CERTIFICATE'
)
}
if
$dhparams
{
validate_re
(
$dhparams,
'BEGIN DH PARAMETERS'
)
}
validate_re
(
$ensure,
[
'^present$'
,
'^absent$'
])
# Add a line to the hitch config file
concat
::
fragment
{
"hitch::domain ${title}"
:
target
=>
$config_file,
content
=>
"pem-file = \"
${pem_file}\"",
}
file
{
"/etc/hitch/${title}.pem"
:
ensure
=>
$ensure,
mode
=>
'0600'
,
owner
=>
$::hitch::user,
group
=>
$::hitch::group,
content
=>
"${cacert}\n${cert}\n${key}\n${dhparams}"
,
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Jun 4 2025, 6:40 PM (14 w, 3 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3366575
Attached To
rSPHIT Hitch TLS proxy puppet module
Event Timeline
Log In to Comment