Skip to content

Commit

Permalink
Fix Azure template
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
hwdsl2 committed May 31, 2017
1 parent 654ddcd commit 0316b0f
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 32 deletions.
5 changes: 3 additions & 2 deletions azure/README-zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

- Username 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)
- Virtual Machine Size (虚拟机大小,默认值: Standard_A0
- Virtual Machine Size (虚拟机大小,默认值: Basic_A0

请单击以下按钮开始:

Expand All @@ -20,6 +20,7 @@

## 作者

版权所有 (C) 2017 Lin Song
版权所有 (C) 2016 [Daniel Falkner](https://github.com/derdanu)

## 屏幕截图
Expand Down
7 changes: 4 additions & 3 deletions azure/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,19 @@ Customizable with the following options:

- Username 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)
- Virtual Machine Size (Default: Standard_A0)
- Virtual Machine Size (Default: Basic_A0)

Press this button to start:

<a href="https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Fhwdsl2%2Fsetup-ipsec-vpn%2Fmaster%2Fazure%2Fazuredeploy.json" target="_blank">
<img src="../docs/images/azure-deploy-button.png" alt="Deploy to Azure" />
</a>

## Author
## Authors

Copyright (C) 2017 Lin Song
Copyright (C) 2016 [Daniel Falkner](https://github.com/derdanu)

## Screenshot
Expand Down
37 changes: 19 additions & 18 deletions azure/azuredeploy.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,36 +6,41 @@
"type": "string",
"minLength": 1,
"metadata": {
"description": "User name for SSH and VPN"
"description": "Username for VPN and SSH"
}
},
"password": {
"type": "securestring",
"metadata": {
"description": "User password for SSH and VPN"
"description": "Password for VPN and SSH"
}
},
"preSharedKey": {
"type": "securestring",
"metadata": {
"description": "Pre-Shared Key for VPN"
"description": "IPsec Pre-Shared Key for VPN"
}
},
"image": {
"type": "string",
"allowedValues": [
"ubuntu",
"debian"
"ubuntu1604",
"debian8"
],
"defaultValue": "debian",
"defaultValue": "debian8",
"metadata": {
"description": "OS to use. Debian or Ubuntu"
"description": "OS to use. Debian 8 or Ubuntu 16.04 LTS"
}
},
"VMSize": {
"type": "string",
"defaultValue": "Standard_A0",
"defaultValue": "Basic_A0",
"allowedValues": [
"Basic_A0",
"Basic_A1",
"Basic_A2",
"Basic_A3",
"Basic_A4",
"Standard_A0",
"Standard_A1",
"Standard_A2",
Expand All @@ -44,11 +49,6 @@
"Standard_A5",
"Standard_A6",
"Standard_A7",
"Basic_A0",
"Basic_A1",
"Basic_A2",
"Basic_A3",
"Basic_A4",
"Standard_D1",
"Standard_D2",
"Standard_D3",
Expand All @@ -71,13 +71,13 @@
"vhdStorageType": "Standard_LRS",
"vnetId": "[resourceId('Microsoft.Network/virtualNetworks', variables('virtualNetworkName'))]",
"SubnetRef": "[concat(variables('vnetId'), '/subnets/', variables('subnetName'))]",
"ubuntu": {
"ubuntu1604": {
"publisher": "Canonical",
"offer": "UbuntuServer",
"sku": "16.04-LTS",
"version": "latest"
},
"debian": {
"debian8": {
"publisher": "credativ",
"offer": "Debian",
"sku": "8",
Expand Down Expand Up @@ -210,9 +210,10 @@
"[concat('Microsoft.Compute/virtualMachines/', variables('vmName'))]"
],
"properties": {
"publisher": "Microsoft.OSTCExtensions",
"type": "CustomScriptForLinux",
"typeHandlerVersion": "1.3",
"publisher": "Microsoft.Azure.Extensions",
"type": "CustomScript",
"typeHandlerVersion": "2.0",
"autoUpgradeMinorVersion": true,
"settings": {
"fileUris": [ "[variables('installScriptURL')]" ],
"commandToExecute": "[variables('installCommand')]"
Expand Down
Binary file modified azure/custom_deployment_screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 3 additions & 9 deletions azure/install.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
#!/bin/bash
#!/bin/sh

export VPN_IPSEC_PSK=$1
export VPN_USER=$2
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

0 comments on commit 0316b0f

Please sign in to comment.