vagrant-profitbricks 1.0.0 → 4.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +4 -4
- data/README.md +326 -174
- data/Rakefile +4 -2
- data/Vagrantfile +18 -13
- data/example_box/Vagrantfile +9 -0
- data/example_box/profitbricks.box +0 -0
- data/lib/vagrant-profitbricks.rb +12 -11
- data/lib/vagrant-profitbricks/action.rb +79 -40
- data/lib/vagrant-profitbricks/action/connect_profitbricks.rb +14 -12
- data/lib/vagrant-profitbricks/action/create_server.rb +74 -67
- data/lib/vagrant-profitbricks/action/delete_server.rb +33 -13
- data/lib/vagrant-profitbricks/action/is_created.rb +3 -1
- data/lib/vagrant-profitbricks/action/list_flavors.rb +5 -3
- data/lib/vagrant-profitbricks/action/list_images.rb +6 -4
- data/lib/vagrant-profitbricks/action/message_already_created.rb +4 -2
- data/lib/vagrant-profitbricks/action/message_not_created.rb +4 -2
- data/lib/vagrant-profitbricks/action/read_ssh_info.rb +10 -16
- data/lib/vagrant-profitbricks/action/read_state.rb +19 -12
- data/lib/vagrant-profitbricks/action/reboot_server.rb +45 -0
- data/lib/vagrant-profitbricks/action/run_init_script.rb +5 -3
- data/lib/vagrant-profitbricks/action/start_server.rb +50 -0
- data/lib/vagrant-profitbricks/action/stop_server.rb +51 -0
- data/lib/vagrant-profitbricks/command/datacenters.rb +34 -0
- data/lib/vagrant-profitbricks/command/flavors.rb +19 -6
- data/lib/vagrant-profitbricks/command/images.rb +21 -20
- data/lib/vagrant-profitbricks/command/locations.rb +34 -0
- data/lib/vagrant-profitbricks/command/root.rb +28 -23
- data/lib/vagrant-profitbricks/command/servers.rb +7 -4
- data/lib/vagrant-profitbricks/command/snapshots.rb +34 -0
- data/lib/vagrant-profitbricks/command/utils.rb +27 -0
- data/lib/vagrant-profitbricks/config.rb +44 -39
- data/lib/vagrant-profitbricks/errors.rb +14 -5
- data/lib/vagrant-profitbricks/plugin.rb +13 -11
- data/lib/vagrant-profitbricks/provider.rb +8 -6
- data/lib/vagrant-profitbricks/version.rb +3 -1
- data/locales/en.yml +28 -7
- data/spec/spec_helper.rb +4 -2
- data/spec/vagrant-profitbricks/config_spec.rb +65 -96
- data/vagrant-profitbricks.gemspec +17 -14
- metadata +42 -47
- data/Appraisals +0 -35
- data/CHANGELOG.md +0 -3
- data/RELEASE.md +0 -15
- data/bootstrap.cmd +0 -16
- data/features/provision.feature +0 -36
- data/features/steps/sdk_steps.rb +0 -13
- data/features/steps/server_steps.rb +0 -25
- data/features/support/env.rb +0 -35
- data/features/support/fog_mock.rb +0 -17
- data/features/vagrant-profitbricks.feature +0 -66
- data/lib/vagrant-profitbricks/action/create_image.rb +0 -53
- data/lib/vagrant-profitbricks/action/list_keypairs.rb +0 -20
- data/lib/vagrant-profitbricks/action/list_networks.rb +0 -20
- data/lib/vagrant-profitbricks/action/list_servers.rb +0 -21
- data/lib/vagrant-profitbricks/command/create_image.rb +0 -21
- data/lib/vagrant-profitbricks/command/keypairs.rb +0 -21
- data/lib/vagrant-profitbricks/command/list_images.rb +0 -21
- data/lib/vagrant-profitbricks/command/networks.rb +0 -21
- data/spec/vagrant-profitbricks/actions/list_flavors_spec.rb +0 -48
- data/spec/vagrant-profitbricks/actions/list_images_spec.rb +0 -48
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 092e21f02ce19f5fbf581758cab5332eda8984f2
|
4
|
+
data.tar.gz: 7d5b8eedbfd563d71ce58d8a30029ebf5b6a802a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9980dc973eada92764d9ea1d1f7710efabebc677df9167a76bb40513426f82ccbec5209fb3bbe1ebf53f6e5660d405b745e038c70b9a42cf1dd6d6682e03330c
|
7
|
+
data.tar.gz: 51d5961921708eaf93c0d68e5e77e9ae005032da506fc5a8a091919f8b39b2af636cb0874c782cff3e1ee32d81cdf2e2d9392f07bccd05115cf1b19a8629e28e
|
data/Gemfile
CHANGED
@@ -1,10 +1,11 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
source 'http://rubygems.org'
|
2
4
|
|
3
5
|
# This group will not be installed on Travis
|
4
6
|
group :development do
|
5
7
|
gem 'pry'
|
6
|
-
|
7
|
-
gem 'appraisal', '~> 1.0', git: 'http://github.com/malibeg/appraisal', branch: 'gemspec_in_group'
|
8
|
+
gem 'rubocop', '~>0.51.0', require: false
|
8
9
|
end
|
9
10
|
|
10
11
|
group :test do
|
@@ -12,7 +13,6 @@ group :test do
|
|
12
13
|
end
|
13
14
|
|
14
15
|
group :plugins do
|
15
|
-
gem
|
16
|
+
gem 'vagrant', git: 'http://github.com/mitchellh/vagrant.git', branch: 'master'
|
16
17
|
gemspec
|
17
18
|
end
|
18
|
-
|
data/README.md
CHANGED
@@ -1,268 +1,420 @@
|
|
1
|
-
#
|
1
|
+
# Vagrant Plugin
|
2
|
+
|
3
|
+
Version: vagrant-profitbricks v4.0.0
|
4
|
+
|
5
|
+
## Table of Contents
|
6
|
+
|
7
|
+
* [Description](#description)
|
8
|
+
* [Getting Started](#getting-started)
|
9
|
+
* [Installation](#installation)
|
10
|
+
* [Usage](#usage)
|
11
|
+
* [Vagrant Actions](#vagrant-actions)
|
12
|
+
* [Create a Vagrant Machine](#create-a-vagrant-machine)
|
13
|
+
* [Add Vagrant Box](#add-vagrant-box)
|
14
|
+
* [SSH Into Vagrant Machine](#ssh-into-vagrant-machine)
|
15
|
+
* [Vagrant Provisioner](#vagrant-provisioner)
|
16
|
+
* [Stop Vagrant Machine](#stop-vagrant-machine)
|
17
|
+
* [Start Vagrant Machine](#start-vagrant-machine)
|
18
|
+
* [Reboot Vagrant Machine](#reboot-vagrant-machine)
|
19
|
+
* [Vagrant Commands](#vagrant-commands)
|
20
|
+
* [Datacenters](#datacenters)
|
21
|
+
* [Flavors](#flavors)
|
22
|
+
* [Images](#images)
|
23
|
+
* [Locations](#locations)
|
24
|
+
* [Snapshots](#snapshots)
|
25
|
+
* [Vagrantfile Reference](#vagrantfile-reference)
|
26
|
+
* [Examples](#examples)
|
27
|
+
* [Support](#support)
|
28
|
+
* [Testing](#testing)
|
29
|
+
* [Contributing](#contributing)
|
30
|
+
|
31
|
+
## Description
|
32
|
+
|
33
|
+
Vagrant is a tool that allows users to automatically deploy and configure local and cloud infrastructure using a consistent, declarative configuration file. The ProfitBricks plugin for Vagrant leverages the Cloud API to deploy servers directly onto the ProfitBricks platform.
|
34
|
+
|
35
|
+
## Getting Started
|
36
|
+
|
37
|
+
Before you begin you will need to have [signed-up](https://www.profitbricks.com/signup/) for a ProfitBricks account. The credentials you establish during sign-up will be used to authenticate against the [ProfitBricks Cloud API](https://devops.profitbricks.com/api/cloud/).
|
2
38
|
|
3
|
-
|
4
|
-
[ProfitBricks](https://devops.profitbricks.com) provider to Vagrant,
|
5
|
-
allowing Vagrant to control and provision machines within the ProfitBricks
|
6
|
-
cloud.
|
39
|
+
## Installation
|
7
40
|
|
8
|
-
|
41
|
+
Vagrant must first be installed. Please review the [installation documentation](https://www.vagrantup.com/docs/installation/) for details on downloading and installing Vagrant.
|
9
42
|
|
10
|
-
|
43
|
+
Then install the ProfitBricks plugin using the standard Vagrant plugin installation method.
|
11
44
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
* Sync folders with any built-in Vagrant synchronized folder plugin (e.g. `rsync`)
|
16
|
-
* Create ProfitBricks images from a running Vagrant box
|
45
|
+
```
|
46
|
+
$ vagrant plugin install vagrant-profitbricks
|
47
|
+
```
|
17
48
|
|
18
|
-
##
|
49
|
+
## Overview
|
19
50
|
|
20
|
-
|
51
|
+
A list of available operations can be accessed directly from the command line.
|
21
52
|
|
22
53
|
```
|
23
|
-
|
54
|
+
vagrant profitbricks -h
|
24
55
|
```
|
25
56
|
|
26
|
-
|
57
|
+
```
|
58
|
+
Usage: vagrant [options] <command> [<args>]
|
59
|
+
|
60
|
+
-v, --version Print the version and exit.
|
61
|
+
-h, --help Print this help.
|
62
|
+
|
63
|
+
Common commands:
|
64
|
+
box manages boxes: installation, removal, etc.
|
65
|
+
connect connect to a remotely shared Vagrant environment
|
66
|
+
destroy stops and deletes all traces of the vagrant machine
|
67
|
+
global-status outputs status Vagrant environments for this user
|
68
|
+
halt stops the vagrant machine
|
69
|
+
help shows the help for a subcommand
|
70
|
+
init initializes a new Vagrant environment by creating a Vagrantfile
|
71
|
+
login log in to HashiCorp's Vagrant Cloud
|
72
|
+
package packages a running vagrant environment into a box
|
73
|
+
plugin manages plugins: install, uninstall, update, etc.
|
74
|
+
port displays information about guest port mappings
|
75
|
+
powershell connects to machine via powershell remoting
|
76
|
+
provision provisions the vagrant machine
|
77
|
+
push deploys code in this environment to a configured destination
|
78
|
+
rdp connects to machine via RDP
|
79
|
+
reload restarts vagrant machine, loads new Vagrantfile configuration
|
80
|
+
resume resume a suspended vagrant machine
|
81
|
+
share share your Vagrant environment with anyone in the world
|
82
|
+
snapshot manages snapshots: saving, restoring, etc.
|
83
|
+
ssh connects to machine via SSH
|
84
|
+
ssh-config outputs OpenSSH valid configuration to connect to the machine
|
85
|
+
status outputs status of the vagrant machine
|
86
|
+
suspend suspends the machine
|
87
|
+
up starts and provisions the vagrant environment
|
88
|
+
validate validates the Vagrantfile
|
89
|
+
version prints current and latest Vagrant version
|
90
|
+
|
91
|
+
For help on any individual command run `vagrant COMMAND -h`
|
92
|
+
|
93
|
+
Additional subcommands are available, but are either more advanced
|
94
|
+
or not commonly used. To see all subcommands, run the command
|
95
|
+
`vagrant list-commands`.
|
96
|
+
```
|
97
|
+
|
98
|
+
If you want to retrieve list of plugin specific subcommands then run:
|
27
99
|
|
28
|
-
Once the plugin is installed, you use it with `vagrant up` by specifying
|
29
|
-
the `profitbricks` provider:
|
30
100
|
```
|
31
|
-
|
101
|
+
vagrant profitbricks
|
32
102
|
```
|
33
103
|
|
34
|
-
|
35
|
-
|
104
|
+
```
|
105
|
+
Usage: vagrant profitbricks <subcommand> [<args>]
|
36
106
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
107
|
+
Available subcommands:
|
108
|
+
datacenters
|
109
|
+
flavors
|
110
|
+
images
|
111
|
+
locations
|
112
|
+
snapshots
|
41
113
|
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
114
|
+
For help on any individual subcommand run `vagrant profitbricks <subcommand> -h`
|
115
|
+
```
|
116
|
+
|
117
|
+
You will need a `Vagrantfile` in order to properly create and configure remote servers. You can generate a sample
|
118
|
+
`Vagrantfile` with `vagrant init`. Here is an example of the ProfitBricks configuration:
|
119
|
+
|
120
|
+
```
|
121
|
+
config.ssh.private_key_path = '/path/to/.ssh/id_rsa'
|
122
|
+
|
123
|
+
config.vm.provider :profitbricks do |profitbricks|
|
124
|
+
profitbricks.username = ENV['PROFITBRICKS_USERNAME']
|
125
|
+
profitbricks.password = ENV['PROFITBRICKS_PASSWORD']
|
126
|
+
profitbricks.profitbricks_url = 'https://api.profitbricks.com/cloudapi/v4/'
|
127
|
+
profitbricks.datacenter_id = 'f98e9d49-e33b-4d59-9ac3-484f7f749b78'
|
128
|
+
profitbricks.location = 'de/fkb'
|
129
|
+
profitbricks.image_alias = 'ubuntu:latest'
|
130
|
+
profitbricks.cores = 4
|
131
|
+
profitbricks.profitbricks_ram = 4096
|
132
|
+
profitbricks.image_password = 'secretpassword123'
|
133
|
+
# Allows SSH authentication (Works with ProfitBricks supplied Linux images)
|
134
|
+
profitbricks.public_ssh_keys = [File.read('/path/to/.ssh/id_rsa.pub')]
|
50
135
|
end
|
51
136
|
```
|
52
137
|
|
53
|
-
|
54
|
-
|
138
|
+
## Vagrant Actions
|
139
|
+
|
140
|
+
Actions are Vagrant actions that allow interaction with Vagrant managed machines.
|
141
|
+
|
142
|
+
### Create a Vagrant Machine
|
143
|
+
|
144
|
+
Once the plugin is installed and `Vagrantfile` configured properly, you bring build a new machine with `vagrant up`:
|
145
|
+
|
146
|
+
```
|
147
|
+
$ vagrant up
|
148
|
+
```
|
149
|
+
|
150
|
+
### Add Vagrant Box
|
151
|
+
|
152
|
+
You may be required to use a box depending on your version of Vagrant. If necessary, you can add the "dummy" box with the command:
|
153
|
+
|
55
154
|
```
|
56
155
|
$ vagrant box add dummy https://github.com/profitbricks/vagrant-profitbricks/raw/master/dummy.box
|
57
156
|
```
|
58
|
-
Then uncomment the line containing `config.vm.box = "dummy"`.
|
59
157
|
|
158
|
+
Then add a line containing `config.vm.box = "dummy"` to the `Vagrantfile`.
|
60
159
|
|
61
|
-
|
62
|
-
|
160
|
+
### SSH Into Vagrant Machine
|
161
|
+
|
162
|
+
The user can log into the machine via SSH after server creation:
|
63
163
|
|
64
164
|
```
|
65
165
|
$ vagrant ssh
|
66
166
|
```
|
67
167
|
|
68
|
-
|
168
|
+
### Vagrant Provisioner
|
169
|
+
|
170
|
+
Any Vagrant [provisioner](https://www.vagrantup.com/docs/provisioning/) can be run on the Vagrant managed machine.
|
171
|
+
|
172
|
+
A simple shell provisioner can be can be added to the `Vagrantfile` similar to the following.
|
173
|
+
|
174
|
+
```
|
175
|
+
config.vm.provision 'shell' do |s|
|
176
|
+
s.inline = 'apt-get update && apt-get install -y'
|
177
|
+
end
|
178
|
+
```
|
179
|
+
|
180
|
+
Then run the provisioner:
|
181
|
+
|
69
182
|
```
|
70
183
|
$ vagrant provision
|
71
184
|
```
|
72
185
|
|
186
|
+
### Stop Vagrant Machine
|
73
187
|
|
188
|
+
In order to stop a Vagrant managed machine:
|
74
189
|
|
75
|
-
|
190
|
+
```
|
191
|
+
vagrant halt
|
192
|
+
```
|
76
193
|
|
77
|
-
|
78
|
-
> sudo: sorry, you must have a tty to run sudo
|
194
|
+
### Start Vagrant Machine
|
79
195
|
|
80
|
-
|
81
|
-
|
82
|
-
|
196
|
+
To start a Vagrant managed machine:
|
197
|
+
|
198
|
+
```
|
199
|
+
vagrant up
|
83
200
|
```
|
84
201
|
|
85
|
-
|
86
|
-
using this configuration for a workaround which will reconfigure the server so a tty is not required to run sudo:
|
202
|
+
### Reboot Vagrant Machine
|
87
203
|
|
88
|
-
|
89
|
-
```ruby
|
90
|
-
Vagrant.configure("2") do |config|
|
91
|
-
config.vm.box = "dummy"
|
92
|
-
config.ssh.pty = true
|
204
|
+
To reboot a Vagrant managed machine:
|
93
205
|
|
94
|
-
|
95
|
-
|
96
|
-
rs.password = "YOUR PASSWORD"
|
97
|
-
rs.profitbricks_ram = 1024
|
98
|
-
rs.profitbricks_cores = 1
|
99
|
-
rs.image = /^CentOS-7/
|
100
|
-
rs.datacenter_id = /DC_US/
|
101
|
-
end
|
102
|
-
end
|
206
|
+
```
|
207
|
+
vagrant reload
|
103
208
|
```
|
104
209
|
|
105
|
-
|
210
|
+
## Vagrant Commands
|
106
211
|
|
107
|
-
|
108
|
-
[WINRM CONFIGURATION](http://docs.vagrantup.com/v2/boxes/base.html)
|
212
|
+
Commands are plugin specific subcommands which allow users to retrieve a list of ProfitBricks resources.
|
109
213
|
|
214
|
+
To get list of available subcommands run:
|
110
215
|
|
111
|
-
|
112
|
-
|
113
|
-
Vagrant.configure("2") do |config|
|
114
|
-
config.vm.box = "dummy"
|
115
|
-
config.vm.communicator = "winrm"
|
116
|
-
config.vm.provider :profitbricks do |rs|
|
117
|
-
rs.username = "YOUR USERNAME"
|
118
|
-
rs.password = "YOUR PASSWORD"
|
119
|
-
rs.flavor = /Meduim/
|
120
|
-
rs.image = /^windows-2012-r2/
|
121
|
-
rs.profitbricks_volume_size = 30
|
122
|
-
rs.datacenter_id = /DC_US/
|
123
|
-
end
|
124
|
-
end
|
216
|
+
```
|
217
|
+
vagrant profitbricks
|
125
218
|
```
|
126
219
|
|
127
|
-
|
220
|
+
Currently the following resources are available to view.
|
128
221
|
|
129
|
-
|
222
|
+
* datacenters
|
223
|
+
* flavors
|
224
|
+
* images
|
225
|
+
* locations
|
226
|
+
* snapshots
|
130
227
|
|
131
|
-
|
132
|
-
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
133
|
-
# All Vagrant configuration is done here. The most common configuration
|
134
|
-
# options are documented and commented below. For a complete reference,
|
135
|
-
# please see the online documentation at vagrantup.com.
|
228
|
+
### Datacenters
|
136
229
|
|
137
|
-
|
138
|
-
config.vm.box = "dummy"
|
230
|
+
To retrieve list of available ProfitBricks Virtual Data Center run:
|
139
231
|
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
232
|
+
```
|
233
|
+
vagrant profitbricks datacenters
|
234
|
+
```
|
235
|
+
|
236
|
+
```
|
237
|
+
+--------------------------------------+--------------------------+
|
238
|
+
| ID | Name |
|
239
|
+
+--------------------------------------+--------------------------+
|
240
|
+
| f98e9d49-e33b-4d59-9ac3-484f7f749b78 | Vagrant Example |
|
241
|
+
+--------------------------------------+--------------------------+
|
242
|
+
```
|
243
|
+
|
244
|
+
### Flavors
|
245
|
+
|
246
|
+
To retrieve list of available flavors:
|
247
|
+
|
248
|
+
```
|
249
|
+
vagrant profitbricks flavors
|
250
|
+
```
|
150
251
|
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
252
|
+
```
|
253
|
+
+--------------------------------------+-------------------------+
|
254
|
+
| ID | Name |
|
255
|
+
+--------------------------------------+-------------------------+
|
256
|
+
| 0052db40-f1dd-4ecf-a711-5980081b7059 | Extra Large |
|
257
|
+
| 00db4c8f-5e83-49b0-a70b-ac4aad786163 | Micro |
|
258
|
+
| 1d22436d-d958-4151-b144-43a8e180c4c4 | Memory Intensive Large |
|
259
|
+
| 45c28f8b-6a67-4f69-8c94-231d371da2b6 | Memory Intensive Medium |
|
260
|
+
| 8b2b835d-be09-48cf-aae2-7e35aafe92d6 | Memory Intensive Small |
|
261
|
+
| a5a4389f-54b6-4f47-b6e8-1c5c55976b94 | Large |
|
262
|
+
| b37d000e-b347-4592-b572-df13ef8f68e1 | Medium |
|
263
|
+
| dc64957b-be9d-431e-91cd-9e217f94d3de | Small |
|
264
|
+
+--------------------------------------+-------------------------+
|
163
265
|
```
|
164
266
|
|
165
|
-
|
166
|
-
with `vagrant up --provider profitbricks <name>`.
|
267
|
+
### Images
|
167
268
|
|
168
|
-
|
169
|
-
create them one at a time or have any trouble, you can use the `--no-parallel` option.
|
269
|
+
To list all available ProfitBricks images:
|
170
270
|
|
171
|
-
|
271
|
+
```
|
272
|
+
vagrant profitbricks images
|
273
|
+
```
|
172
274
|
|
173
|
-
|
174
|
-
|
275
|
+
```
|
276
|
+
+--------------------------------------+-------------------------------------------+----------+
|
277
|
+
| ID | Name | Location |
|
278
|
+
+--------------------------------------+-------------------------------------------+----------+
|
279
|
+
| 19556107-46b5-11e7-9645-525400f64d8d | grml64-full_2017.05.iso | de/fkb |
|
280
|
+
...
|
281
|
+
...
|
282
|
+
| 3b53e0bd-84d2-11e6-9d61-52540005ab80 | windows-2008-r2-server-setup.iso | us/las |
|
283
|
+
| 6261e8bb-84a6-11e6-9d61-52540005ab80 | windows-2012-r2-server-setup.iso | de/fra |
|
284
|
+
| 6d00c53d-76b3-11e7-98fa-525400f64d8d | Fedora-Server-netinst-x86_64-26-1.5.iso | us/las |
|
285
|
+
+--------------------------------------+-------------------------------------------+----------+
|
286
|
+
```
|
175
287
|
|
176
|
-
###
|
288
|
+
### Locations
|
177
289
|
|
178
|
-
|
290
|
+
A list of all ProfitBricks locations is available:
|
179
291
|
|
180
292
|
```
|
181
|
-
|
293
|
+
vagrant profitbricks locations
|
182
294
|
```
|
183
295
|
|
184
296
|
```
|
185
|
-
|
297
|
+
+--------+-----------+
|
298
|
+
| ID | Name |
|
299
|
+
+--------+-----------+
|
300
|
+
| de/fkb | karlsruhe |
|
301
|
+
| de/fra | frankfurt |
|
302
|
+
| us/ewr | newark |
|
303
|
+
| us/las | lasvegas |
|
304
|
+
+--------+-----------+
|
186
305
|
```
|
187
306
|
|
188
|
-
|
189
|
-
|
190
|
-
|
307
|
+
### Snapshots
|
308
|
+
|
309
|
+
To retrieve list of all snapshots within user account you can use this subcommand:
|
191
310
|
|
192
311
|
```
|
193
|
-
|
194
|
-
$ vagrant profitbricks flavors <name>
|
312
|
+
vagrant profitbricks snapshots
|
195
313
|
```
|
196
314
|
|
197
|
-
|
315
|
+
```
|
316
|
+
+--------------------------------------+-----------------------------------+
|
317
|
+
| ID | Name |
|
318
|
+
+--------------------------------------+-----------------------------------+
|
319
|
+
| 1e946713-3fec-464d-9fd3-bfc5345f273e | snapshot1 |
|
320
|
+
| 8571fda2-57c6-4b73-b827-88cc7e3f7638 | snapshot2 |
|
321
|
+
| ad225f22-f154-4c12-aa55-1ec9026c494d | snapshot3 |
|
322
|
+
+--------------------------------------+-----------------------------------+
|
323
|
+
```
|
198
324
|
|
199
|
-
##
|
325
|
+
## Vagrantfile Reference
|
200
326
|
|
201
|
-
This provider exposes
|
327
|
+
This provider exposes some provider-specific configuration options:
|
202
328
|
|
203
329
|
| NAME| DESCRIPTION |
|
204
330
|
|---|---|
|
205
|
-
| datacenter_id |
|
206
|
-
| username |
|
207
|
-
| password |
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
331
|
+
| datacenter_id | Virtual Data Center ID where machines will be managed. |
|
332
|
+
| username | Your ProfitBricks username. |
|
333
|
+
| password | Your ProfitBricks password. |
|
334
|
+
| flavor | A predefined server [flavor](#flavor) to use. This can be a string matching the exact UUID or name of the server. Or this can be a regular expression to partially match a server flavor name. |
|
335
|
+
| cores | The number of server cores to allocate. This is as an alternative to a flavor. |
|
336
|
+
| ram | The amount of server memory in MB to allocate. This is as an alternative to a flavor. |
|
337
|
+
| volume_size | The size of the volume in GB. |
|
338
|
+
| volume_type | Disk volume type (SSD or HDD). Defaults to **SSD** if not specified. |
|
339
|
+
| volume_licence_type | The licence type of the volume. Options: LINUX, WINDOWS, UNKNOWN, OTHER. You will need to provide either the `image` or the `volume_licence_type` option. |
|
340
|
+
| volume_availability_zone | The storage availability zone assigned to the volume. Valid values: AUTO, ZONE_1, ZONE_2, or ZONE_3. This only applies to HDD volumes. Leave blank or set to AUTO when provisioning SSD volumes. Will default to **AUTO** if not specified. |
|
214
341
|
| image | The server image to boot. This can be a string matching the exact ID or name of the image or this can be a regular expression to partially match some image. |
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
342
|
+
| image_alias | The server image to boot. This has to be a string matching the exact name of the image_alias for e.g. `ubuntu:latest`, `coreos:latest` |
|
343
|
+
| image_password | One-time password is set on the image for the appropriate administrative account. This field may only be set on creation requests. When reading, it always returns null. Password has to contain 8-50 alphanumeric characters. |
|
344
|
+
| public_ssh_keys | Public SSH keys to allow server authentication. |
|
345
|
+
| profitbricks_url | Allows the ProfitBricks Cloud API URL to be overridden. |
|
346
|
+
| server_name | The server name defaults to the name of the Vagrant machine (via `config.vm.define`), but can be overridden with this option. |
|
347
|
+
| location | Specify location for the datacenter if one needs to be created. Defaults to **us/las**. |
|
348
|
+
| cpu_family | Sets the CPU type to "AMD_OPTERON" or "INTEL_XEON". Defaults to **AMD_OPTERON**. |
|
349
|
+
| lan_id | The LAN ID that the network interface (NIC) will connect to. If the LAN ID does not exist it will be created. |
|
350
|
+
| nat | Indicates the private IP address has outbound access to the public internet. Defaults to **false**. |
|
351
|
+
|
352
|
+
---
|
353
|
+
|
354
|
+
## Examples
|
355
|
+
|
356
|
+
If you wish to create multiple Vagrant machines using the ProfitBricks plugin, you can add the following to your `Vagrantfile`:
|
357
|
+
|
358
|
+
```
|
359
|
+
Vagrant.configure('2') do |config|
|
360
|
+
|
361
|
+
config.ssh.private_key_path = '/path/to/.ssh/id_rsa'
|
362
|
+
public_ssh_keys = [ File.read('/path/to/.ssh/id_rsa.pub') ]
|
363
|
+
|
364
|
+
config.vm.define :node1 do |node|
|
365
|
+
node.vm.provider :profitbricks do |pb|
|
366
|
+
pb.datacenter_id = '186d27a5-cda0-44fb-b852-18add4d1a1f5'
|
367
|
+
pb.username = ENV['PROFITBRICKS_USERNAME']
|
368
|
+
pb.password = ENV['PROFITBRICKS_PASSWORD']
|
369
|
+
pb.public_ssh_keys = public_ssh_keys
|
370
|
+
pb.cores = 2
|
371
|
+
pb.ram = 4096
|
372
|
+
pb.image_alias = 'ubuntu:latest'
|
373
|
+
end
|
374
|
+
end
|
375
|
+
|
376
|
+
config.vm.define :node2 do |node|
|
377
|
+
node.ssh.pty = true
|
378
|
+
node.vm.provider :profitbricks do |pb|
|
379
|
+
pb.datacenter_id = '186d27a5-cda0-44fb-b852-18add4d1a1f5'
|
380
|
+
pb.username = ENV['PROFITBRICKS_USERNAME']
|
381
|
+
pb.password = ENV['PROFITBRICKS_PASSWORD']
|
382
|
+
pb.public_ssh_keys = public_ssh_keys
|
383
|
+
pb.flavor = /Micro/
|
384
|
+
pb.image_alias = 'centos:latest'
|
385
|
+
end
|
233
386
|
end
|
234
387
|
end
|
235
388
|
```
|
236
389
|
|
237
|
-
|
390
|
+
This `Vagrantfile` will create two Vagrant machines named `ubuntu` and `centos`.
|
238
391
|
|
239
|
-
|
392
|
+
## Support
|
240
393
|
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
394
|
+
* A guide and reference documentation can be found in the repo docs/ directory.
|
395
|
+
* [ProfitBricks REST API](https://devops.profitbricks.com/api/rest/) documentation.
|
396
|
+
* Ask a question or discuss at [ProfitBricks DevOps Central](https://devops.profitbricks.com/community).
|
397
|
+
* Report an [issue here](hhttps://github.com/profitbricks/vagrant-profitbricks/issues).
|
245
398
|
|
246
|
-
##
|
399
|
+
## Testing
|
247
400
|
|
248
|
-
To work on the `vagrant-profitbricks` plugin, clone this repository
|
249
|
-
[Bundler](http://gembundler.com) to
|
401
|
+
To work on the `vagrant-profitbricks` plugin, clone this repository and use
|
402
|
+
[Bundler](http://gembundler.com) to fetch the dependencies:
|
250
403
|
|
251
404
|
```
|
252
|
-
$ bundle
|
405
|
+
$ bundle install
|
253
406
|
```
|
254
407
|
|
255
|
-
Once you have the dependencies, verify the unit tests pass with
|
408
|
+
Once you have the dependencies, verify the unit tests pass with:
|
256
409
|
|
257
410
|
```
|
258
|
-
$
|
411
|
+
$ rspec spec/
|
259
412
|
```
|
260
413
|
|
261
|
-
|
262
|
-
the plugin without installing it into your Vagrant environment by just
|
263
|
-
creating a `Vagrantfile` in the top level of this directory (it is gitignored)
|
264
|
-
that uses it and use bundler to execute Vagrant:
|
414
|
+
## Contributing
|
265
415
|
|
266
|
-
|
267
|
-
|
268
|
-
|
416
|
+
1. Fork it ( https://github.com/[my-github-username]/vagrant-profitbricks/fork )
|
417
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
418
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
419
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
420
|
+
5. Create a new Pull Request
|