1. 28 Oct, 2016 1 commit
  2. 26 Oct, 2016 1 commit
  3. 25 Oct, 2016 1 commit
    • Scott Moser's avatar
      disk-config: udev settle after partitioning in gpt format. · 29348af1
      Scott Moser authored
      The function exec_mkpart_gpt was simply not waiting for udev events
      to flush after calling sgdisk.  The corresponding function
      exec_mkpart_mbr already did.
      This should fix a transient failure where mkfs would fail with
      'not a block device'.
      LP: #1626243
  4. 24 Oct, 2016 1 commit
    • Scott Moser's avatar
      unittests: do not read system /etc/cloud/cloud.cfg.d · 1e55f412
      Scott Moser authored
      Many of the unit tests in test_data would inadvertantly read the
      system's /etc/cloud/cloud.cfg and /etc/cloud/cloud.cfg.d.
      This was first noticed on a system deployed by MAAS, where
      files in /etc/cloud/cloud.cfg.d/ are root read-only.
      This changes those tests to actually make use of
      FilesystemMockingTestCase functionality and adds 'reRoot()' to that
      class which is easier to use for at least this use case.
      LP: #1635350
  5. 20 Oct, 2016 5 commits
    • Wesley Wiedenmeier's avatar
      Add documentation for logging features. · f6ae1f9c
      Wesley Wiedenmeier authored
      Update the summary of rsyslog module and add logging.rst to docs.
    • Ryan Harper's avatar
      Add support for snap create-user on Ubuntu Core images. · d8534561
      Ryan Harper authored
      Ubuntu Core images use the `snap create-user` to add users to an
      Ubuntu Core system. Add support for creating snap users by adding
      a key to the users dictionary.
          - name: bob
            snapuser: bob@bobcom.io
      Or via the 'snappy' dictionary:
          email: bob@bobcom.io
      Users may also create a snap user without contacting the SSO by
      providing a 'system-user' assertion by importing them into snapd.
      Additionally, Ubuntu Core systems have a read-only /etc/passwd such that
      the normal useradd/groupadd commands do not function without an additional
      flag, '--extrausers', which redirects the pwd to /var/lib/extrausers.
      Move the system_is_snappy() check from cc_snappy module to util for
      re-use and then update the Distro class to append '--extrausers' if
      the system is Ubuntu Core.
    • Jim Gorz's avatar
      Fix sshd restarts for rhel distros. · ba0adb9b
      Jim Gorz authored
      Set the default value for 'ssh_svcname' in rhel distros.
      This means that it no longer needs to be set in system_info config.
    • Scott Moser's avatar
      OpenNebula: replace 'ip' parsing with cloudinit.net usage. · 9972d246
      Scott Moser authored
      Replace the parsing of 'ip' to get a link and mac address list
      in OpenNebula's datasource with usage of cloudinit.net.
      This makes test cases there not depend on 'ip' availability
      and also uses common code.
    • Scott Moser's avatar
      Fix python2.6 things found running in centos 6. · e8730078
      Scott Moser authored
      This gets the tests running in centos 6.
        * ProcessExecutionError: remove setting of .message
          Nothing in cloud-init seems to use .message anywhere, so
          it does not seem necessary.
          The reason to change it is that on 2.6 it spits out:
          cloudinit/util.py:286: DeprecationWarning: BaseException.message
       * tox.ini: add a centos6 environment
         the tox versions listed here replicate a centos6 install with
         packages from EPEL.
         You will still need a python2.6 to run this env so we do not
         enable it by default.
  6. 19 Oct, 2016 1 commit
    • Joshua Harlow's avatar
      Move user/group functions to new ug_util file · f0747c4b
      Joshua Harlow authored
      The amount of code to do user and group normalization
      and extraction deserves its own file so move the code
      that does this to a new file and update references to the
      old location.
      This removes some of the funkyness done in config modules
      to avoid namespace and attribute clashes as well.
  7. 18 Oct, 2016 2 commits
    • Scott Moser's avatar
      DigitalOcean: enable usage of data source by default. · 7ae20116
      Scott Moser authored
      Just add DigitalOcean to the list of datasources that are used
      if there is no 'datasource_list' provided in config.
    • Matthew Thode's avatar
      update Gentoo initscripts to run in the correct order · e772f52b
      Matthew Thode authored
      cloud-init-local needs to be run before net (and in the boot runlevel)
      as it sets up networking config and adds it to the default runlevel.
      cloud-init-local needs to be run in the boot runlevel because it
      modifies services in the default runlevel.  When a runlevel is started
      it is cached, so modifications that happen to the current runlevel while
      you are in it are not acted upon.
      cloud-init needs to run after net, it does not need net because we still
      want it to set up other things if it can.
  8. 07 Oct, 2016 3 commits
    • Scott Moser's avatar
      MAAS: improve the main of datasource to look at kernel cmdline config. · 808edb12
      Scott Moser authored
      This just looks in one other maas related path for a config file.
      The file '91_kernel_cmdline_url' is written by cloud-init when it
      gets a cloud-config-url parameter.
      Also now we read the config even if a url is specified to potentially
      fill in credentials.
    • Scott Moser's avatar
      tests: silence the Cheetah UserWarning about NameMapper C version. · c4aeba3f
      Scott Moser authored
      This silences a warning made by Cheetah in pip installed environments:
        UserWarning: You don't have the C version of NameMapper installed!
        I'm disabling Cheetah's useStackFrames option ...
      The reason for the monkey patching is that the warning goes to stderr
      during nose and breaks up its expected output.  The side affect of it
      is that tests would run with Cheetah's 'useStackFrames'
      enabled which is "painfully slow with the Python version of NameMapper".
    • Daniel Watkins's avatar
      systemd: Run cloud-init.service Before dbus.socket not dbus.target · 6e45ffb2
      Daniel Watkins authored
      The change reported to fix bug 1629797 was incorrect.  It added:
      and its commit message referenced dbus.service.
      dbus.target does not exist, and dbus.service would not solve the
      problem.  The change did not fix the problem nor actually make any
      The fix here is just to use Before=dbus.socket.
      LP: #1629797
  9. 04 Oct, 2016 2 commits
    • Scott Moser's avatar
      systemd: run cloud-init.service Before dbus.service · 94fd35ee
      Scott Moser authored
      This is the best work around we have for an issue seen when dns is used
      during cloud-init.service on a system that is configured in nsswitch
      to use systemd-resolved.  The problem is that cloud-init.service was
      blocking basic.target, and dbus would not be available until after
      cloud-init.service finished.
      LP: #1629797
    • Ryan Harper's avatar
      unittests: fix use of mock 2.0 'assert_called' when running make check · 760a4f18
      Ryan Harper authored
      Some of the new DigitalOcean unittests were written to use 'assert_called',
      which is only available in mock versions 2.0.  Because of this, the failure
      would only occur in releases less than yakkety and not in 'tox'.
      Add a 'xenial' entry to tox.ini with versions from xenial.
  10. 30 Sep, 2016 1 commit
    • Wesley Wiedenmeier's avatar
      Improve module documentation and doc cleanup. · 1071b994
      Wesley Wiedenmeier authored
      This adds lots of config module documentation in a standard format.
      It will greatly improve the content at readthedocs.
       * Add a 'doc' env to tox.ini
       * Changed default highlight language for sphinx conf from python to yaml
         most examples in documentation are yaml configs
       * Updated datasource examples to highlight sh code properly
  11. 29 Sep, 2016 2 commits
    • Stéphane Graber's avatar
      lxd: Update network config for LXD 2.3 · 02f6c4bb
      Stéphane Graber authored
      Prior to LXD 2.3, the bridge configuration was done through distro
      packaging.  Thus, lxd module interacted with debconf.
      With 2.3 and higher, this is now done inside LXD itself, so we
      need to use "lxc network" there.
      For now, this perfectly matches what we had before with debconf and
      doesn't cover any of the new options. We can always add those later.
      A set of tests similar to what we had for debconf has been added to make
      sure things look good.
      This is tested in Yakkety container running LXD 2.3 and all options seem
      to be passed through as expected, giving me the bridge I defined.
      Signed-off-by: 's avatarStéphane Graber <stgraber@ubuntu.com>
    • Ben Howard's avatar
      DigitalOcean: use meta-data for network configruation · 9f83bb8e
      Ben Howard authored
      On DigitalOcean, Network information is provided via Meta-data.
      It changes the datasource to be a local datasource, meaning it
      will run before fallback networking is configured.
      The advantage of that is that before networking is configured it
      can bring up a network device with ipv4 link-local and hit the
      metadata service that lives at to find its networking
      configuration.  It then takes down the link local address and lets
      cloud-init configure networking.
      The configuring of a network device to go looking for a metadata
      service is gated by a check of data in the smbios.  This guarantees
      that the code will not run on another system.
  12. 28 Sep, 2016 1 commit
  13. 22 Sep, 2016 1 commit
    • Robert Schweikert's avatar
      Decode unicode types in decode_binary · 0439d8a1
      Robert Schweikert authored
      The test in decode_binary for six.text_type was incorrect as that includes
      unicode type in Python 2 which should actually be decoded.
      When the type is string_types we now properly check only for basestring and
      str in Python 2 and Python 3 respectively and return the given blob without
      making an attempt to decode.
  14. 21 Sep, 2016 4 commits
    • Joshua Harlow's avatar
    • Paul Meyer's avatar
      Allow ephemeral drive to be unpartitioned · 30d0adb7
      Paul Meyer authored
      If device has no partition table, the first line of output from `sgdisk
      -p <device>` will be "Creating new GPT entries.", instead of something
      like "Disk /dev/sdb: 266338304 sectors, 127.0 GiB".
      Also, protect against localized output by adjusting subp calls that
      parse sgdisk output to set LANG=C.
    • Scott Moser's avatar
      subp: add 'update_env' argument · 40a400e4
      Scott Moser authored
      In order for a caller to use 'env' argument of subp, they
      will realistically do:
        env = os.environ.copy()
        env['FOO'] = 'BZR'
        subp(cmd, env=env)
      This shortens that to be:
        subp(cmd, update_env={'FOO': 'BZR'})
      Add tests, and update growpart tests to use mock when playing with
    • LaMont Jones's avatar
      net: support reading ipv6 dhcp config from initramfs · 970dbd13
      LaMont Jones authored
      This adds support for understanding 'dhcp6' as a protocol
      that can be written into /run/net-IFACE.cfg files by the initramfs.
      The end result is supporting ipv6 dhcp from initramfs boot
      all the way into iscsi root.
      LP: #1621615, #1621507
  15. 20 Sep, 2016 1 commit
    • Scott Moser's avatar
      Adjust mounts and disk configuration for systemd. · 80f5ec4b
      Scott Moser authored
      The end result of all of these changes is to get mounts managed by
      cloud-init to occur only after cloud-init.service is done.  We need to do
      that so that filesystems that are set up by cloud-init (in disk_setup)
      do not get mounted by stale entries in /etc/fstab before
      the setup occurs.
      This can occur in 2 ways:
       a.) new instance with old /etc/fstab
       b.) same instance where disk needs adjusting (Azure resize will re-format
           the ephemeral disk).
      The list of changes here is:
       - move mounts and disk_setup module to cloud-init.service rather
         than config.  cloud-init.service runs earlier in boot so it
         can get those mount points done earlier.
       - on systemd add 'x-systemd.requires=cloud-init.service' to fstab options
       - cloud-init-local.service: add Before=basic.target
       - cloud-init.service:
         - extend After, Before, and Wants to multiple lines rather than one
           long line.
         - sort consistently with cloud-init-local.service
         - add DefaultDependencies=no
         - add Before=default.target
         - add Conflicts=shutdown.target
      LP: #1611074
  16. 15 Sep, 2016 2 commits
    • Robert Schweikert's avatar
      dmidecode: run dmidecode only on i?86 or x86_64 arch. · f94b16ce
      Robert Schweikert authored
      Dmidecode is not going to run successfully on anything other than an
      x86 or x86_64, just avoid running it anywhere else.
    • Scott Moser's avatar
      systemd: put cloud-init.target After multi-user.target · 3705bb59
      Scott Moser authored
      When we moved cloud-final.service to run After multi-user.target it
      caused a dependency loop (as cloud-init.target was still implied to be
      Before multi-user.target).
      journalctl would either show:
        cloud-init.target: Breaking ordering cycle by deleting job
        multi-user.target: Breaking ordering cycle by deleting job
      The fix here is to clearly state that cloud-init.target is also
        After multi-user.target
      LP: #1623868
  17. 12 Sep, 2016 4 commits
    • Scott Moser's avatar
      release 0.7.8 · c099719a
      Scott Moser authored
      Bump the version in cloudinit/version.py to be 0.7.8.
    • Jon Grimm's avatar
      Allow link type of null in network_data.json · 65ace7b3
      Jon Grimm authored
      Treat null type as yet another physical type, seen in real-world
      openstack cloud.
      Also, support the case where network_data.json provides mac addresses
      in upper case.  Rackspace public cloud currently does that.
      LP: #1621968
    • Scott Moser's avatar
      DataSourceOVF: fix user-data as base64 with python3 · 2aa9b1dd
      Scott Moser authored
      When user-data was provided in the ovf environment python3 would call
      base64.decodestring() with a string rather than bytes and an exception
      would occur.
      This fixes the broken path and adds unit test.  Also changes to
      return None rather than empty string when there is no user-data and
      when there is user-data return that as bytes instead of string.
      LP: #1619394
    • Scott Moser's avatar
      remove obsolete .bzrignore · 97b5b40e
      Scott Moser authored
  18. 09 Sep, 2016 1 commit
    • Scott Moser's avatar
      systemd: Better support package and upgrade. · 34a26f7f
      Scott Moser authored
      In systemd, package installation before the system is fully booted
      (systemctl is-system-running ==  starting) may result in the package not
      being started.  Upgrade (package_upgrade: true) can also cause failure if
      that is done during systemd boot.
      The solution here is:
       a.) move config modules that do or may do package installation to
           'final_modules'. That list is:
           - snappy
           - package-update-upgrade-install
           - fan
           - landscape
           - lxd
           - puppet
           - chef
           - salt-minion
           - mcollective
       b.) move cloud-final.service to run as 'Type=idle'
      LP: #1576692, #1621336
  19. 08 Sep, 2016 2 commits
  20. 02 Sep, 2016 1 commit
  21. 01 Sep, 2016 1 commit
  22. 31 Aug, 2016 1 commit
  23. 26 Aug, 2016 1 commit