Follow-up to metalsmith_instances config_drive

Docs improvements and review nit changes

Change-Id: I2c22cf4c49eba86722fe4ce42768040253a4db9d
This commit is contained in:
Steve Baker 2020-12-08 14:34:21 +13:00
parent 22a4e4071c
commit 72d7624150
3 changed files with 10 additions and 13 deletions

View File

@ -44,7 +44,7 @@ class GenericConfig(object):
if meta_data and not isinstance(meta_data, dict): if meta_data and not isinstance(meta_data, dict):
raise TypeError('Custom meta_data must be a dictionary, ' raise TypeError('Custom meta_data must be a dictionary, '
'got %r' % meta_data) 'got %r' % meta_data)
self.meta_data = meta_data self.meta_data = meta_data or {}
def generate(self, node, hostname=None): def generate(self, node, hostname=None):
"""Generate the config drive information. """Generate the config drive information.
@ -67,10 +67,7 @@ class GenericConfig(object):
else: else:
ssh_keys = self.ssh_keys ssh_keys = self.ssh_keys
meta_data = {} meta_data = self.meta_data.copy()
if self.meta_data:
meta_data.update(self.meta_data)
meta_data.update({ meta_data.update({
'public_keys': ssh_keys, 'public_keys': ssh_keys,
'uuid': node.id, 'uuid': node.id,

View File

@ -153,19 +153,19 @@ options:
type: bool type: bool
config_drive: config_drive:
description: description:
- Extra data to add to the boot config-drive cloud-init - Extra data to add to the config-drive generated for this instance
type: dict type: dict
suboptions: suboptions:
cloud_config: cloud_config:
description: description:
- Dict of cloud-init cloud-config data for tasks to run on node - Dict of cloud-init cloud-config tasks to run on node
boot. The 'users' directive can be used to configure extra boot. The 'users' directive can be used to configure extra
users other than the 'user_name' admin user. users other than the 'user_name' admin user.
type: dict type: dict
meta_data: meta_data:
description: description:
- Extra metadata to include with the config-drive cloud-init - Extra metadata to include with the config-drive metadata.
metadata. This will be added to the generated metadata This will be added to the generated metadata
'public_keys', 'uuid', 'name', and 'hostname'. 'public_keys', 'uuid', 'name', and 'hostname'.
type: dict type: dict
clean_up: clean_up:

View File

@ -61,15 +61,15 @@ Each instances has the following attributes:
``capabilities`` (defaults to ``metalsmith_capabilities``) ``capabilities`` (defaults to ``metalsmith_capabilities``)
node capabilities to request when scheduling. node capabilities to request when scheduling.
``config_drive`` ``config_drive``
extra data to add to the boot config-drive cloud-init: extra data to add to the config-drive generated for this instance:
``cloud_config`` ``cloud_config``
Dict of cloud-init cloud-config data for tasks to run on node Dict of cloud-init cloud-config tasks to run on node
boot. The 'users' directive can be used to configure extra boot. The 'users' directive can be used to configure extra
users other than the 'user_name' admin user. users other than the 'user_name' admin user.
``meta_data`` ``meta_data``
Extra metadata to include with the config-drive cloud-init Extra metadata to include with the config-drive metadata.
metadata. This will be added to the generated metadata This will be added to the generated metadata
``public_keys``, ``uuid``, ``name``, and ``hostname``. ``public_keys``, ``uuid``, ``name``, and ``hostname``.
``conductor_group`` (defaults to ``metalsmith_conductor_group``) ``conductor_group`` (defaults to ``metalsmith_conductor_group``)