summaryrefslogtreecommitdiff
path: root/cloudinit/config/cc_vyos.py
AgeCommit message (Collapse)Author
2020-09-16cc_vyos: T2117: OVF datasource cleanupzsdc
The `DataSourceOVF.py` file was cleaned up from VyOS-specific changes. Also was changed related functionality in the `cc_vyos.py`: - in addition to limited metadata provided by Cloud-init, the function `get_properties` from the `DataSourceOVF.py` used to get unfiltered values from an OVF environment; - `set_tag` for the `interfaces ethernet` node was moved from multiple places to the `set_ipaddress` function; - multiple checks for 'null' value in OVF were replaced with the iteration via all values and replacing `null` with `None`. This allows using easier logic during values check; - simplified conversion of the values from OVF to an IP address; - added logging for all actions in the `set_config_ovf` function.
2020-09-09cc_vyos: T2117: The source for v1 metadata changed to instance-data.jsonzsdc
Since the `instance-data.json` file is the only way offered by Cloud-Init to get formatted metadata, using it instead of `_get_standardized_metadata()` function is safer and must be compatible with all versions.
2020-09-08cc_vyos: T2726: User creating optimizations and small fixeszsdc
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.
2020-07-30cc_vyos: T2403: Resolved IP addresses configuration conflictszsdc
This commit fixes a situation when it is necessary to configure more than one IP address on an interface. Previously only the latest one address survived. With this fix, it is possible to add all compatible addresses.
2020-07-23cc_vyos: T2403: Network configuration and module optimizationzsdc
Changes: - added logging messages - optimized structure - added back network configuration version 1 support (new implementation) - fixed static gateway settings in network configuration version 2
2020-04-17Cloud-init: T2309: Added filter to host-name and code cleanupzsdc
Since not all data-sources filter hostname in Meta-Data, we need to be sure that the value received from Meta-Data can be applied to the system. The new filter cut all prohibited symbols and takes only that part of the filtered result, which can be used as a hostname. Additionally, the source was cleaned where it is possible, according to linter recommendations.
2020-03-11Cloud-init: T2117: Updated to 20.1zsdc
- Merge 20.1 version from the Canonical repository - Removed unneeded changes in datasources (now only OVF datasource is not equal to upstream's version) - Adapted cc_vyos module to new Cloud-init version - Changed Jenkinsfile to use build scripts, provided by upstream
2020-01-02T1934: Change default hostname when deploy from OVA without params.Kim Hagen
2019-12-03option to enable http api optionsKim Hagen
2019-11-12add the ability to put the api keyKim Hagen
2019-10-07do not set dhcp after vmware configKim Hagen
2019-09-24set correct referenceKim Hagen
2019-08-16update vyos config module to include network configUnicronNL
2019-03-12do not change hostname if it is emptyKim Hagen
2019-03-12account for empty ssk keys and passwordsKim Hagen
2019-02-28use ovf labels to set vyos configKim Hagen
2018-10-23Use dhcp for google cloud sourceKim Hagen
Rework check to see which part of ssh key is which
2018-10-22set user tagKim
2018-10-21add vyos cloud-init config moduleKim Hagen