summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
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-07-22Merge pull request #9 from zdc/T2309zdc
Cloud-init: T2309: Added filter to host-name and code cleanup
2020-06-24Jenkins: T2625: migrate to build libraryChristian Poessinger
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-21Jenkins: T1870: support GitHub PullRequest buildsChristian Poessinger
2020-03-12Merge pull request #5 from zdc/T2117Christian Poessinger
Cloud-init: T2117: Added missed working directory for upload stage
2020-03-12Cloud-init: T2117: Added missed working directory for upload stagezsdc
2020-03-12Jenkins: remove dependency installation - moved to Docker containerChristian Poessinger
2020-03-11Merge pull request #4 from zdc/T2117Christian Poessinger
Cloud-init: T2117: Updated to 20.1 version
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-02-20Release 20.1 (#222)20.1Daniel Watkins
Bump the version in cloudinit/version.py to 20.1 and update ChangeLog. LP: #1863954
2020-02-20Update tooling for GitHub-based new releases (#223)Daniel Watkins
* tools/read-version: don't enforce version parity in release branch CI We have a bootstrapping problem with new releases, currently. To take the example of 20.1: the branch that bumps the version fails CI because there is no 20.1 tag for it to use in read-version. Previously, this was solved by creating a tag and pushing it to the cloud-init repo before the commit landed. However, we have GitHub branch protection enabled, so the commit that needs to be tagged is not created until the pull request lands in master. This works around this problem by introducing a very specific check: if we are performing CI for an upstream release branch, we skip the read-version checking that we know will fail. * tools/make-tarball: add --version parameter When using make-tarball as part of a CI build of a new upstream release, the version it determines is inconsistent with the version that other tools determine. Instead of encoding the logic here (as well as in Python elsewhere), we add a parameter to allow us to set it from outside the script. * packages/bddeb: handle missing version_long in new version CI If we're running in CI for a new upstream release, we have to use `version` instead of `version_long` (because we don't yet have the tag required to generate `version_long`).
2020-02-19ec2: Do not log IMDSv2 token values, instead use REDACTED (#219)Ryan Harper
Instead of logging the token values used log the headers and replace the actual values with the string 'REDACTED'. This allows users to examine cloud-init.log and see that the IMDSv2 token header is being used but avoids leaving the value used in the log file itself. LP: #1863943
2020-02-18utils: use SystemRandom when generating random password. (#204)Dimitri John Ledkov
As noticed by Seth Arnold, non-deterministic SystemRandom should be used when creating security sensitive random strings.
2020-02-13docs: mount_default_files is a list of 6 items, not 7 (#212)Chad Smith
2020-02-13azurecloud: fix issues with instances not starting (#205)Ryan Harper
The azurecloud platform did not always start instances during collect runs. This was a result of two issues. First the image class _instance method did not invoke the start() method which then allowed collect stage to attempt to run scripts without an endpoint. Second, azurecloud used the image_id as both an instance handle (which is typically vmName in azure api) as well as an image handle (for image capture). Resolve this by adding a .vm_name property to the AzureCloudInstance and reference this property in AzureCloudImage. Also in this branch - Fix error encoding user-data when value is None - Add additional logging in AzureCloud platform - Update logging format to print pathname,funcName and line number This greatly eases debugging. LP: #1861921
2020-02-10unittest: fix stderr leak in cc_set_password random unittest output. (#208)Ryan Harper
2020-02-07cc_disk_setup: add swap filesystem force flag (#207)Ryan Harper
2020-02-07import sysvinit patches from freebsd-ports tree (#161)Igor Galić
bugzilla ref: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=224361 svn rev: https://svnweb.freebsd.org/ports?view=revision&revision=457768
2020-02-07docs: fix typo (#195)Edwin Kofler
fixes typo at doc/examples/cloud-config-disk-setup.txt; Cavaut => Caveat
2020-02-03sysconfig: distro-specific config rendering for BOOTPROTO option (#162)Robert Schweikert
- Introduce the "flavor" configuration option for the sysconfig renderer this is necessary to account for differences in the handling of the BOOTPROTO setting between distributions (lp#1858808) + Thanks to Petr Pavlu for the idea - Network config clean up for sysconfig renderer + The introduction of the "flavor" renderer configuration allows us to only write values that are pertinent for the given distro - Set the DHCPv6 client mode on SUSE (lp#1800854) Co-authored-by: Chad Smith <chad.smith@canonical.com> LP: #1800854
2020-01-31cloudinit: replace "from six import X" imports (except in util.py) (#183)Daniel Watkins
2020-01-30run-container: use 'test -n' instead of 'test ! -z' (#202)Paride Legovini
Fixes shellcheck warning SC2236.
2020-01-30net/cmdline: correctly handle static ip= config (#201)Dimitri John Ledkov
It is proto 'none', not 'static' as was mistakenly implemented in initramfs-tools/cloud-init in the past, yet was never the case in the klibc ipconfig state file output. LP: #1861412
2020-01-29Replace mock library with unittest.mock (#186)Daniel Watkins
* cloudinit: replace "import mock" with "from unittest import mock" * test-requirements.txt: drop mock Co-authored-by: Chad Smith <chad.smith@canonical.com>
2020-01-29HACKING.rst: update CLA link (#199)Daniel Watkins
2020-01-29Scaleway: Fix DatasourceScaleway to avoid backtrace (#128)Louis Bouchard
Make sure network_config is created when self._network_config is unset. Co-authored-by: Scott Moser <smoser@brickies.net>
2020-01-28cloudinit/cmd/devel/net_convert.py: add missing space (#191)Daniel Watkins
2020-01-28tools/run-container: drop support for python2 (#192)Paride Legovini
Drop support for specifying an Python interpreter different from python3 from tools/run-container.
2020-01-27Print ssh key fingerprints using sha256 hash (#188)Ryan Harper
LP: #1860789
2020-01-24Make the RPM build use Python 3 (#190)Paride Legovini
* packages/brpm: switch to python3 No changes needed other than changing the shebang interpreter. * pkg-deps.json: bump the redhat build dependencies to python36 CentOS 7 (our standard target for the COPR test builds) uses python3.6 as its default python3 interpreter, so let's bump the build dependencies accordingly.
2020-01-24cc_set_password: increase random pwlength from 9 to 20 (#189)Ryan Harper
Increasing the bits of security from 52 to 115. LP: #1860795
2020-01-23.travis.yml: use correct Python version for xenial tests (#185)Daniel Watkins
2020-01-23cloudinit: remove ImportError handling for mock imports (#182)Daniel Watkins
We only run on Python 3 now, so we can unambiguously expect unittest.mock to exist.
2020-01-23Do not use fallocate in swap file creation on xfs. (#70)Eduardo Otubo
When creating a swap file on an xfs filesystem, fallocate cannot be used. Doing so results in failure of swapon and a message like: swapon: swapfile has holes The solution here is to maintain a list (currently containing only XFS) of filesystems where fallocate cannot be used. The, on those fileystems use the slower but functional 'dd' method. Signed-off-by: Eduardo Otubo <otubo@redhat.com> Co-authored-by: Adam Dobrawy <naczelnik@jawnosc.tk> Co-authored-by: Scott Moser <smoser@brickies.net> Co-authored-by: Daniel Watkins <daniel@daniel-watkins.co.uk> LP: #1781781
2020-01-23Jenkins: use new branch independent Docker pipelineChristian Poessinger
2020-01-23[Jenkinsfile] Install equivs so that mk-build-deps can work.Daniil Baturin
2020-01-23Update debian eni network configuration location, retain Ubuntu settingJanos Lenart
On Debian, ifupdown uses `source-directory /etc/network/interfaces.d` (for new installs) to include files. https://salsa.debian.org/debian/ifupdown/blob/master/debian/postinst#L23 The current filename, 50-cloud-init.cfg, does not match against the RE that is used to scan the directory for configurations (ASCII upper- and lower-case letters, ASCII digits, ASCII underscores, and ASCII minus-hyphens): https://salsa.debian.org/debian/ifupdown/blob/master/interfaces.5.pre#L122 Of course many installations use `source /etc/network/interfaces.d/*`, but not all.
2020-01-22.readthedocs.yaml: install cloud-init when building docs (#181)Daniel Watkins
This should ensure that all its dependencies are installed during doc generation. LP: #1860450
2020-01-22Introduce an RTD config file, and pin the Sphinx version to the RTD default ↵Daniel Watkins
(#180) doc-requirements.txt: pin Sphinx at version used by RTD Introduce a configuration file containing our existing web-based configuration.
2020-01-21Drop most of the remaining use of six (#179)Daniel Watkins
2020-01-21Start removing dependency on six (#178)Daniel Watkins
* url_helper: drop six * url_helper: sort imports * log: drop six * log: sort imports * handlers/__init__: drop six * handlers/__init__: sort imports * user_data: drop six * user_data: sort imports * sources/__init__: drop six * sources/__init__: sort imports * DataSourceOVF: drop six * DataSourceOVF: sort imports * sources/helpers/openstack: drop six * sources/helpers/openstack: sort imports * mergers/m_str: drop six This also allowed simplification of the logic, as we will never encounter a non-string text type. * type_utils: drop six * mergers/m_dict: drop six * mergers/m_list: drop six * cmd/query: drop six * mergers/__init__: drop six * net/cmdline: drop six * reporting/handlers: drop six * reporting/handlers: sort imports
2020-01-20Add Rootbox & HyperOne to list of cloud in README (#176)Adam Dobrawy
2020-01-16docs: add proposed SRU testing procedure (#167)Chad Smith
Co-Authored-By: Daniel Watkins <daniel@daniel-watkins.co.uk>
2020-01-16util: rename get_architecture to get_dpkg_architecture (#173)Daniel Watkins
This makes it clearer that we should only use this in code paths that will definitely have dpkg available to them. - Rename get_architecture -> get_dpkg_architecture - Add docstring to get_dpkg_architecture
2020-01-16Ensure util.get_architecture() runs only once (#172)Ryan Harper
* Ensure util.get_architecture() runs only once util.get_architecture() recently was wrapped using python3's lru_cache() which will cache the result so we only invoke 'dpkg --print-architecture' once. In practice, cloud-init.log will show multiple invocations of the command. The source of this was that the debian Distro object implements the get_primary_arch() with this command, but it was not calling it from util, but issuing a util.subp() directly. This branch also updates cc_apt_configure methods to fetch the arch value from the distro class, and then ensure that the methods apt_configure calls pass the arch value around. * utils: remove lsb_release and get_architecture wrappers The original lsb_release wrapper was used to prevent polluting the single value we cached, however lru_cache() already handles this case by using args, kwargs values to cache different calls to the method. * rename_apt_list: use all positional parameters
2020-01-14Only use gpart if it is the BSD gpart (#131)Conrad Hoffmann
Currently, cloud-init will happily try to run `gpart` on Linux even though on most distributions this a different tool [1]. Extend the availability check to make sure the `gpart` present is really the BSD variant, to avoid accidental execution. Also add a pointer to the docs, so that people do not try to install gpart on Linux in the expectation it will work with this module. [1] https://github.com/baruch/gpart
2020-01-14freebsd: remove superflu exception mapping (#166)Gonéri Le Bouder
We often map exception when is not necessary. This commit clean up the FreeBSD distro file.
2020-01-10ssh_auth_key_fingerprints_disable test: fix capitalization (#165)Paride Legovini
Adapt the test to the new capitalization introduced in 8116493950e7c47af0ce66fc1bb5d799ce5e477a.
2020-01-09util: move uptime's else branch into its own boottime function (#53)Igor Galić
Also fix bugs: - pass binary instead of string to sysctlbyname(), and - unpack the "return value" in a struct, rather than in single integer. LP: #1853160 Co-Authored-By: Ryan Harper <ryan.harper@canonical.com>