* Don't get the hostname from EC2 if one has been set explicitly.

svn path=/nixos/trunk/; revision=30200
This commit is contained in:
Eelco Dolstra 2011-11-03 01:29:40 +00:00
parent fe566d84ae
commit ba1a7188c1

View file

@ -4,6 +4,8 @@
{ config, pkgs, ... }:
with pkgs.lib;
{
jobs.fetchEC2Data =
@ -16,7 +18,9 @@
script =
''
echo "setting host name..."
${pkgs.nettools}/bin/hostname $(${pkgs.curl}/bin/curl http://169.254.169.254/1.0/meta-data/hostname)
${optionalString (config.networking.hostName == "") ''
${pkgs.nettools}/bin/hostname $(${pkgs.curl}/bin/curl http://169.254.169.254/1.0/meta-data/hostname)
''}
# Don't download the SSH key if it has already been injected
# into the image (a Nova feature).