From patchwork Mon Jan 20 17:23:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tremer X-Patchwork-Id: 2709 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 481dmb3m8hz3xY8 for ; Mon, 20 Jan 2020 17:23:27 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail02.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 481dmY6JQPz2b8; Mon, 20 Jan 2020 17:23:25 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 481dmY2mTYz2yCV; Mon, 20 Jan 2020 17:23:25 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 481dmW3GZQz2xcw for ; Mon, 20 Jan 2020 17:23:23 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) by mail01.ipfire.org (Postfix) with ESMTPSA id 481dmV72w9z2J8; Mon, 20 Jan 2020 17:23:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=201909rsa; t=1579541003; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=SLUof3eOBNDLKqXuOBo/2EC9scCJujMz7T8dOniCeHA=; b=TqBnX1IdrLNPTEYKRp+Prg/1YQl+6ajiQk+M1Rliu4XjAJ9wxWpO3SmEy+FutgYAwy4KFc 8iNI6+zRjQp4iVtG1UetP0vId1HuU1iLgljjfoJLh2wRQ2k93XgnjpCjI1EvRLpGmEEcL3 6T8FsuDJrYrDNf5KlrF4OMLRgB49UMG6nhPNFp2dzErI45I6pfl4LVwd16AY7/9jj7dOTH L3v0l2LO4w1v8MDO4QFJW3p1BFZxvJYCHLnV3aJ7h2qTu75K4PFSuqAMLe88cpskDukNec F7GmqKmA3OkPWz5kabLWjmOs/uR5QM1IYGtfCgWgQ1m2NzJ/8gN3tvvcSwPoxA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=201909ed25519; t=1579541003; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=SLUof3eOBNDLKqXuOBo/2EC9scCJujMz7T8dOniCeHA=; b=skOUVRk13ZbSI+pniZxCSAn9aWfBM/WZgu6o77QhCsbggbVL3z8nTAoiIEh8QRX1ERgECv FRTsK1jbCfBN5tCg== From: Michael Tremer To: development@lists.ipfire.org Subject: [PATCH] azure: Abort script when no instance ID can be retrieved Date: Mon, 20 Jan 2020 17:23:12 +0000 Message-Id: <20200120172312.16275-1-michael.tremer@ipfire.org> MIME-Version: 1.0 X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Michael Tremer Errors-To: development-bounces@lists.ipfire.org Sender: "Development" We cannot reliably determine if a system is running on Hyper-V on a private server or on the Azure Cloud. Therefore, we will have to try to retrieve an IP address with DHCP and try to connect to the metadata service. If either of those things is not successful, we will just continue with the setup process as usual. So cloud instances should be automatically configured now and all other systems will continue to boot and call the setup wizard as usual. Fixes: #12272 Signed-off-by: Michael Tremer --- src/initscripts/helper/azure-setup | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/initscripts/helper/azure-setup b/src/initscripts/helper/azure-setup index d497c43b2..d84ec3aca 100644 --- a/src/initscripts/helper/azure-setup +++ b/src/initscripts/helper/azure-setup @@ -58,6 +58,9 @@ prefix2netmask() { import_azure_configuration() { local instance_id="$(get compute/vmId)" + if [ -z "${instance_id}" ]; then + return 0 + fi boot_mesg "Importing Microsoft Azure configuration for instance ${instance_id}..."