Merge "Add quotes for bareword instances of 'type'"
This commit is contained in:
@@ -406,25 +406,25 @@ class nova(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if $nova_public_key {
|
if $nova_public_key {
|
||||||
if ! $nova_public_key[key] or ! $nova_public_key[type] {
|
if ! $nova_public_key[key] or ! $nova_public_key['type'] {
|
||||||
fail('You must provide both a key type and key data.')
|
fail('You must provide both a key type and key data.')
|
||||||
}
|
}
|
||||||
|
|
||||||
ssh_authorized_key { 'nova-migration-public-key':
|
ssh_authorized_key { 'nova-migration-public-key':
|
||||||
ensure => present,
|
ensure => present,
|
||||||
key => $nova_public_key[key],
|
key => $nova_public_key[key],
|
||||||
type => $nova_public_key[type],
|
type => $nova_public_key['type'],
|
||||||
user => 'nova',
|
user => 'nova',
|
||||||
require => File['/var/lib/nova/.ssh'],
|
require => File['/var/lib/nova/.ssh'],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if $nova_private_key {
|
if $nova_private_key {
|
||||||
if ! $nova_private_key[key] or ! $nova_private_key[type] {
|
if ! $nova_private_key[key] or ! $nova_private_key['type'] {
|
||||||
fail('You must provide both a key type and key data.')
|
fail('You must provide both a key type and key data.')
|
||||||
}
|
}
|
||||||
|
|
||||||
$nova_private_key_file = $nova_private_key[type] ? {
|
$nova_private_key_file = $nova_private_key['type'] ? {
|
||||||
'ssh-rsa' => '/var/lib/nova/.ssh/id_rsa',
|
'ssh-rsa' => '/var/lib/nova/.ssh/id_rsa',
|
||||||
'ssh-dsa' => '/var/lib/nova/.ssh/id_dsa',
|
'ssh-dsa' => '/var/lib/nova/.ssh/id_dsa',
|
||||||
'ssh-ecdsa' => '/var/lib/nova/.ssh/id_ecdsa',
|
'ssh-ecdsa' => '/var/lib/nova/.ssh/id_ecdsa',
|
||||||
@@ -432,7 +432,7 @@ class nova(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ! $nova_private_key_file {
|
if ! $nova_private_key_file {
|
||||||
fail("Unable to determine name of private key file. Type specified was '${nova_private_key[type]}' but should be one of: ssh-rsa, ssh-dsa, ssh-ecdsa.")
|
fail("Unable to determine name of private key file. Type specified was '${nova_private_key['type']}' but should be one of: ssh-rsa, ssh-dsa, ssh-ecdsa.")
|
||||||
}
|
}
|
||||||
|
|
||||||
file { $nova_private_key_file:
|
file { $nova_private_key_file:
|
||||||
|
Reference in New Issue
Block a user