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

View File

@ -153,19 +153,19 @@ options:
type: bool
config_drive:
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
suboptions:
cloud_config:
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
users other than the 'user_name' admin user.
type: dict
meta_data:
description:
- Extra metadata to include with the config-drive cloud-init
metadata. This will be added to the generated metadata
- Extra metadata to include with the config-drive metadata.
This will be added to the generated metadata
'public_keys', 'uuid', 'name', and 'hostname'.
type: dict
clean_up:

View File

@ -61,15 +61,15 @@ Each instances has the following attributes:
``capabilities`` (defaults to ``metalsmith_capabilities``)
node capabilities to request when scheduling.
``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``
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
users other than the 'user_name' admin user.
``meta_data``
Extra metadata to include with the config-drive cloud-init
metadata. This will be added to the generated metadata
Extra metadata to include with the config-drive metadata.
This will be added to the generated metadata
``public_keys``, ``uuid``, ``name``, and ``hostname``.
``conductor_group`` (defaults to ``metalsmith_conductor_group``)