[Unit] Description=Initial cloud-init job (pre-networking) Wants=network-pre.target After=systemd-remount-fs.service Before=NetworkManager.service Before=network-pre.target Before=shutdown.target RequiresMountsFor=/var/lib/cloud # Since AL2 EC2 AMI's have network config & local data sources disabled, cloud-init-local is not necessary # and testing confirms this. Skipping it should therefore not change behaviour of existing AL2 EC2 AMI's. ConditionPathExists=!/etc/cloud/skip-cloud-init-local [Service] Type=oneshot ExecStart=/usr/bin/cloud-init init --local ExecStart=/bin/touch /run/cloud-init/network-config-ready RemainAfterExit=yes TimeoutSec=0 # Output needs to appear in instance console output StandardOutput=journal+console [Install] WantedBy=cloud-init.target