~smoser/cloud-init:fix/1787459-fix-ds-sys_cfg

Last commit made on 2018-09-18
Get this branch:
git clone -b fix/1787459-fix-ds-sys_cfg 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:
fix/1787459-fix-ds-sys_cfg
Repository:
lp:~smoser/cloud-init

Recent commits

1fe8b60... by Scott Moser

stages: Fix bug causing datasource to have incorrect sys_cfg.

The Init object had a bug/odd side effect where when retrieving a distro
object it would update the datasources's sys_cfg. That was probably
intended to refresh the possibly stale config stored there. Unfortunately
what it actually did limit the config there to the 'system_info' top level
key where initially it had the whole config.

LP: #1787459

bb60f61... by Scott Moser

ds-identify: doc string cleanup.

There was a typo in the doc string at the top of ds-identify
(disable -> disabled). That is fixed here as well as adding some
better examples on content in /etc/cloud/ds-identify.cfg.

c6cfed7... by Fabian Wiesel

OpenStack: Support setting mac address on bond.

Fix a bug where setting of mac address on a bond device was
ignored when provided in OpenStack network_config.json.

LP: #1682064

84bf248... by Scott Moser

bash_completion/cloud-init: fix shell syntax error.

A syntax error creeped in with commit c7555762f3a3.

12066fc... by Scott Moser

EphemeralIPv4Network: Be more explicit when adding default route.

On OpenStack based OVH public cloud, we got DHCP response with
  fixed-address 54.36.113.86;
  option subnet-mask 255.255.255.255;
  option routers 54.36.112.1;

The router clearly is not on the subnet. So 'ip' would fail when
we tried to add the default route.
The solution here is to add an explicit route on that interface
to the router and then add the default route.

Also add 'bgpovs' to the list of 'physical' types for OpenStack
network configuration. That type is used on OVH public cloud.

LP: #1792415

4361e0e... by Scott Moser

OpenStack: support reading of newer versions of metdata.

Mark as supported for reading some newer versions of openstack metadata:
 2016-06-30 : Newton one
 2016-10-06 : Newton two
 2017-02-22 : Ocata
 2018-08-27 : Rocky

c75c582... by Scott Moser

OpenStack: fix bug causing 'latest' version to be used from network.

Cloud-init was reading a list of versions from the OpenStack metadata
service (http://169.254.169.254/openstack/) and attempt to select the
newest known supported version. The problem was that the list
of versions was not being decoded, so we were comparing a list of
bytes (found versions) to a list of strings (known versions).

LP: #1792157

c755576... by Chad Smith

user-data: jinja template to render instance-data.json in cloud-config

Allow users to provide '## template: jinja' as the first line or their
#cloud-config or custom script user-data parts. When this header exists,
the cloud-config or script will be rendered as a jinja template.

All instance metadata keys and values present in
/run/cloud-init/instance-data.json will be available as jinja variables
for the template. This means any cloud-config module or script can
reference any standardized instance data in templates and scripts.

Additionally, any standardized instance-data.json keys scoped below a
'<v#>' key will be promoted as a top-level key for ease of reference in
templates. This means that '{{ local_hostname }}' is the same as using the
latest '{{ v#.local_hostname }}'.

Since instance-data is written to /run/cloud-init/instance-data.json, make
sure it is persisted across reboots when the cached datasource opject is
reloaded.

LP: #1791781

757247f... by Chad Smith

config: disable ssh access to a configured user account

Cloud config can now disable ssh access to non-root users.

When defining the 'users' list in cloud-configuration a boolean
'ssh_redirect_user: true' can be provided to disable ssh logins for
that user. Any ssh 'public-keys' defined in cloud meta-data will be added
and disabled in .ssh/authorized_keys. Any attempts to ssh as this user
using acceptable ssh keys will be presented with a message like the
following:

Please login as the user "ubuntu" rather than the user "youruser".

d47d404... by Chad Smith

tests: print failed testname instead of docstring upon failure