summaryrefslogtreecommitdiff
path: root/cloudinit/event.py
diff options
context:
space:
mode:
authorzsdc <taras@vyos.io>2020-09-08 16:28:54 +0300
committerzsdc <taras@vyos.io>2020-09-08 17:12:41 +0300
commit92f43f79574bffb8b5731a09aea6def3ed9551dc (patch)
tree95495af08e0f2dd3164a2e413364ed536b52ccc0 /cloudinit/event.py
parent6dc8bb5cda13f1bf1ed73fba653fdc39f58c8a58 (diff)
downloadvyos-cloud-init-92f43f79574bffb8b5731a09aea6def3ed9551dc.tar.gz
vyos-cloud-init-92f43f79574bffb8b5731a09aea6def3ed9551dc.zip
cc_vyos: T2726: User creating optimizations and small fixes
This commit is addressed to solve some old issues with creating users in the system and simplify the parts of the module related to this. Also, some small fixes. - removed Python modules os, cloudinit.stages, cloudinit.util dependencies. Related functionality replaced by other modules (see below) - detection of hashed passwords was simplified, made 100% compatible with the rest Cloud-init documentation and recommendations. Also, it was moved from the `handle` function to the `set_pass_login` to reduce the code size and make it more clear - replaced sequenced SSH public keys enumeration for keys without comments to UUID-based to simplify the code and make the logic easier - replaced home-growed SSH key parser/checker to the native cloudinit.ssh_util.AuthKeyLineParser() - added support for SSH key options configuration - added possibility to use all key types supported by VyOS: 'ssh-dss', 'ssh-rsa', 'ecdsa-sha2-nistp256', 'ecdsa-sha2-nistp384', 'ssh-ed25519', 'ecdsa-sha2-nistp521' - fixed typo in configuration for `distance`/`metric` option in set_config_interfaces_v1() - added the stable format of the Meta-Data: `v1`. It must be absolutely equal for any datasource, therefore it is always better to use data from it than from any other sources if this is possible - added User-Data and Vendor-Data logging. Currently not used for anything, but required for a proper debugging - replaced datasource source from the unstable metadata field to the stable `cloud.datasource.dsname` - replaced Network-Config source from `init._find_networking_config()` to the more correct `cloud.datasource.network_config` - replaced hostname source from the `util.get_hostname_fqdn()` to `cloud.get_hostname()`, what is actually the same, to drop `util` dependency - the part specific for Azure cloud united with the main part of users creating code, since there is actually no platform-specific functions and everything was moved to the common places, what improved compatibility with the similar environments - rewritten users creating logic **Important information about users and credentials** In the Cloud-init exists multiple ways of how to configure authentication: public keys in Meta-Data, default user name and options in the main config file, several config modules (`cc_set_passwords`, `cc_ssh`, `cc_users_groups`) configurable via `#cloud-config`, maybe something more. Cloud-Init solves this by merging information from most of these sources to a single users' database, but information can overwrite each other. Very simplified logic description: if something is configured in a User-Data (`#cloud-config`), then most likely default values like username `vyos`, or SSH public keys from Meta-Data will be dropped by Cloud-Init. This implementation should apply public SSH keys and passwords without associated username to the default user (usually `vyos`, but some platforms may allow using your own). If you are creating any additional user, a default one will not be created and common authentication methods will not be applied, so you need to provide the complete authentication details for it.
Diffstat (limited to 'cloudinit/event.py')
0 files changed, 0 insertions, 0 deletions