1. 13 Apr, 2016 2 commits
    • Scott Moser's avatar
      chef: straighten out validation_cert and validation_key · ac50733f
      Scott Moser authored
      Now, validation_key is always a path to a file, as it is in
      chef's client.rb syntax.
      
      validation_cert is always the *content* of that file that should
      be written. However, if validation_cert is the string "system",
      then we do not write that value, but rather assume the file exists.
      
      
      LP: #1568940
      ac50733f
    • Scott Moser's avatar
      skip bridges when generating fallback networking · 96cc3852
      Scott Moser authored
      It does not make sense to consider bridges when searching for fallback
      networking.  If the system is configured with a bridge, then its probably
      for some purpose other than to get to a metadata service.
      
      Considering the bridge could make cloud-init pick the wrong device on reboot.
      
      LP: #1569974
      96cc3852
  2. 12 Apr, 2016 5 commits
  3. 11 Apr, 2016 6 commits
  4. 06 Apr, 2016 6 commits
    • Scott Moser's avatar
      Ensure that a resolve conf object is written as a string. · 822ac18b
      Scott Moser authored
      Instead of passing the raw object and expecting the write_file to work
      automatically make sure we explicitly pass the string version of it so
      that the write_file routine can correctly encode/decode it as needed.
      
      LP: #1479988
      822ac18b
    • Scott Moser's avatar
      fix tests and hopefully actually work · 578fed15
      Scott Moser authored
      578fed15
    • Scott Moser's avatar
      rh_subscription: only check subscription if configured · eb5a4dda
      Scott Moser authored
      The rh_subscription config module would attempt to connect to the RHN servers
      even when no config is provided.
      Now, instead check to make sure that valid config is provided first.
      That consists of username and password or a activation key.
      
      LP: #1536706
      eb5a4dda
    • Scott Moser's avatar
      fix adding of users when no group is specified · d75a912f
      Scott Moser authored
      revision 1179 regressed adding a user that did not have a 'groups'
      entry present in cloud-config.
      This handles that correctly, making 'add_user' able to take:
        a.) groups="group1,group2"
        b.) groups=["group1", "group2"]
        c.) groups=None
        d.) no groups parameter
      
      Additionally, if a primary group is specified it will also be created.
      
      End result is that this is functional:
       #cloud-config
       groups: ["sudo"]
       users:
         - name: sysop
           primary-group: sysop
           groups: "sudo,adm"
           shell: /bin/bash
         - name: user1
           primary-group: users
           groups: sudo
         - name: foo1
         - name: bar
           gecos: Bar
           groups: ["bargroup"]
      
      Resulting in:
       $ groups sysop
       sysop : sysop adm sudo
       $ groups user1
       user1 : users sudo
       $ groups foo1
       foo1 : foo1
       $ groups bar
       bar : bar bargroup
      
      LP: #1562918
      d75a912f
    • Scott Moser's avatar
      support adding the primary group also · 2c95e4cf
      Scott Moser authored
      2c95e4cf
    • Scott Moser's avatar
      write_files: fix decompression of content · 6a660b49
      Scott Moser authored
      When provided with gzipped data, an exception would be raised
      because of a conversion to string.
      
      This fixes the issue and adds a test for write_files.
      
      LP: #1565638
      6a660b49
  5. 04 Apr, 2016 8 commits
  6. 31 Mar, 2016 1 commit
    • Scott Moser's avatar
      fix adding of users without a group · 638191cd
      Scott Moser authored
      revision 1179 regressed adding a user that did not have a 'groups'
      entry present.  This should handle that correctly, making 'add_user'
      able to take:
        a.) groups="group1,group2"
        b.) groups=["group1", "group2"]
        c.) groups=None
        d.) no groups parameter
      
      LP: #1562918
      638191cd
  7. 29 Mar, 2016 5 commits
    • Scott Moser's avatar
      Misc fixes for VMware Support. · 210b041b
      Scott Moser authored
       - Modified the code to look for customization specification file in
         /var/run/vmware-imc/ directory instead of /tmp
       - Fixed the 'seed file' issue. There was a regression in DataSourceOVF.py
         file. Fixed it.
      210b041b
    • Scott Moser's avatar
      apply_network_config improvements · f6ad06d8
      Scott Moser authored
      3 things here:
       a.) do not raise exception, only warn when trying to apply a network
           config for a distro that does not have an implementation.
           This is important since debian/ubuntu is the only one *with* an
           implementation at the moment
       b.) apply network config in 'cloud-init --local' even if there is
           no datasource found. This means that the fallback datasource has
           to get things right.
       c.) do not write 70-persistent-net.rules
           the code was writing both 70-persistent-net.rules and
           /etc/systemd/network/50-cloud-init-*.link files
           that would just be confusing.
      f6ad06d8
    • Sankar Tanguturi's avatar
    • Scott Moser's avatar
      apply_network_config improvements · 30d8a1f2
      Scott Moser authored
      3 things here:
       a.) do not raise exception, only warn when trying to apply a network 
           config for a distro that does not have an implementation.
           This is important since debian/ubuntu is the only one *with* an 
           implementation at the moment
       b.) apply network config in 'cloud-init --local' even if there is
           no datasource found.
       c.) do not write 70-persistent-net.rules 
           the code was writing both 70-persistent-net.rules and
           /etc/systemd/network/50-cloud-init-*.link files
           that would just be confusing.
      30d8a1f2
    • Scott Moser's avatar
      improve how cloud-init-wait waits · 78c9de87
      Scott Moser authored
      Instead of sleep and check loop, use 'udevadm settle' to wait.
      since we run from a udev event, this is sufficient.
      udev settle will exit when either of
         a.) the file exists
         b.) the udev event queue has all been processed.
         c.) timeout is reached.
      
      Since cloud-init-wait is being run as a udev event, 'b' cannot
      be satisfied until it finishes. Thus, this essentially becomes a
      inotify based wait for the file /run/cloud-init/network-config-ready
      and no loops are needed.
      78c9de87
  8. 28 Mar, 2016 1 commit
    • Scott Moser's avatar
      improve how cloud-init-wait waits · bf88c6ef
      Scott Moser authored
      since we run from a udev event, this is sufficient.
      udev settle will exit when either of
       a.) the file exists
       b.) the udev event queue has all been processed.
      
      Since cloud-init-wait is being run as a udev event, 'b' cannot
      be satisfied until it finishes.  Thus, this essentially becomes a
      inotify based wait for the file /run/cloud-init/network-config-ready
      and no loops are needed.
      bf88c6ef
  9. 24 Mar, 2016 6 commits
    • Scott Moser's avatar
      support network configuration in cloud-init --local · 18bf614c
      Scott Moser authored
      this allows 'cloud-init --local' to fully run before networking comes up.
      By doing so, we can now cleanly apply networking to the new system.
      
      This adds support for reading ConfigDrive network configuration
      and also from NoCloud.  The support is only present for ubuntu/debian
      at the current time.  Other distros will follow.
      
      Also ability to specify network configuration on kernel command line
      via either ip= or network-config=<base64>.
      18bf614c
    • Scott Moser's avatar
      pyflakes · 20cc8113
      Scott Moser authored
      20cc8113
    • Scott Moser's avatar
      some final changes · 6c49afad
      Scott Moser authored
      a.) do not write systemd link files if we do not have a mac address.
          the check is updated to check for value rather than just presense
          (ie, 'mac_address': None)
      
      b.) DataSourceNoCloudNet: search in the nocloud seed dir
          this is important because NoCloud if dsmode is Net will look only
          would pass by, expecting NoCloudNet to pick it up
          but NoCloudNet would not look in /var/lib/cloud/seed/nocloud
          and thus skip it.
      
      c.) support the disabling of network configuration 
          via /var/lib/cloud/data/upgraded-network
          This is what the package upgrader is writing.
      6c49afad
    • Scott Moser's avatar
      pep8 fixes from last comment merge · e2536e75
      Scott Moser authored
      e2536e75
    • Scott Moser's avatar
      support reading network config from kernel command line · 1302e3db
      Scott Moser authored
      This adds support for suppling network configuration on the
      kernel command line in 2 ways:
       a.) kernel command line includes 'network-config=<base64>'
           value of that parameter is base64 encoded json (or yaml)
           it is taken as network config yaml.
           In order to save space on kernel command line, it can be
           base64 encoded gzipped json also.
      
       b.) ip= paired with files authored by klibc's ipconfig tool
           When network devices are brought up in the initramfs, klibc's
           ipconfig tool writes files are named /run/net-<DEVNAME>.conf.
           The best documentation available on that tool is
           /usr/share/doc/libklibc/README.ipconfig.gz.
      
      Also changes util.get_cmdline() to return the command line of
      pid 1 if it is in a container.  That is to make it consistent with
      The systemd generator, and allow passing a command line to lxd,
      as lxd does not mask /proc/cmdline.
      1302e3db
    • Scott Moser's avatar
      add comments and improve error messages · 55765072
      Scott Moser authored
      55765072