This adds support for parsing openstack meta-data.json files in
config-2 filesystems and extracting and installing any SSH pubkeys
into the default user account.
In order to properly parse a config-2 json blob outside of the normal
openstack early initialization, we need to fill the parser table
properly and clean it up.
This exposes some flaws in other parts of this code that appear that
this wasn't entirely fully tested. I have not yet confirmed that
in a config-2 scenario everything actually automatically works yet,
this remains to be done.
cloud-init-pre-network:
runs before network service.
this service gets metadata from local datasources
in order to configure network stuff before network service
and configures the instance on its first booot
cloud-init:
runs after network service and will get userdata/metadata
from datasources(local/network). This service fixes disk
and filesystem
add first-boot-setup and no-network options
update documentation
we can not use systemd to detect first boot because
users can create snapshots of running vm's and boot
these snapshots, therefore metadata must be used to
identify vm's first boot not systemd :(
remove -b, --first-boot option because now clr-clodu-init
is able to identify vm's first boot using instance id
implement uuid metadata handler
add --openstack-config-drive option to process metadata and
userdata using as datasource an openstack config drive
(iso9660 or vfat filesystem)
add type_by_device function to get the disk type
write_sudo_string is renamed to write_sudo_directives
write_ssh_key is renamed to write_ssh_keys
now these functions use buffers to improve
access to disk (open/write/close functions)
In future we should convert openstack_metadata_keys to a boolean function,
and make sure it breaks iteration of the GNode when hitting a failure,
similar to other areas within clr-cloud-init
Signed-off-by: Ikey Doherty <michael.i.doherty@intel.com>