Add support for specifying key-name per label
In order to support putting less things into images via puppet in Infra, we'd like to be able to pre-populate our clouds with keypairs for the infra-root accounts and have nova add those at boot time. Change-Id: I9e2c990040342de722f68de09f273005f57a699f
This commit is contained in:
parent
02d137a777
commit
8037855400
@ -465,3 +465,9 @@ Example configuration::
|
|||||||
Determine the flavor to use (e.g. ``m1.medium``, ``m1.large``,
|
Determine the flavor to use (e.g. ``m1.medium``, ``m1.large``,
|
||||||
etc). The smallest flavor that meets the ``min-ram`` requirements
|
etc). The smallest flavor that meets the ``min-ram`` requirements
|
||||||
will be chosen.
|
will be chosen.
|
||||||
|
|
||||||
|
**optional**
|
||||||
|
|
||||||
|
``key-name``
|
||||||
|
If given, is the name of a keypair that will be used when booting each
|
||||||
|
server.
|
||||||
|
@ -34,6 +34,7 @@ class ConfigValidator:
|
|||||||
v.Required('diskimage'): str,
|
v.Required('diskimage'): str,
|
||||||
'min-ram': int,
|
'min-ram': int,
|
||||||
'flavor-name': str,
|
'flavor-name': str,
|
||||||
|
'key-name': str,
|
||||||
}
|
}
|
||||||
|
|
||||||
pool_label = v.All(pool_label_main,
|
pool_label = v.All(pool_label_main,
|
||||||
|
@ -89,7 +89,8 @@ class ProviderLabel(ConfigValue):
|
|||||||
def __eq__(self, other):
|
def __eq__(self, other):
|
||||||
if (other.diskimage != self.diskimage or
|
if (other.diskimage != self.diskimage or
|
||||||
other.min_ram != self.min_ram or
|
other.min_ram != self.min_ram or
|
||||||
other.flavor_name != self.flavor_name):
|
other.flavor_name != self.flavor_name or
|
||||||
|
other.key_name != self.key_name):
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
||||||
@ -250,6 +251,7 @@ def loadConfig(config_path):
|
|||||||
pl.diskimage = newconfig.diskimages[label['diskimage']]
|
pl.diskimage = newconfig.diskimages[label['diskimage']]
|
||||||
pl.min_ram = label.get('min-ram', 0)
|
pl.min_ram = label.get('min-ram', 0)
|
||||||
pl.flavor_name = label.get('flavor-name', None)
|
pl.flavor_name = label.get('flavor-name', None)
|
||||||
|
pl.key_name = label.get('key-name')
|
||||||
top_label = newconfig.labels[pl.name]
|
top_label = newconfig.labels[pl.name]
|
||||||
top_label.pools.append(pp)
|
top_label.pools.append(pp)
|
||||||
|
|
||||||
|
@ -280,6 +280,7 @@ class NodeLauncher(threading.Thread, StatsReporter):
|
|||||||
image_id=cloud_image.external_id,
|
image_id=cloud_image.external_id,
|
||||||
min_ram=self._label.min_ram,
|
min_ram=self._label.min_ram,
|
||||||
flavor_name=self._label.flavor_name,
|
flavor_name=self._label.flavor_name,
|
||||||
|
key_name=self._label.key_name,
|
||||||
az=self._node.az,
|
az=self._node.az,
|
||||||
config_drive=self._diskimage.config_drive,
|
config_drive=self._diskimage.config_drive,
|
||||||
nodepool_node_id=self._node.id,
|
nodepool_node_id=self._node.id,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user