vagrant-azure 2.0.0.pre7 → 2.0.0.pre8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -1
  3. data/.rubocop.yml +120 -0
  4. data/.travis.yml +13 -0
  5. data/Gemfile +4 -5
  6. data/README.md +98 -57
  7. data/docs/basic_linux/Vagrantfile +17 -0
  8. data/docs/basic_linux/readme.md +12 -0
  9. data/docs/basic_windows/Vagrantfile +20 -0
  10. data/docs/basic_windows/readme.md +12 -0
  11. data/docs/custom_vhd/Vagrantfile +16 -0
  12. data/docs/custom_vhd/readme.md +48 -0
  13. data/docs/data_disks/Vagrantfile +16 -0
  14. data/docs/data_disks/readme.md +20 -0
  15. data/docs/managed_image/Vagrantfile +15 -0
  16. data/docs/managed_image/readme.md +66 -0
  17. data/docs/readme.md +30 -0
  18. data/lib/vagrant-azure/action/run_instance.rb +95 -69
  19. data/lib/vagrant-azure/config.rb +75 -4
  20. data/lib/vagrant-azure/util/machine_id_helper.rb +4 -0
  21. data/lib/vagrant-azure/util/managed_image_helper.rb +26 -0
  22. data/lib/vagrant-azure/util/template_renderer.rb +54 -0
  23. data/lib/vagrant-azure/util/timer.rb +4 -0
  24. data/lib/vagrant-azure/util/vm_await.rb +4 -0
  25. data/lib/vagrant-azure/util/vm_status_translator.rb +4 -0
  26. data/lib/vagrant-azure/version.rb +1 -1
  27. data/locales/en.yml +6 -0
  28. data/spec/spec_helper.rb +1 -0
  29. data/spec/templates/arm/deployment_spec.rb +169 -0
  30. data/spec/vagrant-azure/config_spec.rb +3 -3
  31. data/templates/arm/deployment.json.erb +50 -258
  32. data/templates/arm/resources/availability_set.json.erb +6 -0
  33. data/templates/arm/resources/data_disk.json.erb +21 -0
  34. data/templates/arm/resources/import_vhd_image.json.erb +23 -0
  35. data/templates/arm/resources/linux_reset_root_ext.json.erb +20 -0
  36. data/templates/arm/resources/network_interface.json.erb +26 -0
  37. data/templates/arm/resources/network_security_group.json.erb +85 -0
  38. data/templates/arm/resources/public_ip_address.json.erb +12 -0
  39. data/templates/arm/resources/storage_account.json.erb +9 -0
  40. data/templates/arm/resources/virtual_machine.json.erb +82 -0
  41. data/templates/arm/resources/virtual_network.json.erb +27 -0
  42. data/templates/arm/resources/windows_reset_access_ext.json.erb +21 -0
  43. data/vagrant-azure.gemspec +4 -6
  44. metadata +38 -40
  45. data/spec/vagrant-azure/services/azure_resource_manager_spec.rb +0 -19
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 33f6326fa39dd282d33944a392578b0de18dc48f
4
- data.tar.gz: 2cc37dc608a84b4c85dfd264bff05138ecd22597
3
+ metadata.gz: da040d6fe92668e86a2828f25d39fc82d1e397ce
4
+ data.tar.gz: 50faba226ed65574c3f9eac920e38ee201e81f1d
5
5
  SHA512:
6
- metadata.gz: 9bf9e2e684cec5afafc2d5a7c611855aab4bcd52280860df67181c3983025f908574b05686e75cf443dad8475e1d5cc58da2259796423e1cde7b42506dea39a2
7
- data.tar.gz: ed6f81233d797cb17be77fdabca56eefaeff6cf63ef4688dc8547dee9bec89ad68a476522e750c1fe7d986ab45b607f634923e83028df55892554ce741333e0b
6
+ metadata.gz: db13176d896df48b484d7839613dfd383331e020ddff811423931f18167b3e3e7923dc237199143e0bc4a82805260a20a3977dc9069d5140b90d9f28b7bca54f
7
+ data.tar.gz: 11a945a753a95a9b183b9d184322ac4514d1ca2ecc8c435ca861e27840c672aaca5aefe6339a674378f6985bff6a5c8094295c260fde2f0c5eb025c9e1b43b42
data/.gitignore CHANGED
@@ -2,7 +2,7 @@ id
2
2
  .DS_Store
3
3
  Gemfile.lock
4
4
  azure.box
5
- Vagrantfile
5
+ /Vagrantfile
6
6
  !example_box/Vagrantfile
7
7
  !example_box/README.md
8
8
  babu
data/.rubocop.yml ADDED
@@ -0,0 +1,120 @@
1
+ AllCops:
2
+ TargetRubyVersion: 2.2
3
+ # RuboCop has a bunch of cops enabled by default. This setting tells RuboCop
4
+ # to ignore them, so only the ones explicitly set in this file are enabled.
5
+ DisabledByDefault: true
6
+
7
+ # Prefer &&/|| over and/or.
8
+ Style/AndOr:
9
+ Enabled: true
10
+
11
+ # Do not use braces for hash literals when they are the last argument of a
12
+ # method call.
13
+ Style/BracesAroundHashParameters:
14
+ Enabled: true
15
+
16
+ # Align `when` with `case`.
17
+ Style/CaseIndentation:
18
+ Enabled: true
19
+
20
+ # Align comments with method definitions.
21
+ Style/CommentIndentation:
22
+ Enabled: true
23
+
24
+ # No extra empty lines.
25
+ Style/EmptyLines:
26
+ Enabled: true
27
+
28
+ # In a regular class definition, no empty lines around the body.
29
+ Style/EmptyLinesAroundClassBody:
30
+ Enabled: true
31
+
32
+ # In a regular method definition, no empty lines around the body.
33
+ Style/EmptyLinesAroundMethodBody:
34
+ Enabled: true
35
+
36
+ # In a regular module definition, no empty lines around the body.
37
+ Style/EmptyLinesAroundModuleBody:
38
+ Enabled: true
39
+
40
+ # Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }.
41
+ Style/HashSyntax:
42
+ Enabled: true
43
+
44
+ # Method definitions after `private` or `protected` isolated calls need one
45
+ # extra level of indentation.
46
+ Style/IndentationConsistency:
47
+ Enabled: true
48
+ EnforcedStyle: rails
49
+
50
+ # Two spaces, no tabs (for indentation).
51
+ Style/IndentationWidth:
52
+ Enabled: true
53
+
54
+ Style/SpaceAfterColon:
55
+ Enabled: true
56
+
57
+ Style/SpaceAfterComma:
58
+ Enabled: true
59
+
60
+ Style/SpaceAroundEqualsInParameterDefault:
61
+ Enabled: true
62
+
63
+ Style/SpaceAroundKeyword:
64
+ Enabled: true
65
+
66
+ Style/SpaceAroundOperators:
67
+ Enabled: true
68
+
69
+ Style/SpaceBeforeFirstArg:
70
+ Enabled: true
71
+
72
+ # Defining a method with parameters needs parentheses.
73
+ Style/MethodDefParentheses:
74
+ Enabled: true
75
+
76
+ # Use `foo {}` not `foo{}`.
77
+ Style/SpaceBeforeBlockBraces:
78
+ Enabled: true
79
+
80
+ # Use `foo { bar }` not `foo {bar}`.
81
+ Style/SpaceInsideBlockBraces:
82
+ Enabled: true
83
+
84
+ # Use `{ a: 1 }` not `{a:1}`.
85
+ Style/SpaceInsideHashLiteralBraces:
86
+ Enabled: true
87
+
88
+ Style/SpaceInsideParens:
89
+ Enabled: true
90
+
91
+ # Check quotes usage according to lint rule below.
92
+ Style/StringLiterals:
93
+ Enabled: true
94
+ EnforcedStyle: double_quotes
95
+
96
+ # Detect hard tabs, no hard tabs.
97
+ Style/Tab:
98
+ Enabled: true
99
+
100
+ # Blank lines should not have any spaces.
101
+ Style/TrailingBlankLines:
102
+ Enabled: true
103
+
104
+ # No trailing whitespace.
105
+ Style/TrailingWhitespace:
106
+ Enabled: true
107
+
108
+ # Use quotes for string literals when they are enough.
109
+ Style/UnneededPercentQ:
110
+ Enabled: true
111
+
112
+ # Align `end` with the matching keyword or starting expression except for
113
+ # assignments, where it should be aligned with the LHS.
114
+ Lint/EndAlignment:
115
+ Enabled: true
116
+ EnforcedStyleAlignWith: variable
117
+
118
+ # Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg.
119
+ Lint/RequireParentheses:
120
+ Enabled: true
data/.travis.yml ADDED
@@ -0,0 +1,13 @@
1
+ sudo: false
2
+ language: ruby
3
+ rvm:
4
+ - 2.2.5
5
+ before_install:
6
+ - rvm @default,@global do gem uninstall bundler -a -x
7
+ - gem install bundler -v 1.10.5
8
+ deploy:
9
+ provider: rubygems
10
+ api_key:
11
+ secure: "ThMTLeJ1E2dLLAK1AIokfE+0GyfCKwaAstxETI/qFkOwL21REi6dgTfPIrBpgmrYATb/YgkgIf6Zl46R7vx9/dtgIGBmX7AXT3zsR38P3zfOGy5PzHGGK72ZmkC5UFSBsnQl5J0qQsUEMQfEy2g7dwn1d9aFLKhvnFblNHt4x5c="
12
+ on:
13
+ tags: true
data/Gemfile CHANGED
@@ -2,18 +2,17 @@
2
2
  # Copyright (c) Microsoft Corporation. All rights reserved.
