about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorVincent Bernat <vincent@bernat.ch>2018-08-08 00:09:00 +0200
committerxeji <36407913+xeji@users.noreply.github.com>2018-08-08 00:09:00 +0200
commit57840dbffb38d6717130bf446935beff5bb12dfe (patch)
treea0235d36f30f7895504ababb64bdde647a8da107 /nixos
parentb35238f909335941235afc502959085c005f256a (diff)
downloadnixlib-57840dbffb38d6717130bf446935beff5bb12dfe.tar
nixlib-57840dbffb38d6717130bf446935beff5bb12dfe.tar.gz
nixlib-57840dbffb38d6717130bf446935beff5bb12dfe.tar.bz2
nixlib-57840dbffb38d6717130bf446935beff5bb12dfe.tar.lz
nixlib-57840dbffb38d6717130bf446935beff5bb12dfe.tar.xz
nixlib-57840dbffb38d6717130bf446935beff5bb12dfe.tar.zst
nixlib-57840dbffb38d6717130bf446935beff5bb12dfe.zip
nixos/cloud-init: order after network-online.target (#44633)
Some modules of cloud-init can cope with a network not immediately
available (notably, the EC2 module), but some others won't retry if
network is not available (notably, the Cloudstack module).
network.target doesn't give much guarantee about the network
availability. Applications not able to start without a fully
configured network should be ordered after network-online.target.

Also see #44573 and #44524.
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/services/system/cloud-init.nix13
1 files changed, 7 insertions, 6 deletions
diff --git a/nixos/modules/services/system/cloud-init.nix b/nixos/modules/services/system/cloud-init.nix
index d513e44dcfba..1a700828ce77 100644
--- a/nixos/modules/services/system/cloud-init.nix
+++ b/nixos/modules/services/system/cloud-init.nix
@@ -104,8 +104,9 @@ in
     systemd.services.cloud-init =
       { description = "Initial cloud-init job (metadata service crawler)";
         wantedBy = [ "multi-user.target" ];
-        wants = [ "local-fs.target" "cloud-init-local.service" "sshd.service" "sshd-keygen.service" ];
-        after = [ "local-fs.target" "network.target" "cloud-init-local.service" ];
+        wants = [ "local-fs.target" "network-online.target" "cloud-init-local.service"
+                  "sshd.service" "sshd-keygen.service" ];
+        after = [ "local-fs.target" "network-online.target" "cloud-init-local.service" ];
         before = [ "sshd.service" "sshd-keygen.service" ];
         requires = [ "network.target "];
         path = path;
@@ -121,8 +122,8 @@ in
     systemd.services.cloud-config =
       { description = "Apply the settings specified in cloud-config";
         wantedBy = [ "multi-user.target" ];
-        wants = [ "network.target" ];
-        after = [ "network.target" "syslog.target" "cloud-config.target" ];
+        wants = [ "network-online.target" ];
+        after = [ "network-online.target" "syslog.target" "cloud-config.target" ];
 
         path = path;
         serviceConfig =
@@ -137,8 +138,8 @@ in
     systemd.services.cloud-final =
       { description = "Execute cloud user/final scripts";
         wantedBy = [ "multi-user.target" ];
-        wants = [ "network.target" ];
-        after = [ "network.target" "syslog.target" "cloud-config.service" "rc-local.service" ];
+        wants = [ "network-online.target" ];
+        after = [ "network-online.target" "syslog.target" "cloud-config.service" "rc-local.service" ];
         requires = [ "cloud-config.target" ];
         path = path;
         serviceConfig =