Merge staging-next into staging
This commit is contained in:
@@ -8,9 +8,14 @@
|
||||
# Make sure that every package you depend on here is already listed as
|
||||
# a channel blocker for both the full-sized and small channels.
|
||||
# Otherwise, we risk breaking user deploys in released channels.
|
||||
#
|
||||
# Also note: OpenStack's metadata service for its instances aims to be
|
||||
# compatible with the EC2 IMDS. Where possible, try to keep the set of
|
||||
# fetched metadata in sync with ./openstack-metadata-fetcher.nix .
|
||||
''
|
||||
metaDir=${targetRoot}etc/ec2-metadata
|
||||
mkdir -m 0755 -p "$metaDir"
|
||||
rm -f "$metaDir/*"
|
||||
|
||||
get_imds_token() {
|
||||
# retry-delay of 1 selected to give the system a second to get going,
|
||||
@@ -61,19 +66,12 @@
|
||||
|
||||
echo "getting EC2 instance metadata..."
|
||||
|
||||
if ! [ -e "$metaDir/ami-manifest-path" ]; then
|
||||
wget ${wgetExtraOptions} --header "X-aws-ec2-metadata-token: $IMDS_TOKEN" -O "$metaDir/ami-manifest-path" http://169.254.169.254/1.0/meta-data/ami-manifest-path
|
||||
fi
|
||||
wget_imds() {
|
||||
wget ${wgetExtraOptions} --header "X-aws-ec2-metadata-token: $IMDS_TOKEN" "$@";
|
||||
}
|
||||
|
||||
if ! [ -e "$metaDir/user-data" ]; then
|
||||
wget ${wgetExtraOptions} --header "X-aws-ec2-metadata-token: $IMDS_TOKEN" -O "$metaDir/user-data" http://169.254.169.254/1.0/user-data && chmod 600 "$metaDir/user-data"
|
||||
fi
|
||||
|
||||
if ! [ -e "$metaDir/hostname" ]; then
|
||||
wget ${wgetExtraOptions} --header "X-aws-ec2-metadata-token: $IMDS_TOKEN" -O "$metaDir/hostname" http://169.254.169.254/1.0/meta-data/hostname
|
||||
fi
|
||||
|
||||
if ! [ -e "$metaDir/public-keys-0-openssh-key" ]; then
|
||||
wget ${wgetExtraOptions} --header "X-aws-ec2-metadata-token: $IMDS_TOKEN" -O "$metaDir/public-keys-0-openssh-key" http://169.254.169.254/1.0/meta-data/public-keys/0/openssh-key
|
||||
fi
|
||||
wget_imds -O "$metaDir/ami-manifest-path" http://169.254.169.254/1.0/meta-data/ami-manifest-path
|
||||
wget_imds -O "$metaDir/user-data" http://169.254.169.254/1.0/user-data && chmod 600 "$metaDir/user-data"
|
||||
wget_imds -O "$metaDir/hostname" http://169.254.169.254/1.0/meta-data/hostname
|
||||
wget_imds -O "$metaDir/public-keys-0-openssh-key" http://169.254.169.254/1.0/meta-data/public-keys/0/openssh-key
|
||||
''
|
||||
|
||||
@@ -614,17 +614,17 @@ in
|
||||
'';
|
||||
};
|
||||
|
||||
timeoutStartSec = mkOption {
|
||||
type = types.str;
|
||||
default = "1min";
|
||||
description = ''
|
||||
Time for the container to start. In case of a timeout,
|
||||
the container processes get killed.
|
||||
See <citerefentry><refentrytitle>systemd.time</refentrytitle>
|
||||
<manvolnum>7</manvolnum></citerefentry>
|
||||
for more information about the format.
|
||||
'';
|
||||
};
|
||||
timeoutStartSec = mkOption {
|
||||
type = types.str;
|
||||
default = "1min";
|
||||
description = ''
|
||||
Time for the container to start. In case of a timeout,
|
||||
the container processes get killed.
|
||||
See <citerefentry><refentrytitle>systemd.time</refentrytitle>
|
||||
<manvolnum>7</manvolnum></citerefentry>
|
||||
for more information about the format.
|
||||
'';
|
||||
};
|
||||
|
||||
bindMounts = mkOption {
|
||||
type = with types; attrsOf (submodule bindMountOpts);
|
||||
|
||||
@@ -1,23 +1,21 @@
|
||||
{ targetRoot, wgetExtraOptions }:
|
||||
|
||||
# OpenStack's metadata service aims to be EC2-compatible. Where
|
||||
# possible, try to keep the set of fetched metadata in sync with
|
||||
# ./ec2-metadata-fetcher.nix .
|
||||
''
|
||||
metaDir=${targetRoot}etc/ec2-metadata
|
||||
mkdir -m 0755 -p "$metaDir"
|
||||
rm -f "$metaDir/*"
|
||||
|
||||
echo "getting EC2 instance metadata..."
|
||||
echo "getting instance metadata..."
|
||||
|
||||
if ! [ -e "$metaDir/ami-manifest-path" ]; then
|
||||
wget ${wgetExtraOptions} -O "$metaDir/ami-manifest-path" http://169.254.169.254/1.0/meta-data/ami-manifest-path
|
||||
fi
|
||||
wget_imds() {
|
||||
wget ${wgetExtraOptions} "$@"
|
||||
}
|
||||
|
||||
if ! [ -e "$metaDir/user-data" ]; then
|
||||
wget ${wgetExtraOptions} -O "$metaDir/user-data" http://169.254.169.254/1.0/user-data && chmod 600 "$metaDir/user-data"
|
||||
fi
|
||||
|
||||
if ! [ -e "$metaDir/hostname" ]; then
|
||||
wget ${wgetExtraOptions} -O "$metaDir/hostname" http://169.254.169.254/1.0/meta-data/hostname
|
||||
fi
|
||||
|
||||
if ! [ -e "$metaDir/public-keys-0-openssh-key" ]; then
|
||||
wget ${wgetExtraOptions} -O "$metaDir/public-keys-0-openssh-key" http://169.254.169.254/1.0/meta-data/public-keys/0/openssh-key
|
||||
fi
|
||||
wget_imds -O "$metaDir/ami-manifest-path" http://169.254.169.254/1.0/meta-data/ami-manifest-path
|
||||
wget_imds -O "$metaDir/user-data" http://169.254.169.254/1.0/user-data && chmod 600 "$metaDir/user-data"
|
||||
wget_imds -O "$metaDir/hostname" http://169.254.169.254/1.0/meta-data/hostname
|
||||
wget_imds -O "$metaDir/public-keys-0-openssh-key" http://169.254.169.254/1.0/meta-data/public-keys/0/openssh-key
|
||||
''
|
||||
|
||||
Reference in New Issue
Block a user