Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
immerda
Puppet Modules
webhosting
Commits
88338b07
Commit
88338b07
authored
Sep 30, 2017
by
mh
Browse files
make it possible to enforce ssh keys for a hosting
parent
8ce3e25b
Changes
1
Hide whitespace changes
Inline
Side-by-side
manifests/user_scripts/manage.pp
View file @
88338b07
...
...
@@ -73,18 +73,26 @@ define webhosting::user_scripts::manage(
group
=>
$web_group
,
mode
=>
'0600'
;
}
if
(
$script_name
==
'ssh_authorized_keys'
)
{
file
{
"/var/www/ssh_authorized_keys/
${sftp_user}
"
:
content
=>
template
(
'webhosting/user_scripts/ssh_authorized_keys/ssh_authorized_keys.keys.erb'
),
owner
=>
$sftp_user
,
group
=>
0
,
mode
=>
'0600'
,
seltype
=>
'ssh_home_t'
;
}
if
!
$user_scripts_options
[
'enforce_ssh_authorized_keys'
]
{
File
[
"/var/www/ssh_authorized_keys/
${sftp_user}
"
,
"
${scripts_path}
/
${script_name}
/
${script_name}
.
${config_ext}
"
]{
replace
=>
false
,
}
}
}
else
{
File
[
"
${scripts_path}
/
${script_name}
/
${script_name}
.
${config_ext}
"
]{
replace
=>
false
,
}
}
}
}
}
if
(
'ssh_authorized_keys'
in
$scripts
)
or
(
$scripts
==
'ALL'
)
{
file
{
"/var/www/ssh_authorized_keys/
${sftp_user}
"
:
content
=>
template
(
'webhosting/user_scripts/ssh_authorized_keys/ssh_authorized_keys.keys.erb'
),
replace
=>
false
,
owner
=>
$sftp_user
,
group
=>
0
,
mode
=>
'0600'
,
seltype
=>
'ssh_home_t'
;
}
}
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment