Merge "Add a known_hosts file"

This commit is contained in:
Jenkins 2017-04-03 20:19:40 +00:00 committed by Gerrit Code Review
commit 5fa6b9e081
1 changed files with 15 additions and 0 deletions

View File

@ -12,6 +12,8 @@
# canonicalweburl:
# Used in the Gerrit config to generate links,
# eg., https://review.example.com/
# known_hosts_content:
# Contents of the known_hosts file
# git_http_url:
# Optional base URL for repositories available over the HTTP protocol
# canonical_git_url:
@ -180,6 +182,7 @@ class gerrit(
$vhost_name = $::fqdn,
$redirect_to_canonicalweburl = true,
$canonicalweburl = "https://${::fqdn}/",
$known_hosts_content = '',
$git_http_url = '',
$canonical_git_url = '',
$robots_txt_source = '', # If left empty, the gerrit default will be used.
@ -665,6 +668,18 @@ class gerrit(
}
}
if $known_hosts_content != '' {
file { '/home/gerrit2/.ssh/known_hosts':
ensure => present,
owner => 'gerrit2',
group => 'gerrit2',
mode => '0600',
content => $known_hosts_content,
replace => true,
require => File['/home/gerrit2/.ssh'],
}
}
# Install Gerrit itself.
# The Gerrit WAR is specified as a url like