mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-14 06:00:33 +03:00
fetch-ec2-data: Don't restart
This service only needs to run once on system startup, so it doesn't need to be restarted by switch-to-configuration.
This commit is contained in:
parent
63efc2ee38
commit
4239e276ea
1 changed files with 8 additions and 4 deletions
|
@ -35,8 +35,8 @@ with lib;
|
||||||
|
|
||||||
wget="wget -q --retry-connrefused -O -"
|
wget="wget -q --retry-connrefused -O -"
|
||||||
|
|
||||||
echo "setting host name..."
|
|
||||||
${optionalString (config.networking.hostName == "") ''
|
${optionalString (config.networking.hostName == "") ''
|
||||||
|
echo "setting host name..."
|
||||||
${pkgs.nettools}/bin/hostname $($wget http://169.254.169.254/1.0/meta-data/hostname)
|
${pkgs.nettools}/bin/hostname $($wget http://169.254.169.254/1.0/meta-data/hostname)
|
||||||
''}
|
''}
|
||||||
|
|
||||||
|
@ -69,14 +69,18 @@ with lib;
|
||||||
fi
|
fi
|
||||||
|
|
||||||
${optionalString (! config.ec2.metadata) ''
|
${optionalString (! config.ec2.metadata) ''
|
||||||
# Since the user data is sensitive, prevent it from being
|
# Since the user data is sensitive, prevent it from
|
||||||
# accessed from now on.
|
# being accessed from now on. FIXME: remove at some
|
||||||
ip route add blackhole 169.254.169.254/32
|
# point, since current NixOps no longer relies on
|
||||||
|
# metadata secrecy.
|
||||||
|
ip route add blackhole 169.254.169.254/32
|
||||||
''}
|
''}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
serviceConfig.Type = "oneshot";
|
serviceConfig.Type = "oneshot";
|
||||||
serviceConfig.RemainAfterExit = true;
|
serviceConfig.RemainAfterExit = true;
|
||||||
|
|
||||||
|
restartIfChanged = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.services."print-host-key" =
|
systemd.services."print-host-key" =
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue