From 902b2583fafcc32d756f02f4d6afde436d09dbda Mon Sep 17 00:00:00 2001 From: Christopher Boumenot Date: Thu, 21 Apr 2016 20:18:51 -0700 Subject: [PATCH] Update samples. --- examples/azure/centos.json | 4 ++- examples/azure/debian.json | 1 + examples/azure/opensuse.json | 1 + examples/azure/ubuntu.json | 3 +- examples/azure/ubuntu_quickstart.json | 35 +++++++++++++++++++ examples/azure/windows.json | 50 +++++++++++++++++++++++++++ 6 files changed, 92 insertions(+), 2 deletions(-) create mode 100644 examples/azure/ubuntu_quickstart.json create mode 100644 examples/azure/windows.json diff --git a/examples/azure/centos.json b/examples/azure/centos.json index 7e2c56c13..26538467f 100644 --- a/examples/azure/centos.json +++ b/examples/azure/centos.json @@ -25,9 +25,11 @@ "ssh_username": "{{user `ssh_user`}}", "ssh_password": "{{user `ssh_pass`}}", + "os_type": "Linux", "image_publisher": "OpenLogic", "image_offer": "CentOS", - "image_sku": "7.1", + "image_sku": "7.2", + "image_version": "latest", "ssh_pty": "true", "location": "South Central US", diff --git a/examples/azure/debian.json b/examples/azure/debian.json index 41b31a1ba..b4f6fbf55 100644 --- a/examples/azure/debian.json +++ b/examples/azure/debian.json @@ -25,6 +25,7 @@ "ssh_username": "{{user `ssh_user`}}", "ssh_password": "{{user `ssh_pass`}}", + "os_type": "Linux", "image_publisher": "credativ", "image_offer": "Debian", "image_sku": "8", diff --git a/examples/azure/opensuse.json b/examples/azure/opensuse.json index 0a4aabf4b..e27ebcb9c 100644 --- a/examples/azure/opensuse.json +++ b/examples/azure/opensuse.json @@ -25,6 +25,7 @@ "ssh_username": "{{user `ssh_user`}}", "ssh_password": "{{user `ssh_pass`}}", + "os_type": "Linux", "image_publisher": "SUSE", "image_offer": "openSUSE", "image_sku": "13.2", diff --git a/examples/azure/ubuntu.json b/examples/azure/ubuntu.json index 32169c3be..80c759e30 100644 --- a/examples/azure/ubuntu.json +++ b/examples/azure/ubuntu.json @@ -20,9 +20,10 @@ "capture_container_name": "images", "capture_name_prefix": "packer", + "os_type": "Linux", "image_publisher": "Canonical", "image_offer": "UbuntuServer", - "image_sku": "14.04.3-LTS", + "image_sku": "16.04.0-LTS", "location": "West US", "vm_size": "Standard_A2" diff --git a/examples/azure/ubuntu_quickstart.json b/examples/azure/ubuntu_quickstart.json new file mode 100644 index 000000000..1e89c9fee --- /dev/null +++ b/examples/azure/ubuntu_quickstart.json @@ -0,0 +1,35 @@ +{ + "variables": { + "resource_group": "{{env `ARM_RESOURCE_GROUP`}}", + "storage_account": "{{env `ARM_STORAGE_ACCOUNT`}}", + "subscription_id": "{{env `ARM_SUBSCRIPTION_ID`}}" + }, + "builders": [{ + "type": "azure-arm", + + "resource_group_name": "{{user `resource_group`}}", + "storage_account": "{{user `storage_account`}}", + "subscription_id": "{{user `subscription_id`}}", + + "capture_container_name": "images", + "capture_name_prefix": "packer", + + "os_type": "Linux", + "image_publisher": "Canonical", + "image_offer": "UbuntuServer", + "image_sku": "16.04.0-LTS", + + "location": "West US", + "vm_size": "Standard_A2" + }], + "provisioners": [{ + "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'", + "inline": [ + "apt-get update", + "apt-get upgrade -y", + "/usr/sbin/waagent -force -deprovision+user && export HISTSIZE=0 && sync" + ], + "inline_shebang": "/bin/sh -x", + "type": "shell" + }] +} diff --git a/examples/azure/windows.json b/examples/azure/windows.json new file mode 100644 index 000000000..8cb217218 --- /dev/null +++ b/examples/azure/windows.json @@ -0,0 +1,50 @@ +{ + "variables": { + "client_id": "{{env `ARM_CLIENT_ID`}}", + "client_secret": "{{env `ARM_CLIENT_SECRET`}}", + "resource_group": "{{env `ARM_RESOURCE_GROUP`}}", + "storage_account": "{{env `ARM_STORAGE_ACCOUNT`}}", + "subscription_id": "{{env `ARM_SUBSCRIPTION_ID`}}", + "tenant_id": "{{env `ARM_TENANT_ID`}}", + "object_id": "{{env `ARM_OBJECT_ID`}}" + }, + "builders": [{ + "type": "azure-arm", + + "client_id": "{{user `client_id`}}", + "client_secret": "{{user `client_secret`}}", + "resource_group_name": "{{user `resource_group`}}", + "storage_account": "{{user `storage_account`}}", + "subscription_id": "{{user `subscription_id`}}", + "object_id": "{{user `object_id`}}", + "tenant_id": "{{user `tenant_id`}}", + + + "capture_container_name": "images", + "capture_name_prefix": "packer", + + "os_type": "Windows", + "image_publisher": "MicrosoftWindowsServer", + "image_offer": "WindowsServer", + "image_sku": "2012-R2-Datacenter", + + "communicator": "winrm", + "winrm_use_ssl": "true", + "winrm_insecure": "true", + "winrm_timeout": "3m", + "winrm_username": "packer", + + "location": "West US", + "vm_size": "Standard_A2" + } + ], + "provisioners": [ + { + "type": "powershell", + "inline": [ + "dir c:\\" + ] + } + ] +} +