1
0
mirror of synced 2025-01-31 04:21:43 +03:00

Fix Azure template

- Switch to version 2 of the Azure Custom Script Extension
- Use default VM size "Basic_A0" for deployments (configurable)
- Clean up install.sh, and other minor improvements
This commit is contained in:
hwdsl2 2017-05-31 14:13:54 -05:00
parent 654ddcdfa4
commit 0316b0f755
5 changed files with 29 additions and 32 deletions

View File

@ -8,9 +8,9 @@
- Username for VPN and SSH (用户名) - Username for VPN and SSH (用户名)
- Password for VPN and SSH (密码) - Password for VPN and SSH (密码)
- IPsec Pre-Shared Key IPsec 预共享密钥) - IPsec Pre-Shared Key for VPN IPsec 预共享密钥)
- Operating System Image 操作系统镜像Debian 8 或 Ubuntu 16.04 LTS - Operating System Image 操作系统镜像Debian 8 或 Ubuntu 16.04 LTS
- Virtual Machine Size (虚拟机大小,默认值: Standard_A0 - Virtual Machine Size (虚拟机大小,默认值: Basic_A0
请单击以下按钮开始: 请单击以下按钮开始:
@ -20,6 +20,7 @@
## 作者 ## 作者
版权所有 (C) 2017 Lin Song
版权所有 (C) 2016 [Daniel Falkner](https://github.com/derdanu) 版权所有 (C) 2016 [Daniel Falkner](https://github.com/derdanu)
## 屏幕截图 ## 屏幕截图

View File

@ -8,9 +8,9 @@ Customizable with the following options:
- Username for VPN and SSH - Username for VPN and SSH
- Password for VPN and SSH - Password for VPN and SSH
- IPsec Pre-Shared Key - IPsec Pre-Shared Key for VPN
- Operating System Image (Debian 8 or Ubuntu 16.04 LTS) - Operating System Image (Debian 8 or Ubuntu 16.04 LTS)
- Virtual Machine Size (Default: Standard_A0) - Virtual Machine Size (Default: Basic_A0)
Press this button to start: Press this button to start:
@ -18,8 +18,9 @@ Press this button to start:
<img src="../docs/images/azure-deploy-button.png" alt="Deploy to Azure" /> <img src="../docs/images/azure-deploy-button.png" alt="Deploy to Azure" />
</a> </a>
## Author ## Authors
Copyright (C) 2017 Lin Song
Copyright (C) 2016 [Daniel Falkner](https://github.com/derdanu) Copyright (C) 2016 [Daniel Falkner](https://github.com/derdanu)
## Screenshot ## Screenshot

View File

@ -6,36 +6,41 @@
"type": "string", "type": "string",
"minLength": 1, "minLength": 1,
"metadata": { "metadata": {
"description": "User name for SSH and VPN" "description": "Username for VPN and SSH"
} }
}, },
"password": { "password": {
"type": "securestring", "type": "securestring",
"metadata": { "metadata": {
"description": "User password for SSH and VPN" "description": "Password for VPN and SSH"
} }
}, },
"preSharedKey": { "preSharedKey": {
"type": "securestring", "type": "securestring",
"metadata": { "metadata": {
"description": "Pre-Shared Key for VPN" "description": "IPsec Pre-Shared Key for VPN"
} }
}, },
"image": { "image": {
"type": "string", "type": "string",
"allowedValues": [ "allowedValues": [
"ubuntu", "ubuntu1604",
"debian" "debian8"
], ],
"defaultValue": "debian", "defaultValue": "debian8",
"metadata": { "metadata": {
"description": "OS to use. Debian or Ubuntu" "description": "OS to use. Debian 8 or Ubuntu 16.04 LTS"
} }
}, },
"VMSize": { "VMSize": {
"type": "string", "type": "string",
"defaultValue": "Standard_A0", "defaultValue": "Basic_A0",
"allowedValues": [ "allowedValues": [
"Basic_A0",
"Basic_A1",
"Basic_A2",
"Basic_A3",
"Basic_A4",
"Standard_A0", "Standard_A0",
"Standard_A1", "Standard_A1",
"Standard_A2", "Standard_A2",
@ -44,11 +49,6 @@
"Standard_A5", "Standard_A5",
"Standard_A6", "Standard_A6",
"Standard_A7", "Standard_A7",
"Basic_A0",
"Basic_A1",
"Basic_A2",
"Basic_A3",
"Basic_A4",
"Standard_D1", "Standard_D1",
"Standard_D2", "Standard_D2",
"Standard_D3", "Standard_D3",
@ -71,13 +71,13 @@
"vhdStorageType": "Standard_LRS", "vhdStorageType": "Standard_LRS",
"vnetId": "[resourceId('Microsoft.Network/virtualNetworks', variables('virtualNetworkName'))]", "vnetId": "[resourceId('Microsoft.Network/virtualNetworks', variables('virtualNetworkName'))]",
"SubnetRef": "[concat(variables('vnetId'), '/subnets/', variables('subnetName'))]", "SubnetRef": "[concat(variables('vnetId'), '/subnets/', variables('subnetName'))]",
"ubuntu": { "ubuntu1604": {
"publisher": "Canonical", "publisher": "Canonical",
"offer": "UbuntuServer", "offer": "UbuntuServer",
"sku": "16.04-LTS", "sku": "16.04-LTS",
"version": "latest" "version": "latest"
}, },
"debian": { "debian8": {
"publisher": "credativ", "publisher": "credativ",
"offer": "Debian", "offer": "Debian",
"sku": "8", "sku": "8",
@ -210,9 +210,10 @@
"[concat('Microsoft.Compute/virtualMachines/', variables('vmName'))]" "[concat('Microsoft.Compute/virtualMachines/', variables('vmName'))]"
], ],
"properties": { "properties": {
"publisher": "Microsoft.OSTCExtensions", "publisher": "Microsoft.Azure.Extensions",
"type": "CustomScriptForLinux", "type": "CustomScript",
"typeHandlerVersion": "1.3", "typeHandlerVersion": "2.0",
"autoUpgradeMinorVersion": true,
"settings": { "settings": {
"fileUris": [ "[variables('installScriptURL')]" ], "fileUris": [ "[variables('installScriptURL')]" ],
"commandToExecute": "[variables('installCommand')]" "commandToExecute": "[variables('installCommand')]"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 28 KiB

View File

@ -1,13 +1,7 @@
#!/bin/bash #!/bin/sh
export VPN_IPSEC_PSK=$1 export VPN_IPSEC_PSK=$1
export VPN_USER=$2 export VPN_USER=$2
export VPN_PASSWORD=$3 export VPN_PASSWORD=$3
# Debian on Azure has no lsb_release installed.
if ! [[ -x "/usr/bin/lsb_release" ]]
then
apt-get update
apt-get install -y lsb-release
fi
wget https://git.io/vpnsetup -O vpnsetup.sh && sh vpnsetup.sh wget https://git.io/vpnsetup -O vpnsetup.sh && sh vpnsetup.sh