Age | Commit message (Collapse) | Author |
|
we map 'hostname' to 'local-hostname'
so that the modules work correctly with
the cfgdrive style of data.
|
|
This fixes (tested) bug 978127. The server was actually returning a 401
not a 403. As such, the fix here was insufficient. This will now take
either of those 2 error codes. I've also tested it by changing the clock
in the cloud-init upstart job with a stanza like below, and verifying
that we do see the problem and then it resolve itself:
pre-start script
offset="10 minutes ago"
past=$(date -R --date "$offset")
date --set "$past" &&
echo ===== "set date to $past [$offset]" ===== ||
echo ===== "failed to set date to $past [$offset]" ====
end script
LP: #978127
|
|
Rework the rest of the locations that used the previous 'user' and make
those locations go through the new distros functions to select the default
user or the user list (depending on usage).
Adjust the tests to check the new 'default' field that signifies the
default user + test the new method to extract just the default user from a
normalized user dictionary.
"default" user is now marked in the user dict and get_default_user uses
that.
|
|
|
|
|
|
located and warn when it is not found + only
run the shell command when actual contents
exist to run.
|
|
imported without being renamed due to
previous usage of the attribute 'distros'
|
|
|
|
the previous 'user' and make those locations
go through the new distros functions to select
the default user or the user list (depending on usage).
Adjust the tests to check the new 'default' field
that signifies the default user + test the new method
to extract just the default user from a normalized
user dictionary.
|
|
|
|
In 0.7.0 we started using yaml.safe_load to load data rather than
yaml.load. Some producers (namely, ubuntu MAAS created) have produced
cloud-config data in the past that included python unicode types.
This creates a specialized safe_loader that is basically safe_load +
support for python unicode.
|
|
|
|
before we start iterating over it (it could
be sent is as none).
|
|
|
|
Packages on debian/ubuntu should start on installation. As a result, if we
want to get config changes we've inserted to be read, we need to restart.
Note one interesting thing here.
upstart considers 'restart' as "restart only if currently running", while
'service' considers restart to be "stop if running, then start". So the use of
'service' here is important, rather than just 'restart'
|
|
The primary utility here is normalize_user_groups, which would
be called by config modules to get a list of users or groups.
This centralizes what was copied code into this one location.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rpm builder utility.
|
|
user normalization function instead of
the previous 'user' extraction.
|
|
|
|
|
|
|
|
device name, throw an error since rhel can not currently
handle this case.
|
|
|
|
and produce a user and group list. Clean this up to
be simpler as well as handle the old 'user' case when
it exists in configuration.
|
|
Rework the rhel sysconfig writing/updating so that it goes through a
single function which helps ensure correctness. Also write to
/etc/sysconfig/network when we have written out devices to ensure that
networking is on.
|
|
|
|
|
|
|
|
Fix the ifup so that if a list of devices is provided then each interface is
brought up individually instead of using the '--all' which isn't on rhel.
The default debian behavior will be to use this still though as it overrides
the new bring up interfaces function for this case.
|
|
In the event of a 403 (Unauthorized) in oauth, try set a 'oauth_clockskew'
variable. In future headers, use a time created by 'time.time() +
self.oauth_clockskew'. The idea here is that if the local time is bad (or even
if the server time is bad) we will essentially use something that should be
similar to the remote clock.
This fixes LP: #978127.
LP: #978127
|
|
|
|
|
|
In the previous commit to htis file I had wrapped the writing of
'BEGIN SSH HOST KEY KEYS' to go through logger.
This would cause the keys to be prefixed with 'ec2:' which, previously they
were not. That would break existing users *and* make it more difficult to
consume that data, which was explicitly added to be easy to consume.
|
|
|
|
This changes all output write-ssh-key-fingerprints to go to its
stdout by redirecting stderr to stdout.
The reason for this is that cc_keys_to_console.py was swallowing stderr
and not replaying it to /dev/console.
Ideally, we'd have a way in 'util.subp' to do effectively the same thing
as we're doing here in the shell script.
LP: #1055688
|
|
sudo complains about the permissions on the sudoers config file that cloud-init
writes:
[ec2-user@ip-10-166-110-107 ~]$ sudo -s sudo:
/etc/sudoers.d/90-cloud-init-users is mode 0644, should be 0440
This patch makes the file's permissions match sudo's recommendation.
Note: ubuntu's sudo doesn't seem to complain about 644, but 440 is probably
better.
|
|
since it has little dependence on the distros
class itself. Readjust the using code to use
this new module level function instead.
|
|
|
|
|
|
separated list so that its types match more of
what the group list can be.
|