~vkuznets/cloud-init:cloud-init-per-dashes

Last commit made on 2019-01-29
Get this branch:
git clone -b cloud-init-per-dashes https://git.launchpad.net/~vkuznets/cloud-init
Only Vitaly Kuznetsov can upload to this branch. If you are Vitaly Kuznetsov please log in for upload directions.

Branch merges

Branch information

Name:
cloud-init-per-dashes
Repository:
lp:~vkuznets/cloud-init

Recent commits

1482b56... by Vitaly Kuznetsov

cloud-init-per: don't use dashes in sem names

It was found that when there is a dash in cloud-init-per command
name and cloud-init-per is executed through cloud-init's bootcmd, e.g:

bootcmd:
 - cloud-init-per instance mycmd-bootcmd /usr/bin/mycmd

the command is executed on each boot. However, running the same
cloud-init-per command manually after boot doesn't reveal the issue. Turns
out the issue comes from 'migrator' cloud-init module which renames all
files in /var/lib/cloud/instance/sem/ replacing dashes with underscores. As
migrator runs before bootcmd it renames

/var/lib/cloud/instance/sem/bootper.mycmd-bootcmd.instance
to
/var/lib/cloud/instance/sem/bootper.mycmd_bootcmd.instance

so cloud-init-per doesn't see it and thinks that the comment was never ran
before. On next boot the sequence repeats.

There are multiple ways to resolve the issue. This patch takes the
following approach: 'canonicalize' sem names by replacing dashes with
underscores (this is consistent with post-'migrator' contents of
/var/lib/cloud/instance/sem/). We, however, need to be careful: in case
someone had a command with dashes before and he had migrator module enables
we need to see the old sem file (or the command will run again and this can
be as bad as formatting a partition!) so we add a small 'migrator' part to
cloud-init-per script itself checking for legacy sem names.

Signed-off-by: Vitaly Kuznetsov <email address hidden>

3861102... by Eduardo Otubo

net: Make sysconfig renderer compatible with Network Manager.

The 'sysconfig' renderer is activated if, and only if, there's ifup and
ifdown commands present in its search dictonary or the network-scripts
configuration files are found. This patch adds a check for Network-
Manager configuration file as well.

This solution is based on the use of the plugin 'ifcfg-rh' present in
Network-Manager and is designed to support Fedora 29 or other
distributions that also replaced network-scripts by Network-Manager.

ad170db... by Marlin Cremers <email address hidden>

cc_set_passwords: Fix regex when parsing hashed passwords

Correct invalid regex to match hashes starting with the following:
  - $1, $2a, $2y, $5 or $6

LP: #1811446

fdadcb5... by Jason Zions <email address hidden>

net: Wait for dhclient to daemonize before reading lease file

cloud-init uses dhclient to fetch the DHCP lease so it can extract
DHCP options. dhclient creates the leasefile, then writes to it;
simply waiting for the leasefile to appear creates a race between
dhclient and cloud-init. Instead, wait for dhclient to be parented by
init. At that point, we know it has written to the leasefile, so it's
safe to copy the file and kill the process.

cloud-init creates a temporary directory in which to execute dhclient,
and deletes that directory after it has killed the process. If
cloud-init abandons waiting for dhclient to daemonize, it will still
attempt to delete the temporary directory, but will not report an
exception should that attempt fail.

LP: #1794399

f19dc8f... by Jason Zions <email address hidden>

[Azure] Increase retries when talking to Wireserver during metadata walk

Testing startup of large numbers of VMs (of varying distros) in Azure
shows that 3 retries results in a small percentage of failed VMs.
Increasing that by a few dramatically decreases the occurrence of
provisioning timeout errors. The initial choice of "3 retries" was
uninformed by heavy testing. Also, the alternate provisioning
mechanism for Azure (waagent) retries the Wireserver crawl without
limit. 10 retries seems a more reasonable choice.

5f49ee0... by Scott Moser

Add documentation on adding a datasource.

This adds documentation intended for a developer on how to add
a new datasource to cloud-init.

3984726... by Scott Moser

doc: clean up some datasource documentation.

The change to datasources.rst here is obvious typo fix.
The change to azure is to reduce the two 'Customization' sections
to a single and clean up some other duplicate text.

12bc76c... by Scott Moser

ds-identify: fix wrong variable name in ovf_vmware_transport_guestinfo.

ovf_vmware_transport_guestinfo is not currently tested.
It used '$1' instead of '$out' when checking for xml content in
the output of vmware-rpctool.

a809b25... by =?utf-8?q?PORTE_Lo=C3=AFc?= <email address hidden>

Scaleway: Support ssh keys provided inside an instance tag.

The change here will utilize ssh keys found inside an instance's tag.
The tag value must start with 'AUTHORIZED_KEY'.

d4d11c7... by Scott Moser

OVF: simplify expected return values of transport functions.

Transport functions (transport_iso9660 and transport_vmware_guestinfo)
would return a tuple of 3 values, but only the first was ever used
outside of test. The other values (device and filename) were just
ignored.

This just simplifies the transport functions to now return content
(in string format) or None indicating that the transport was not found.