summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2016-08-23Add a module that can configure spacewalk.Joshua Harlow
Spacewalk is used by some peopel to manage connections into redhat package management systems and kickstart and various other tasks, so having a system be able to do the needed tasks on first boot to integrate with that system would be very useful (to some). See: https://fedorahosted.org/spacewalk/
2016-08-23add install option for openrcMatthew Thode
Adds an install option for for OpenRC init scripts. I've also restricted installing tests more correctly. Also, don't hardcode the path to ip (/bin/ip on gentoo).
2016-08-23Generate a dummy bond name for OpenStackScott Moser
The OpenStack network_data.json does not provide a name for bond links. This change makes it so a dummy one is generated and used instead to satisfy cloud-init which does require one. In order to write the correct link (underlying 'link' names) for the bonds, we maintain a list of info by ids so we can easily get the right device name. Also: * add a vlan test case that similarly references an id rather than name. * make bond interfaces auto LP: #1605749
2016-08-22network: fix get_interface_mac for bond slave, read_sys_net for ENOTDIRScott Moser
When using get_interface_mac, on a system with bond slaves, it would return the bond_master's address. That isn't expected, and causes problems in a caller like get_interfaces_by_mac which would then seem to find duplicate macs on the system. Additionally, in read_sys_net catch a errno.ENOTDIR error as ENOENT. Opening a path as a file that has <existing_file>/anything will will raise ENOTDIR rather than ENOENT. This handles that case in read_sys_net as a if the file did not exist.
2016-08-22azure dhclient-hook cleanupsScott Moser
This adds some function to the generator to maintain the presense of a flag file '/run/cloud-init/enabled' indicating that cloud-init is enabled. Then, only run the dhclient hooks if on Azure and cloud-init is enabled. The test for is_azure currently only checks to see that the board vendor is Microsoft, not actually that we are on azure. Running should not be harmful anywhere, other than slowing down dhclient. The value of this additional code is that then dhclient having run does not task the system with the load of cloud-init. Additionally, some changes to config are done here. * rename 'dhclient_leases' to 'dhclient_lease_file' * move that to the datasource config (datasource/Azure/dhclient_lease_file) Also, it removes the config in config/cloud.cfg that set agent_command to __builtin__. This means that by default cloud-init still needs the agent installed. The suggested follow-on improvement is to use __builtin__ if there is no walinux-agent installed.
2016-08-22Minor cleanups to atomic_helper and add unit tests.Scott Moser
Change atomic_helper.write_file to have same same signature as write_file. Add some simple unit tests for atomic_helper.
2016-08-22Fix Gentoo net config generationMatthew Thode
This gets Gentoo work on simple configs with static IPs or DHCP on physical interfaces. This gets Gentoo bootable again.
2016-08-18distros: fix get_primary_arch method use of os.unameAndrew Jorgensen
os.uname is a method, not a property.
2016-08-18Apt: add new apt configuration formatChristian Ehrhardt
This adds an improved apt configuration format that is fully backwards compatible with previous behavior. This is mostly copied from curtin's implementation. It does: * clean up and centralizes many of the top level 'apt_*' values that previously existed into a single top level 'apt'key. * support a 'source' in apt/sources/entry that has only a key * documents new features and adds tests. See the added doc/examples/cloud-config-apt.txt for more information.
2016-08-15Get Azure endpoint server from DHCP clientBrent Baude
It is more efficient and cross-distribution safe to use the hooks function from dhclient to obtain the Azure endpoint server (DHCP option 245). This is done by providing shell scritps that are called by the hooks infrastructure of both dhclient and NetworkManager. The hooks then invoke 'cloud-init dhclient-hook' that maintains json data with the dhclient options in /run/cloud-init/dhclient.hooks/<interface>.json . The azure helper then pulls the value from /run/cloud-init/dhclient.hooks/<interface>.json file(s). If that file does not exist or the value is not present, it will then fall back to the original method of scraping the dhcp client lease file.
2016-08-12DigitalOcean: use the v1.json endpointBen Howard
Per [1], DigitalOcean provides the metadata in multiple formats. The JSON document is the preferred endpoint. Changes: - Switch to the v1.json meta-data endpoint - Identify droplet identity from SMBIOS - Only poll for metadata when the instance is confirmed to be a droplet - Removal of hard-coded mirrors Additionally, centralize the gates on running 'dmidecode' on arm arches, and update tests to address. [1] https://developers.digitalocean.com/documentation/metadata/
2016-08-12MAAS: add vendor-data supportScott Moser
Add vendor-data support to maas which will behave like the openstack vendor-data does. Data returned from maas must be yaml loadable. Also update the main in DataSourceMAAS to "just work" on a maas deployed system. LP: #1612313
2016-08-11Upgrade to a configobj package new enough to workJoshua Harlow
The older versions have various issues with unicode and those versions seem to be pulled into epel so we should denote that those versions are bad and shouldn't be used by updating to a newer version that does work.
2016-08-11ConfigDrive: recognize 'tap' as a link type.Scott Moser
This just adds 'tap' to the list of types that are understood to be physical or virtual network devices. Openstack basically exposes the type of the host device through. LP: #1610784
2016-08-11NoCloud: fix bug providing network-interfaces via meta-data.Scott Moser
This fixes an issue with the NoCloud datasource where it would not recognize the 'network-interfaces' key provided in meta-data. LP: 1577982
2016-08-10Add distro tags on config modules that should have itJoshua Harlow
Some of these really won't work to well on non-supporting distros so to avoid further user pain tag this with the supported distros where they should work.
2016-08-10ChangeLog: update changelog for previous commit.Scott Moser
2016-08-10add ntp config moduleRyan Harper
Add support for installing and configuring ntp service, exposing the minimum config of servers or pools to be added. If none are defined then fallback on generating a list of pools by distro hosted at pool.ntp.org (which matches what's found in the default ntp.conf shipped in the respective distro).
2016-08-10SmartOS: more improvements for network configurationScott Moser
This improves smart os network configuration - fix the SocketClient which was previously completely broken. - adds support for configuring dns servers and dns search (based off the sdc:dns_domain). - support 'sdc:gateways' information from the datasource for configuring default routes. - add converted network information to output when module is run as a main This does not support 'sdc:routes' as described at http://eng.joyent.com/mdata/datadict.html
2016-08-10tools/read-version: update to address change in versionScott Moser
commit 48ec60ae changed over several tools to use X.Y.Z-XXX-gHASH but missed tools/read-version. The end result was that check_version failed.
2016-08-09release 0.7.7Scott Moser
Bump the version in cloudinit/version.py to be 0.7.7.
2016-08-09make-tarball: older versions of git with --format=tar.Scott Moser
Some older versions of git (Centos 6) do not have --format=tar.gz. To work around this, create a .tar file and then compress it.
2016-08-09read-version: do not attempt git-describe if no git.Scott Moser
Even if there is a .git directory, we can't use git if there is no git executable in the path. In that case just fall back to the cloud-init version.
2016-08-08Newer requests have strong type validationJoshua Harlow
Only use strings in headers, as newer requests actually do stricter validation of this, so ensure that we comply by only having string objects in header dicts.
2016-08-08For upstream snapshot versions do not modify git-describe output.Scott Moser
For upstream version directly use the output of git-describe (X.Y.Z-number.gHASH) rather than rather than changing it to (X.Y.Z+number.gHASH). The rpm version does not allow '-' in Version, so we create and use rpm_upstream_version in the rpm spec file. That is of format: X.Y.Z+number.gHASH
2016-08-05adjust signal_handler for version changes.Scott Moser
signal_handler was still using vr.version().
2016-08-05revert unintended change to ubuntu sources listScott Moser
templates/sources.list.ubuntu.tmpl was inadvertantely changed in a previous commit. Simply revert to older version.
2016-08-05drop modification of version during make-tarball, tools changes.Scott Moser
Modification of the tarball became problematic, as it meant that any tool extracting source would find the orig source tarball different. I found this unusable when trying to use 'gbp buildpackage'. Other changes here are to better support using python3 or python2 for the build. Makefile will try to call the right python version and can be told which python to use. read-version: by adding 'tiny_p' and avoiding the import of cloudinit.util, we need less dependencies to run this.
2016-08-05adjust tools and version information.Scott Moser
upstream snapshots are versioned in the format 'X.Y.Z+<distance>.g<commit>' where X.Y.Z are major, minor, and micro. Distance is number of commits since last annotated tag, and commit is the git commit. bddeb and brpm will now create and use the "upstream version" like above. Things changed here: - tools/make-tarball update cloudinit/version.py to contain the full version support --output support '--long' to always create the long format version string. - bddeb: - use quilt debian source format - use read-version and long version in changelog. - brpm: - change to use read-version and upstream long version in the spec. - flake8 changes - tools/read-version - read version from git or from cloudinit/version. - provide --json output with more nicely formed data.
2016-08-03Update build tools to work with gitLars Kellogg-Stedman
- Update HACKING.rst to include git instructions - update MANIFEST.in and .gitignore to ignore git-related things - replaced tarball generation scripts with git-based script - have the spec files correctly identify themselves as cheetah templates - make brpm work with git
2016-07-29fix pep8 errors in mcollective unit testsScott Moser
Just fix the pep8 errors added in previous commit.
2016-07-19mcollective: add tests, cleanups and bug fix when no config in /etc.Scott Moser
Things here: - restart rather than 'start' the service, to pick up a config change that we would have written. - update the config and write cert files whether or not the file existed on the system. Previously it would only write the cert files if /etc/mcollective/server.cfg already existed. - improve test coverage
2016-07-18Avoid depending on argparse in 2.7 or greaterJoshua Harlow
At least (currently) for rhel7 the argparse package does not get installed (even though rpm say it is installed by the python core package) and this causes things that mention argparse in there requirements to not believe that argparse is installed (even though it is) so to avoid this whole mess we can just avoid depending on argparse in python versions where we don't need to (since it was included in the stdlib in python 2.7+)
2016-07-15Avoid depending on argparse in 2.7 or greaterJoshua Harlow
Its not needed since its a built-in for these versions so we can just skip it for any newer rpm building in the first place. LP: #1603533
2016-07-14improvements to eni renderingScott Moser
Some improvements here, and some bug fixes. - bring curtin revno 394's to support post-up for interface aliases. - sort attributes per interface for nicer order and consistent rendering - use arrays for each 'section' rather than content += . This allows better separation of the sections and also will perform better as long strings with += are slow. - improve how 'lo' is handled. If a network state that was being rendered had an entry for 'lo', then the rendered ENI would have 2 'lo' sections. - no longer skip 'lo' sections when loading an ENI in parse_deb_config - fix inet value for subnets, don't add interface attributes to alias (LP: #1588547) Also add some tests of reading yaml and rendering ENI.
2016-07-14merge from trunkScott Moser
2016-07-14ConfigDrive: fix writing of 'injected' files and legacy networkingScott Moser
Previous commit inadvertently disabled the consumption of 'injected' files in configdrive (openstack server boot --file=/target/file=local-file) unless the datasource was in 'pass' mode. The default mode is 'net' so that was not likely to happen. Also here are: a.) some comments to apply_network_config b.) add backwards compatibility for distros that do not yet implement apply_network_config by converting the network config into ENI format and calling apply_network. This is required because prior to the previous commit, those distros would have had 'apply_network' called with the openstack provided ENI file. But after this change they will have apply_network_config called by cloudinit's main. c.) add network_state_to_eni for converting net config to eni it supports the not-actually-correct 'hwaddress' field in ENI LP: #1602373
2016-07-14flake8Scott Moser
2016-07-14add test of apply_network fallback path.Scott Moser
we could do this more simply by mocking fbsd.apply_network and checking it's inputs. but this pushes it through the whole path that the other test does.
2016-07-14Fix mcollective module with python3Scott Moser
fixes mcollective when used with python3 and also adds a unit test. LP: #1597699
2016-07-14give Sergii credit in changelogScott Moser
2016-07-14fix tox flake8Scott Moser
2016-07-14Change StringIO to BytesIO in cc_mcollective.pySergii Golovatiuk
* StringIO from six doesn't act as 'binary stream' in Python 3. This patch changes StringIO to BytesIO to have code compatible with Python 3 and Python 2. * Add try/except for IOError in case when server.cfg doesn't exists. This is necessary for unit tests or cases when server.cfg is not included to package * Add UnitTest for cc_mcollective.py LP: #1597699
2016-07-13merge from trunkScott Moser
2016-07-13merge from trunkScott Moser
2016-07-13merge from trunk.lp1602373Scott Moser
this merges in the render_hwaddress support. newly added tests still run, so hwaddress seems correctly getting in.
2016-07-13merge with trunkScott Moser
2016-07-13pass the return back up, shorten lines some.Scott Moser
2016-07-13ConfigDrive: write 'injected' files and legacy networkingScott Moser
Previous commit disabled the consumption of 'injected' files in configdrive (openstack server boot --file=/target/file=local-file) unless the datasource was in 'pass' mode. The default mode is 'net' so that would never happen. Also here are: a.) a fix for 'links_path_prefix' string from debian, to finally disable the rendering of systemd.link files (LP: #1594546) b.) some comments to apply_network_config c.) implement a backwards compatibility for for distros that do not yet implement apply_network_config by converting the network config into ENI format and calling apply_network. This is required because prior to the previous commit, those distros would have had 'apply_network' called with the openstack provided ENI file. But after this change they will have apply_network_config called by cloudinit's main. d.) a network_state_to_eni helper for converting net config to eni it supports the not-actually-correct 'hwaddress' field in ENI. LP: #1602373
2016-07-13Fix SmartOS datasource usage of dict comprehensionsJoshua Harlow