git.iko.soy/typeable/nixpkgs
on master help sign in
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.

commit4239e276ea0c0604ad1de38c46e3a615ae535222 authorEelco Dolstra <eelco.dolstra@logicblox.com> dateMon 4 May 2015, 16:56 (12 years ago) parent63efc2e
1 file changed+8−4
nixos/modules/virtualisation/ec2-data.nix+8−4
nixos/modules/virtualisation/ec2-data.nix+8−4
@@ -35,8 +35,8 @@ with lib;
3535
3636 wget="wget -q --retry-connrefused -O -"
3737
38− echo "setting host name..."
3938 ${optionalString (config.networking.hostName == "") ''
39+ echo "setting host name..."
4040 ${pkgs.nettools}/bin/hostname $($wget http://169.254.169.254/1.0/meta-data/hostname)
4141 ''}
4242
@@ -69,14 +69,18 @@ with lib;
6969 fi
7070
7171 ${optionalString (! config.ec2.metadata) ''
72− # Since the user data is sensitive, prevent it from being
73− # accessed from now on.
74− ip route add blackhole 169.254.169.254/32
72+ # Since the user data is sensitive, prevent it from
73+ # being accessed from now on. FIXME: remove at some
74+ # point, since current NixOps no longer relies on
75+ # metadata secrecy.
76+ ip route add blackhole 169.254.169.254/32
7577 ''}
7678 '';
7779
7880 serviceConfig.Type = "oneshot";
7981 serviceConfig.RemainAfterExit = true;
82+
83+ restartIfChanged = false;
8084 };
8185
8286 systemd.services."print-host-key" =