Fix up ssh key usage

We need for the keys to only have the key content. Also, we've learned
that the ssh_authorized_key title is important.

Change-Id: Ie772572e041ea6c1587dddb02937b89541a37e1b
This commit is contained in:
Monty Taylor 2014-04-25 09:57:12 -07:00
parent 9de8df3508
commit 8895d64289
4 changed files with 13 additions and 5 deletions

View File

@ -52,13 +52,17 @@ class jenkins::jenkinsuser(
require => File['/home/jenkins'],
}
ssh_authorized_key { '/home/jenkins/.ssh/authorized_keys':
ssh_authorized_key { 'jenkins-master-2014-04-24':
ensure => present,
user => 'jenkins',
type => 'ssh-rsa',
key => $ssh_key,
require => File['/home/jenkins/.ssh'],
}
ssh_authorized_key { '/home/jenkins/.ssh/authorized_keys':
ensure => absent,
user => 'jenkins',
}
#NOTE: not all distributions have default bash files in /etc/skel
if ($::osfamily == 'Debian') {

View File

@ -149,7 +149,7 @@ class jenkins::master(
owner => 'jenkins',
group => 'nogroup',
mode => '0644',
content => $jenkins_ssh_public_key,
content => "ssh_rsa ${jenkins_ssh_public_key} jenkins@${::fqdn}",
replace => true,
require => File['/var/lib/jenkins/.ssh/'],
}

View File

@ -64,13 +64,17 @@ class openstack_project::git_backend (
require => User['cgit'],
}
ssh_authorized_key { '/home/cgit/.ssh/authorized_keys':
ssh_authorized_key { 'gerrit-replication-2014-04-25':
ensure => present,
user => 'cgit',
type => 'ssh-rsa',
key => $git_gerrit_ssh_key,
require => File['/home/cgit/.ssh/']
}
ssh_authorized_key { '/home/cgit/.ssh/authorized_keys':
ensure => absent,
user => 'cgit',
}
file { '/home/cgit/projects.yaml':
ensure => present,

View File

@ -2,8 +2,8 @@
#
class openstack_project {
$jenkins_ssh_key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC6WutNHfM+YdnjeNFeaIpvxqt+9aDn95Ykpmc+fASSjlDZJtOrueH3ch/v08wkE4WQKg03i+t8VonqEwMGmApYA3VzFsURUQbxzlSz5kHlBQSqgz5JTwUmnt1RH5sePL5pkuJ6JgqJ8PxJod6fiD7YDjaKJ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