3
3
  # Licensed under the MIT License. See License in the project root for license information.
4
4
 
5
- source 'https://rubygems.org'
5
+ source "https://rubygems.org"
6
6
 
7
7
  gemspec
8
8
 
9
- group :development do
9
+ group :development, :test do
10
10
  # We depend on Vagrant for development, but we don't add it as a
11
11
  # gem dependency because we expect to be installed within the
12
12
  # Vagrant environment itself using `vagrant plugin`.
13
- gem 'vagrant', git: 'https://github.com/mitchellh/vagrant.git'
14
- gem 'bundler', '~>1.10.5'
13
+ gem "vagrant", git: "https://github.com/mitchellh/vagrant.git", tag: "v1.9.2"
15
14
  end
16
15
 
17
16
  group :plugins do
18
- gem 'vagrant-azure', path: '.'
17
+ gem "vagrant-azure", path: "."
19
18
  end
data/README.md CHANGED
@@ -5,32 +5,41 @@
5
5
  This is a [Vagrant](http://www.vagrantup.com) 1.7.3+ plugin that adds [Microsoft Azure](https://azure.microsoft.com)
6
6
  provider to Vagrant, allowing Vagrant to control and provision machines in Microsoft Azure.
7
7
 
8
- ## Usage
9
-
10
- [Download Vagrant](http://www.vagrantup.com/downloads.html)
11
-
12
- Install the vagrant-azure plugin using the standard Vagrant 1.1+ installation methods. After installing the plugin, you can ```vagrant up``` and use ```azure``` provider. For example:
13
-
14
- ```sh
15
- & vagrant plugin install vagrant-azure --plugin-version '2.0.0.pre6'
16
- ...
17
- $ vagrant up --provider=azure
18
- ...
8
+ ## Getting Started
9
+
10
+ [Install Vagrant](https://www.vagrantup.com/docs/installation/)
11
+
12
+ ### Create an Azure Active Directory (AAD) Application
13
+ AAD encourages the use of Applications / Service Principals for authenticating applications. An
14
+ application / service principal combination provides a service identity for Vagrant to manage your Azure Subscription.
15
+ [Click here to learn about AAD applications and service principals.](https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-application-objects.)
16
+ - [Install the Azure CLI](https://docs.microsoft.com/en-us/cli/azure/install-azure-cli)
17
+ - run `az login` to log into Azure
18
+ - run `az ad sp create-for-rbac` to create an Azure Active Directory Application with access to Azure Resource Manager
19
+ for the current Azure Subscription
20
+ - If you want to run this for a different Azure Subscription, run `az account set --subscription 'your subscription name'`
21
+ - run `az account list --query "[?isDefault].id" -o tsv` to get your Azure Subscription Id.
22
+
23
+ The output of `az ad sp create-for-rbac` should look like the following:
24
+ ```json
25
+ {
26
+ "appId": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
27
+ "displayName": "some-display-name",
28
+ "name": "http://azure-cli-2017-04-03-15-30-52",
29
+ "password": "XXXXXXXXXXXXXXXXXXXX",
30
+ "tenant": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
31
+ }
19
32
  ```
33
+ The values `tenant`, `appId` and `password` map to the configuration values
34
+ `azure.tenant_id`, `azure.client_id` and `azure.client_secret` in your Vagrant file or environment variables.
20
35
 
21
- You'll need an ```azure``` box before you can do ```vagrant up``` though.
22
-
23
- ## Quick Start
24
-
25
- You can use the dummy box and specify all the required details manually in the ```config.vm.provider``` block in your ```Vagrantfile```. Add the dummy box with the name you want:
36
+ For ***nix**, edit your `Vagrantfile` as shown below and provide all the values as explained.
26
37
 
27
- ```sh
28
- $ vagrant box add azure https://github.com/azure/vagrant-azure/raw/v2.0/dummy.box
29
- ...
30
- ```
38
+ ### Create a Vagrantfile
31
39
 
32
- For ***nix**, edit your `Vagrantfile` as shown below and provide all the values as explained.
40
+ Create a directory and add the Linux or Windows Vagrantfile content below to a file named `Vagrantfile`.
33
41
 
42
+ #### Linux Vagrantfile
34
43
  ```ruby
35
44
  Vagrant.configure('2') do |config|
36
45
  config.vm.box = 'azure'
@@ -39,9 +48,6 @@ Vagrant.configure('2') do |config|
39
48
  config.ssh.private_key_path = '~/.ssh/id_rsa'
40
49
  config.vm.provider :azure do |azure, override|
41
50
 
42
- # use Azure Active Directory Application / Service Principal to connect to Azure
43
- # see: https://azure.microsoft.com/en-us/documentation/articles/resource-group-create-service-principal-portal/
44
-
45
51
  # each of the below values will default to use the env vars named as below if not specified explicitly
46
52
  azure.tenant_id = ENV['AZURE_TENANT_ID']
47
53
  azure.client_id = ENV['AZURE_CLIENT_ID']
@@ -52,17 +58,13 @@ Vagrant.configure('2') do |config|
52
58
  end
53
59
  ```
54
60
 
55
- For **Windows**, edit your `Vagrantfile` as shown below and provide all the values as explained.
56
-
61
+ #### Windows Vagrantfile
57
62
  ```ruby
58
63
  Vagrant.configure('2') do |config|
59
64
  config.vm.box = 'azure'
60
65
 
61
66
  config.vm.provider :azure do |azure, override|
62
67
 
63
- # use Azure Active Directory Application / Service Principal to connect to Azure
64
- # see: https://azure.microsoft.com/en-us/documentation/articles/resource-group-create-service-principal-portal/
65
-
66
68
  # each of the below values will default to use the env vars named as below if not specified explicitly
67
69
  azure.tenant_id = ENV['AZURE_TENANT_ID']
68
70
  azure.client_id = ENV['AZURE_CLIENT_ID']
@@ -73,7 +75,6 @@ Vagrant.configure('2') do |config|
73
75
  azure.instance_ready_timeout = 600
74
76
  azure.vm_password = 'TopSecretPassw0rd'
75
77
  azure.admin_username = "OctoAdmin"
76
- azure.admin_password = 'TopSecretPassw0rd'
77
78
  override.winrm.transport = :ssl
78
79
  override.winrm.port = 5986
79
80
  override.winrm.ssl_peer_verification = false # must be false if using a self signed cert
@@ -82,57 +83,97 @@ Vagrant.configure('2') do |config|
82
83
  end
83
84
  ```
84
85
 
85
- Now you can run
86
+ ### Spin Up a Box in Azure
87
+
88
+ Install the vagrant-azure plugin using the standard Vagrant 1.1+ installation methods. After installing the plugin,
89
+ you can ```vagrant up``` and use ```azure``` provider. For example:
86
90
 
87
91
  ```sh
92
+ $ vagrant box add azure https://github.com/azure/vagrant-azure/raw/v2.0/dummy.box --provider azure
93
+ & vagrant plugin install vagrant-azure --plugin-version '2.0.0.pre6'
88
94
  $ vagrant up --provider=azure
89
- ...
90
95
  ```
91
96
 
92
97
  This will bring up an Azure VM as per the configuration options set above.
93
98
 
94
- You can now either SSH (if its a *Nix VM) using ```vagrant ssh```, RDP (if its a Windows VM) using ```vagrant rdp``` or PowerShell ```vagrant powershell```.
95
-
96
- Normally, a lot of this options, e.g., ```vm_image_urn```, will be embedded in a box file and you just have to provide minimal options in the ```Vagrantfile```. Since, we're using a dummy box, there are no pre-configured defaults.
97
-
98
- ## Azure Boxes
99
-
100
- The vagrant-azure plugin provides the ability to use ```Azure``` boxes with Vagrant. Please see the example box provided in [example_box](https://github.com/azure/vagrant-azure/tree/v2.0/example_box) directory and follow the instructions there to build an ```azure``` box.
99
+ You can now either SSH (if its a *Nix VM) using ```vagrant ssh```, RDP (if its a Windows VM) using ```vagrant rdp```
100
+ or PowerShell ```vagrant powershell```.
101
101
 
102
- Please see [Vagrant Docs](http://docs.vagrantup.com/v2/) for more details.
102
+ Normally, a lot of the options, e.g., ```vm_image_urn```, will be embedded in a box file and you just have to provide
103
+ minimal options in the ```Vagrantfile```. Since, we're using a dummy box, there are no pre-configured defaults.
103
104
 
104
105
  ## Configuration
105
106
 
106
- The vagrant-azure provide exposes a few Azure specific configuration options:
107
-
108
- ### Mandatory
109
-
110
- For instructions on how to setup an Azure Active Directory Application see: <https://azure.microsoft.com/en-us/documentation/articles/resource-group-create-service-principal-portal/>
107
+ The vagrant-azure provide exposes Azure specific configuration options:
111
108
 
109
+ ### Mandatory Parameters
112
110
  * `tenant_id`: Your Azure Active Directory Tenant Id.
113
111
  * `client_id`: Your Azure Active Directory application client id.
114
112
  * `client_secret`: Your Azure Active Directory application client secret.
115
113
  * `subscription_id`: The Azure subscription Id you'd like to use.
114
+ *Note: to procure these values see: [Create an Azure Active Directory Application](#create-an-azure-active-directory-aad-application)*
116
115
 
117
- ### Optional
118
-
119
- * `resource_group_name`: (Optional) Name of the resource group to use.
120
- * `location`: (Optional) Azure location to build the VM -- defaults to `westus`
121
- * `vm_name`: (Optional) Name of the virtual machine
116
+ ### Optional VM Parameters
117
+ * `vm_name`: Name of the virtual machine
122
118
  * `vm_password`: (Optional for *nix) Password for the VM -- This is not recommended for *nix deployments
123
- * `vm_size`: (Optional) VM size to be used -- defaults to 'Standard_DS2_v2'. See sizes for [*nix](https://azure.microsoft.com/en-us/documentation/articles/virtual-machines-linux-sizes/), [Windows](https://azure.microsoft.com/en-us/documentation/articles/virtual-machines-windows-sizes/).
124
- * `vm_image_urn`: (Optional) Name of the virtual machine image urn to use -- defaults to 'canonical:ubuntuserver:16.04-LTS:latest'. See documentation for [*nix](https://azure.microsoft.com/en-us/documentation/articles/virtual-machines-linux-cli-ps-findimage/), [Windows](https://docs.microsoft.com/en-us/azure/virtual-machines/virtual-machines-windows-cli-ps-findimage).
119
+ * `vm_size`: VM size to be used -- defaults to 'Standard_DS2_v2'. See sizes for [*nix](https://azure.microsoft.com/en-us/documentation/articles/virtual-machines-linux-sizes/), [Windows](https://azure.microsoft.com/en-us/documentation/articles/virtual-machines-windows-sizes/).
120
+ * `admin_username`: The root/administrator username for the VM
121
+
122
+ ### Optional VM Image Parameters
123
+ `vm_image_urn`, `vm_vhd_uri`, and `vm_managed_image_id` are mutually exclusive. They should not be used in combination.
124
+ * `vm_image_urn`: Name of the virtual machine image urn to use -- defaults to 'canonical:ubuntuserver:16.04-LTS:latest'. See documentation for [*nix](https://azure.microsoft.com/en-us/documentation/articles/virtual-machines-linux-cli-ps-findimage/), [Windows](https://docs.microsoft.com/en-us/azure/virtual-machines/virtual-machines-windows-cli-ps-findimage).
125
+ * `vm_vhd_uri`: URI to the custom VHD. If the VHD is not publicly accessible, provide a SAS token in the URI.
126
+ * `vm_operating_system`: (Mandatory) Must provide the OS if using a custom image ("Linux" or "Windows")
127
+ * `vm_vhd_storage_account_id`: (Manditory) The Storage Account Azure Resource Manager Id where the OS Image is stored
128
+ (like: /subscriptions/{subscription id}/resourceGroups/{resource group}/providers/Microsoft.Storage/storageAccounts/{account name}).
129
+ * `vm_managed_image_id`: Create a VM from a generalized VM that is stored as either a managed or unmanaged disk. See: https://docs.microsoft.com/en-us/azure/virtual-machines/windows/capture-image-resource
130
+
131
+ ### Optional VM Data Disk Parameters (Preview)
132
+ The data disk functionality is preview and may change before the 2.0 release.
133
+ * `data_disks`: (Optional) Array of Data Disks to attach to the VM. For information on attaching the drive, See: https://docs.microsoft.com/en-us/azure/virtual-machines/linux/classic/attach-disk.
134
+ ```ruby
135
+ override.data_disks = [
136
+ # sample of creating empty data disk
137
+ {
138
+ name: "mydatadisk1",
139
+ size_gb: 30
140
+ },
141
+ # sample of attaching an existing VHD as a data disk
142
+ {
143
+ name: "mydatadisk2",
144
+ vhd_uri: "http://mystorage.blob.core.windows.net/vhds/mydatadisk2.vhd"
145
+ },
146
+ # sample of attaching a data disk from image
147
+ {
148
+ name: "mydatadisk3",
149
+ vhd_uri: "http://mystorage.blob.core.windows.net/vhds/mydatadisk3.vhd",
150
+ image: "http: //storagename.blob.core.windows.net/vhds/VMImageName-datadisk.vhd"
151
+ }]
152
+ ```
153
+
154
+ ### Optional Networking Parameters
125
155
  * `virtual_network_name`: (Optional) Name of the virtual network resource
156
+ * `dns_name`: (Optional) DNS Label Prefix
157
+ * `nsg_name`: (Optional) Network Security Group Label Prefix
126
158
  * `subnet_name`: (Optional) Name of the virtual network subnet resource
127
159
  * `tcp_endpoints`: (Optional) The custom inbound security rules part of network security group (a.k.a. opened tcp endpoints). Allows specifying one or more intervals in the form of:
128
160
  * an array `['8000-9000', '9100-9200']`,
129
161
  * a single interval as `'8000-9000'`,
130
162
  * a single port as `8000`.
163
+
164
+ ### Optional Windows Parameters
165
+ * `winrm_install_self_signed_cert`: (Optional, Windows only) Whether to install a self-signed cert automatically to enable WinRM to communicate over HTTPS (5986). Only available when a custom `deployment_template` is not supplied. Default 'true'.
166
+
167
+ ### Optional Provisioning Parameters
131
168
  * `instance_ready_timeout`: (Optional) The timeout to wait for an instance to become ready -- default 120 seconds.
132
169
  * `instance_check_interval`: (Optional) The interval to wait for checking an instance's state -- default 2 seconds.
133
- * `endpoint`: (Optional) The Azure Management API endpoint -- default `ENV['AZURE_MANAGEMENT_ENDPOINT']` if exists, falls back to <https://management.azure.com>.
134
- * `admin_username`: (Optional) The root/administrator username for the VM
135
- * `admin_password`: (Optional, Windows only) The password to set for the windows administrator user
136
- * `winrm_install_self_signed_cert`: (Optional, Windows only) Whether to install a self-signed cert automatically to enable WinRM to communicate over HTTPS (5986). Only available when a custom `deployment_template` is not supplied. Default 'true'.
137
- * `deployment_template`: (Optional) A custom ARM template to use instead of the default template
138
170
  * `wait_for_destroy`: (Optional) Wait for all resources to be deleted prior to completing Vagrant destroy -- default false.
171
+
172
+ ### Optional Azure Parameters
173
+ * `endpoint`: (Optional) The Azure Management API endpoint -- default `ENV['AZURE_MANAGEMENT_ENDPOINT']` if exists, falls back to <https://management.azure.com>.
174
+ * `resource_group_name`: (Optional) Name of the resource group to use.
175
+ * `location`: (Optional) Azure location to build the VM -- defaults to `westus`
176
+
177
+ ## [Extended Documentation](./docs/)
178
+ For more information on common scenarios and other features visit the [extended documentation](./docs/).
179
+
@@ -0,0 +1,17 @@
1
+
2
+ Vagrant.configure("2") do |config|
3
+ config.vm.box = "azure"
4
+
5
+ # use local ssh key to connect to remote vagrant box
6
+ config.ssh.private_key_path = "~/.ssh/id_rsa"
7
+ config.vm.provider :azure do |azure, override|
8
+ # each of the below values will default to use the env vars named as below if not specified explicitly
9
+ azure.tenant_id = ENV["AZURE_TENANT_ID"]
10
+ azure.client_id = ENV["AZURE_CLIENT_ID"]
11
+ azure.client_secret = ENV["AZURE_CLIENT_SECRET"]
12
+ azure.subscription_id = ENV["AZURE_SUBSCRIPTION_ID"]
13
+ azure.location = "westus"
14
+ end
15
+
16
+ config.vm.provision "shell", inline: "echo Hello, World"
17
+ end
@@ -0,0 +1,12 @@
1
+ # Basic Linux Machine
2
+ This scenario will build an Ubuntu 16.04 machine.
3
+
4
+ Before you attempt this scenario, ensure you have followed the [getting started docs](../../readme.md#getting-started).
5
+
6
+ ## Vagrant up
7
+ - In this directory, run the following
8
+ ```bash
9
+ vagrant up --provider=azure
10
+ ```
11
+
12
+ To clean up, run `vagrant destroy`
@@ -0,0 +1,20 @@
1
+
2
+ Vagrant.configure("2") do |config|
3
+ config.vm.box = "azure"
4
+ config.vm.provider :azure do |azure, override|
5
+
6
+ # each of the below values will default to use the env vars named as below if not specified explicitly
7
+ azure.tenant_id = ENV["AZURE_TENANT_ID"]
8
+ azure.client_id = ENV["AZURE_CLIENT_ID"]
9
+ azure.client_secret = ENV["AZURE_CLIENT_SECRET"]
10
+ azure.subscription_id = ENV["AZURE_SUBSCRIPTION_ID"]
11
+
12
+ azure.vm_image_urn = "MicrosoftSQLServer:SQL2016-WS2012R2:Express:latest"
13
+ azure.instance_ready_timeout = 600
14
+ azure.vm_password = "TopSecretPassw0rd"
15
+ azure.admin_username = "OctoAdmin"
16
+ override.winrm.transport = :ssl
17
+ override.winrm.port = 5986
18
+ override.winrm.ssl_peer_verification = false # must be false if using a self signed cert
19
+ end
20
+ end