Merge "Add SSH public key to nodepool-builder"
This commit is contained in:
commit
ad163ceb22
|
@ -16,6 +16,7 @@
|
|||
#
|
||||
class nodepool::builder(
|
||||
$statsd_host = undef,
|
||||
$nodepool_ssh_public_key = undef,
|
||||
$image_log_document_root = '/var/log/nodepool/image',
|
||||
$builder_logging_conf_template = 'nodepool/nodepool-builder.logging.conf.erb',
|
||||
$environment = {},
|
||||
|
@ -25,6 +26,27 @@ class nodepool::builder(
|
|||
|
||||
include ::diskimage_builder
|
||||
|
||||
if ! defined(File['/home/nodepool/.ssh']) {
|
||||
file { '/home/nodepool/.ssh':
|
||||
ensure => directory,
|
||||
mode => '0500',
|
||||
owner => 'nodepool',
|
||||
group => 'nodepool',
|
||||
require => User['nodepool'],
|
||||
}
|
||||
}
|
||||
|
||||
if ($nodepool_ssh_public_key != undef) {
|
||||
file { '/home/nodepool/.ssh/id_rsa.pub':
|
||||
ensure => present,
|
||||
content => $nodepool_ssh_public_key,
|
||||
mode => '0644',
|
||||
owner => 'nodepool',
|
||||
group => 'nodepool',
|
||||
require => File['/home/nodepool/.ssh'],
|
||||
}
|
||||
}
|
||||
|
||||
file { '/etc/init.d/nodepool-builder':
|
||||
ensure => present,
|
||||
mode => '0555',
|
||||
|
|
|
@ -200,14 +200,6 @@ class nodepool (
|
|||
require => User['nodepool'],
|
||||
}
|
||||
|
||||
file { '/home/nodepool/.ssh':
|
||||
ensure => directory,
|
||||
mode => '0500',
|
||||
owner => 'nodepool',
|
||||
group => 'nodepool',
|
||||
require => User['nodepool'],
|
||||
}
|
||||
|
||||
file { '/home/nodepool/.ssh/id_rsa':
|
||||
ensure => present,
|
||||
content => $nodepool_ssh_private_key,
|
||||
|
@ -217,17 +209,6 @@ class nodepool (
|
|||
require => File['/home/nodepool/.ssh'],
|
||||
}
|
||||
|
||||
if ($nodepool_ssh_public_key != undef) {
|
||||
file { '/home/nodepool/.ssh/id_rsa.pub':
|
||||
ensure => present,
|
||||
content => $nodepool_ssh_public_key,
|
||||
mode => '0644',
|
||||
owner => 'nodepool',
|
||||
group => 'nodepool',
|
||||
require => File['/home/nodepool/.ssh'],
|
||||
}
|
||||
}
|
||||
|
||||
file { '/home/nodepool/.ssh/config':
|
||||
ensure => present,
|
||||
source => 'puppet:///modules/nodepool/ssh.config',
|
||||
|
@ -442,11 +423,25 @@ class nodepool (
|
|||
|
||||
if ($install_nodepool_builder) {
|
||||
class { '::nodepool::builder':
|
||||
nodepool_ssh_public_key => $nodepool_ssh_public_key,
|
||||
statsd_host => $statsd_host,
|
||||
environment => $environment,
|
||||
builder_logging_conf_template => $builder_logging_conf_template,
|
||||
build_workers => $build_workers,
|
||||
upload_workers => $upload_workers,
|
||||
}
|
||||
} else {
|
||||
# For now, conditionally include this, since this code also lives in
|
||||
# nodepool-builder. One things have settled down with zuulv3 effort, we
|
||||
# should refactor this into a common.pp file.
|
||||
if ! defined(File['/home/nodepool/.ssh']) {
|
||||
file { '/home/nodepool/.ssh':
|
||||
ensure => directory,
|
||||
mode => '0500',
|
||||
owner => 'nodepool',
|
||||
group => 'nodepool',
|
||||
require => User['nodepool'],
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue