~smoser/cloud-init:bug/before-fsck

Last commit made on 2017-07-25
Get this branch:
git clone -b bug/before-fsck https://git.launchpad.net/~smoser/cloud-init
Only Scott Moser can upload to this branch. If you are Scott Moser please log in for upload directions.

Branch merges

Branch information

Name:
bug/before-fsck
Repository:
lp:~smoser/cloud-init

Recent commits

1f5489c... by Scott Moser

systemd: make systemd-fsck run after cloud-init.service

cloud-init.service may write filesystems (fs_setup) or re-partition
(disk_setup) disks.

If systemd-fsck is running on a device while that is occuring
then the partitioning or mkfs might fail due to the device being busy.
Alternatively, the fsck might fail and cause subsequent mount to fail.

LP: #1691489

ebdbf30... by Scott Moser

tests: Add initial tests for EC2 and improve a docstring.

EC2 was the original, but this adds some initial tests for that datasource.
Also updates a docstring for an internal method.

0ef61b2... by Scott Moser

locale: Do not re-run locale-gen if provided locale is system default.

If the system configure default in /etc/default/locale is set to the same
value that is provided for cloud-init's "locale" setting, then do not
re-run locale-gen. This allows images built with a locale already
generated to not re-run locale-gen (which can be very heavy).

Also here is a fix to invoke update-locale correctly and remove the
internal writing of /etc/default/locale. We were calling
  update-locale <locale>
This ends up having no affect. The more correct invocation is:
  update-locale LANG=<locale>

Also added some support here should we ever want to change setting
LANG to setting LC_ALL (or any other key).

Lastly, a test change to allow us to use assert_not_called from mock.
Versions of mock in CentOS 6 do not have assert_not_called.

85c984c... by Joshua Powers

archlinux: fix set hostname usage of write_file.

cloud-init fails to set the hostname on Arch Linux because that
_write_hostname passes conf instead of str(conf) to util.write_file.

LP: #1705306

681baff... by Scott Moser

sysconfig: support subnet type of 'manual'.

The subnet type 'manual' was used as a way to declare a device
and set an MTU for it but not assign network addresses.

This updates the manual example config to handle that case and
provides expected rendered output for sysconfig, eni, and netplan.

33d5739... by Scott Moser

tools/run-centos: make running with no argument show help.

If you ran tools/run-centos without an argument it would fail due
to 'set -u' like:
  ./tools/run-centos: line 266: 1: unbound variable

42a7b34... by Bob Aman

Drop rand_str() usage in DNS redirection detection

Making lots of random invalid DNS queries interferes with the ability
of security teams to identify malicious or anomalous behavior from DNS
logs. The same goal should be achievable with a consistent query for a
name that is disallowed.

LP: #1088611

7e41b2a... by Ryan Harper

sysconfig: use MACADDR on bonds/bridges to configure mac_address

Previously, sysconfig rendered HWADDR for all interface types, but
that value is only used to identify physical devices. Instead use
MACADDR to configure the MAC on virtual devices, like bonds and
bridges.

- Sort bond slave list to ensure consistent ordering in sysconfig
  rendered files.
- Add unittests for sysconfig rendering of bonds/bridges with
  mac_address

LP: #1701417

811ce49... by Ryan Harper

net: eni route rendering missed ipv6 default route config

In some network configurations a network value of '::' and a
netmask value of '::' were used to indicate a default IPV6 gateway.
Commit d00da2d5 removed ipv6 'netmask' attributes and calculate
a prefix length value instead. The eni route rendering failed to update
the check to use prefix value of 0 to indicate the presence of an IPV6
default route.

A broken ipv6 default route rendered like:

 post-up route add -net :: netmask :: gw 2001:4800:78ff:1b::1 || true

And with this patch, it now renders like:

 post-up route add -A inet6 default gw 2001:4800:78ff:1b::1 || true

LP: #1701097

353c690... by Ryan Harper

sysconfig: enable mtu set per subnet, including ipv6 mtu

Render MTU values if present in subnet and route configurations
for v4 and v6.

LP: #1702513