Last commit made on 2019-02-13
Get this branch:
git clone -b lp1802073 https://git.launchpad.net/~gpiccoli/cloud-init
Only Guilherme G. Piccoli can upload to this branch. If you are Guilherme G. Piccoli please log in for upload directions.

Branch merges

Branch information


Recent commits

a5c1f69... by Guilherme G. Piccoli on 2019-02-11

EC2: Rewrite network config on AWS Classic instances every boot

AWS EC2 instances' network come in 2 basic flavors: Classic and VPC
(Virtual Private Cloud). The former has an interesting behavior of having
its MAC address changed whenever the instance is stopped/restarted. This
behavior is not observed in VPC instances.

In Ubuntu 18.04 (Bionic) the network "management" changed from ENI-style
(etc/network/interfaces) to netplan, and when using netplan we observe
the following block present in /etc/netplan/50-cloud-init.yaml:

  macaddress: aa:bb:cc:dd:ee:ff

Jani Ollikainen noticed in Launchpad bug #1802073 that the EC2 Classic
instances were booting without network access in Bionic after a stop/restart
procedure, due to their MAC address change behavior. It was narrowed down to
the netplan MAC match block, that kept the old MAC address after stopping
and restarting an instance, since the network configuration writing happens
by default only once in EC2 instances, in the first boot.

This patch changes the network configuration write to every boot in EC2
Classic instances, by checking against the "vpc-id" metadata information
provided only in the VPC instances - if we don't have this metadata value,
cloud-init will rewrite the network configuration file in every boot.

This was tested in an EC2 Classic instance and proved to fix the issue;
unit tests were also added for the new method is_classic_instance().

LP: #1802073

Reported-by: Jani Ollikainen <email address hidden>
Suggested-by: Ryan Harper <email address hidden>
Co-developed-by: Chad Smith <email address hidden>
Signed-off-by: Guilherme G. Piccoli <email address hidden>

fff37e7... by Ryan Harper on 2019-02-08

netinfo: Adjust ifconfig output parsing for FreeBSD ipv6 entries

FreeBSD ifconfig output for ipv6 addrs doesn't find scopeid values
when present in the output and the pformat rendering assumes that
an ipv6 address will have a 'scope6' entry in the netdev info
dictionary. This patch finds the scopeid value, which is not
always inside <>, and in some cases v6 addrs don't have a scopeid
value in the output, so when rendering the table, allow scope6 value
to be replaced with the empty value.

LP: #1779672

cf30836... by Ryan Harper on 2019-02-07

netplan: Don't render yaml aliases when dumping netplan

Cloud-init rendered netplan with duplicate aliases if a network config
included "global" nameserver/search values. Netplan uses can read yaml
files which do use aliaes but cloud-init did not render a single yaml
dictionary, instead it combined yaml sections into a single document
which sometimes resulted in duplicate aliases being present.

This branch introduces a yaml SafeDumper class which can set the
'ignore_aliases' attribute. This is not enabled by default but callers
to util.yaml_dumps can pass a boolean to toggle this. The netplan
render uses noalias=True and the resulting yaml output does not contain
any aliases.

LP: #1815051

e9bf4f2... by do3meli on 2019-02-07

add PyCharm IDE .idea/ path to .gitignore

3a897fb... by do3meli on 2019-02-06

correct grammar issue in instance metadata documentation

LP: #1802188

4895535... by Chad Smith on 2019-01-31

clean: cloud-init clean should not trace when run from within cloud_dir

Avoid traceback when cloud-init clean is run from within
/var/lib/cloud/ deleted dirs.

LP: #1795508

94a6452... by Paride Legovini on 2019-01-30

Resolve flake8 comparison and pycodestyle over-ident issues

 - flake8: use ==/!= to compare str, bytes, and int literals
 - pycodestyle: E117 over-indented

8ee294d... by Chad Smith on 2019-01-28

opennebula: also exclude epochseconds from changed environment vars

In addition to EPOCHREALTIME there is also an EPOCHSECONDS environment
variable that OpenNebula needs to exclude as it is expected to change.
This commit supplements the other exclusion in commit

Without this fix, unittests will intermittently fail if
parse_shell_config is run across a timing boundary where the
EPOCHSECONDS changes mid-test.

LP: #1813641

09dcecf... by Robert Schweikert on 2019-01-28

systemd: Render generator from template to account for system differences.

The systemd generator used had a hard coded path for the location target
file to create. This path does not apply to all distributions.
Make the generator and template to have the path set during build time.

3f12012... by Robert Schweikert on 2019-01-28

sysconfig: On SUSE, use STARTMODE instead of ONBOOT

ONBOOT is not recognized on openSUSE and SUSE Linux Enterprise,
add the STARTMODE setting

LP: #1799540