vagrant-softlayer 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +17 -15
- data/CHANGELOG.md +18 -9
- data/Gemfile +12 -7
- data/README.md +247 -243
- data/contrib/README.md +11 -0
- data/contrib/vagrant-softlayer-boxes +408 -0
- data/lib/vagrant-softlayer/action/create_instance.rb +58 -54
- data/lib/vagrant-softlayer/action/join_load_balancer.rb +95 -95
- data/lib/vagrant-softlayer/action/resume_instance.rb +21 -0
- data/lib/vagrant-softlayer/action/setup_softlayer.rb +38 -37
- data/lib/vagrant-softlayer/action/suspend_instance.rb +21 -0
- data/lib/vagrant-softlayer/action/sync_folders.rb +1 -1
- data/lib/vagrant-softlayer/action/update_dns.rb +94 -94
- data/lib/vagrant-softlayer/action/wait_for_provision.rb +40 -40
- data/lib/vagrant-softlayer/action.rb +242 -208
- data/lib/vagrant-softlayer/config.rb +246 -229
- data/lib/vagrant-softlayer/version.rb +5 -5
- data/locales/en.yml +206 -170
- data/spec/vagrant-softlayer/config_spec.rb +261 -227
- data/vagrant-softlayer.gemspec +3 -1
- metadata +20 -31
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 2b2b2039aae0b6b5559deb4505679e2e7343c5eb
|
4
|
+
data.tar.gz: 6158fd6ce69054c442d03a1c6dc7f215538f10d0
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: c41c92727019c95d5cee5166da1723bd957e86b160cb3bd49c2e99193bb43f9ddbd68ce42122defa991038e41550397e7b940594d4f0406a9bb056e52cc92b20
|
7
|
+
data.tar.gz: d3cc88c2bcc0a1d9444d1253f9ff0002f122052a6b0d1d4a72e772f219dfde22b57bd35ed25008801b362d12d0a49efcaf0045161ffca37328c8e957e24b259f
|
data/.gitignore
CHANGED
@@ -1,15 +1,17 @@
|
|
1
|
-
.DS_Store
|
2
|
-
|
3
|
-
.bundle
|
4
|
-
pkg/*
|
5
|
-
Gemfile.lock
|
6
|
-
|
7
|
-
.rspec
|
8
|
-
|
9
|
-
.vagrant
|
10
|
-
.vagrant.d/*
|
11
|
-
Vagrantfile
|
12
|
-
|
13
|
-
# Miscellaneous local stuff
|
14
|
-
example_box/*.box
|
15
|
-
scripts/*
|
1
|
+
.DS_Store
|
2
|
+
|
3
|
+
.bundle
|
4
|
+
pkg/*
|
5
|
+
Gemfile.lock
|
6
|
+
|
7
|
+
.rspec
|
8
|
+
|
9
|
+
.vagrant
|
10
|
+
.vagrant.d/*
|
11
|
+
Vagrantfile
|
12
|
+
|
13
|
+
# Miscellaneous local stuff
|
14
|
+
example_box/*.box
|
15
|
+
scripts/*
|
16
|
+
|
17
|
+
*~
|
data/CHANGELOG.md
CHANGED
@@ -1,9 +1,18 @@
|
|
1
|
-
## 0.
|
2
|
-
|
3
|
-
NEW FEATURES:
|
4
|
-
|
5
|
-
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
1
|
+
## 0.3.0 (unreleased)
|
2
|
+
|
3
|
+
NEW FEATURES:
|
4
|
+
|
5
|
+
- Add selection of disk sizes for templates.
|
6
|
+
- Add selection of block devices by id.
|
7
|
+
- Add vagrant-softlayer-boxes contrib tool for creating boxes.
|
8
|
+
- Add suspend/resume commands.
|
9
|
+
|
10
|
+
## 0.2.0 (December 5, 2013)
|
11
|
+
|
12
|
+
NEW FEATURES:
|
13
|
+
|
14
|
+
- Automatic joining of local load balancers.
|
15
|
+
|
16
|
+
## 0.1.0 (November 18, 2013)
|
17
|
+
|
18
|
+
- Initial release.
|
data/Gemfile
CHANGED
@@ -1,7 +1,12 @@
|
|
1
|
-
source 'https://rubygems.org'
|
2
|
-
|
3
|
-
gemspec
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
1
|
+
source 'https://rubygems.org'
|
2
|
+
|
3
|
+
gemspec
|
4
|
+
|
5
|
+
# Warning: Hack below.
|
6
|
+
#
|
7
|
+
# Add the current project gem to the "plugins" group
|
8
|
+
dependencies.find { |dep| dep.name == "vagrant-softlayer" }.instance_variable_set(:@groups, [:default, :plugins])
|
9
|
+
|
10
|
+
group :development do
|
11
|
+
gem "vagrant", :git => "git://github.com/mitchellh/vagrant.git"
|
12
|
+
end
|
data/README.md
CHANGED
@@ -1,243 +1,247 @@
|
|
1
|
-
# Vagrant SoftLayer Provider
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
*
|
16
|
-
*
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
###
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
`
|
92
|
-
`
|
93
|
-
`
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
### Override SSH Username
|
169
|
-
|
170
|
-
If you're running Vagrant with an user different from root, probably you need
|
171
|
-
to override the username used for ssh connection. You can do it using the standard
|
172
|
-
Vagrant syntax:
|
173
|
-
|
174
|
-
```
|
175
|
-
Vagrant.configure("2") do |config|
|
176
|
-
# ... other stuff
|
177
|
-
|
178
|
-
config.vm.provider :softlayer do |sl, override|
|
179
|
-
# ... other stuff
|
180
|
-
|
181
|
-
override.ssh.username = "root"
|
182
|
-
end
|
183
|
-
end
|
184
|
-
```
|
185
|
-
|
186
|
-
### Multiple SSH keys
|
187
|
-
|
188
|
-
Multiple SSH keys to be provisioned could be specified using an array:
|
189
|
-
|
190
|
-
```
|
191
|
-
Vagrant.configure("2") do |config|
|
192
|
-
# ... other stuff
|
193
|
-
|
194
|
-
config.vm.provider :softlayer do |sl|
|
195
|
-
sl.api_key = "foo"
|
196
|
-
sl.username = "bar"
|
197
|
-
# ssh_keys is just an alias of ssh_key
|
198
|
-
sl.ssh_keys = ["Vagrant insecure key", "My personal key"]
|
199
|
-
end
|
200
|
-
end
|
201
|
-
```
|
202
|
-
|
203
|
-
Also, a bunch of aliases for the `ssh_key` parameter are provided for better semantic:
|
204
|
-
|
205
|
-
* `ssh_keys`
|
206
|
-
* `ssh_key_id`
|
207
|
-
* `ssh_key_ids`
|
208
|
-
* `ssh_key_name`
|
209
|
-
* `ssh_key_names`
|
210
|
-
|
211
|
-
## Development
|
212
|
-
|
213
|
-
To work on the `vagrant-softlayer` plugin, clone this repository out, and use
|
214
|
-
[Bundler](http://gembundler.com) to get the dependencies:
|
215
|
-
|
216
|
-
```
|
217
|
-
$ bundle
|
218
|
-
```
|
219
|
-
|
220
|
-
Once you have the dependencies, verify the unit tests pass with `rake`:
|
221
|
-
|
222
|
-
```
|
223
|
-
$ bundle exec rake
|
224
|
-
```
|
225
|
-
|
226
|
-
If those pass, you're ready to start developing the plugin. You can test
|
227
|
-
the plugin without installing it into your Vagrant environment by just
|
228
|
-
creating a `Vagrantfile` in the top level of this directory (it is gitignored)
|
229
|
-
and add the following line to your `Vagrantfile`:
|
230
|
-
|
231
|
-
```
|
232
|
-
Vagrant.require_plugin "vagrant-softlayer"
|
233
|
-
```
|
234
|
-
|
235
|
-
Use bundler to execute Vagrant:
|
236
|
-
|
237
|
-
```
|
238
|
-
$ bundle exec vagrant up --provider=softlayer
|
239
|
-
```
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
1
|
+
# Vagrant SoftLayer Provider
|
2
|
+
|
3
|
+
<span class="badges">
|
4
|
+
[![Gem Version](https://badge.fury.io/rb/vagrant-softlayer.png)](http://badge.fury.io/rb/vagrant-softlayer)
|
5
|
+
[![Code Climate](https://codeclimate.com/github/audiolize/vagrant-softlayer.png)](https://codeclimate.com/github/audiolize/vagrant-softlayer)
|
6
|
+
</span>
|
7
|
+
|
8
|
+
This is a [Vagrant](http://www.vagrantup.com) plugin that adds a [SoftLayer](http://www.softlayer.com)
|
9
|
+
provider to Vagrant, allowing Vagrant to control and provision SoftLayer CCI instances.
|
10
|
+
|
11
|
+
**NOTE:** This plugin work with Vagrant 1.3+, altough Vagrant 1.4+ is strongly advised.
|
12
|
+
|
13
|
+
## Features
|
14
|
+
|
15
|
+
* Basic lifecycle (boot, halt, reboot, suspend, resume) of SoftLayer CCI instances.
|
16
|
+
* OS reload on a CCI (`vagrant rebuild`).
|
17
|
+
* SSH into the instances.
|
18
|
+
* Provision the instances with any built-in Vagrant provisioner.
|
19
|
+
* Minimal synced folder support via `rsync`.
|
20
|
+
|
21
|
+
## Installation
|
22
|
+
|
23
|
+
> **NOTE**
|
24
|
+
>
|
25
|
+
> If you're using Vagrant 1.3, you need to [Set the SSL_CERT_FILE environment variable](https://github.com/audiolize/vagrant-softlayer/wiki/The-SSL_CERT_FILE-environment-variable) first.
|
26
|
+
|
27
|
+
Installation is performed in the prescribed manner for Vagrant 1.1+ plugins.
|
28
|
+
After installing, `vagrant up` and specify the `softlayer` provider. An example is
|
29
|
+
shown below.
|
30
|
+
|
31
|
+
```
|
32
|
+
$ vagrant plugin install vagrant-softlayer
|
33
|
+
...
|
34
|
+
$ vagrant up --provider=softlayer
|
35
|
+
...
|
36
|
+
```
|
37
|
+
|
38
|
+
Of course prior to doing this, you'll need to obtain an SoftLayer-compatible
|
39
|
+
box file for Vagrant.
|
40
|
+
|
41
|
+
## Box File Format
|
42
|
+
|
43
|
+
Every provider in Vagrant must introduce a custom box format. This
|
44
|
+
provider introduces `softlayer` boxes. You can view an example box in
|
45
|
+
the `example_box/` directory. That directory also contains instructions
|
46
|
+
on how to build a box.
|
47
|
+
|
48
|
+
The box format is basically just the required `metadata.json` file
|
49
|
+
along with a `Vagrantfile` that does default settings for the
|
50
|
+
provider-specific configuration for this provider.
|
51
|
+
|
52
|
+
## Configuration
|
53
|
+
|
54
|
+
This provider exposes quite a few provider-specific configuration options:
|
55
|
+
|
56
|
+
### Authentication
|
57
|
+
|
58
|
+
Parameter | Description | Default | Required
|
59
|
+
-------------- | ------------------------------------ | ---------------------------------- | --------
|
60
|
+
`api_key` | The API key for accessing SoftLayer | | yes
|
61
|
+
`endpoint_url` | The endpoint SoftLayer API url | SoftLayer::API_PUBLIC_ENDPOINT | yes
|
62
|
+
`username` | The username for accessing SoftLayer | | yes
|
63
|
+
|
64
|
+
> **NOTE**
|
65
|
+
>
|
66
|
+
> In place of the API key and username you can use environment variables, respectively `SL_API_KEY` and `SL_USERNAME`.
|
67
|
+
|
68
|
+
### DNS Management
|
69
|
+
|
70
|
+
If the DNS zone of the configured domain is hosted by SoftLayer, you can automatically manage it.
|
71
|
+
|
72
|
+
Parameter | Description | Default | Required
|
73
|
+
------------ | ------------------------------------- | ------- | --------
|
74
|
+
`manage_dns` | Add/remove A record on create/destroy | false | no
|
75
|
+
|
76
|
+
### Join Local Load Balancers
|
77
|
+
|
78
|
+
See [Join load balancers](https://github.com/audiolize/vagrant-softlayer/wiki/Join-load-balancers).
|
79
|
+
|
80
|
+
### Instance Configuration
|
81
|
+
|
82
|
+
Parameter | Description | Default | Required
|
83
|
+
------------------ | ---------------------------------------------------------- | ----------------------- | --------
|
84
|
+
`datacenter` | Datacenter shortname | First available | no
|
85
|
+
`dedicated` | Allocate a dedicated CCI (non-shared host) | false | no
|
86
|
+
`disk_capacity` | The capacity of each disk | | no **
|
87
|
+
`domain` | The domain of the instance | | yes
|
88
|
+
`hostname` | The hostname of the instance | | yes *
|
89
|
+
`hourly_billing` | Hourly billing type (false for monthly) | true | no
|
90
|
+
`image_guid` | The global identifier for the compute or flex image to use | | no **
|
91
|
+
`local_disk` | Use a local disk (false for SAN) | true | no
|
92
|
+
`max_memory` | The amount of RAM of the instance in Mb | 1024 | no
|
93
|
+
`network_speed` | Network port speed in Mbps | 10 | no
|
94
|
+
`operating_system` | The instance operating system identifier | UBUNTU_LATEST | no **
|
95
|
+
`post_install` | URI of Post-install script to download | | no
|
96
|
+
`private_only` | Only create access to the private network | false | no
|
97
|
+
`ssh_key` | ID or label of the SSH key(s) to provision | | yes
|
98
|
+
`start_cpus` | The number of processors of the instance | 1 | no
|
99
|
+
`user_data` | User defined metadata string | | no
|
100
|
+
`vlan_private` | The ID of the private VLAN | Automatically generated | no
|
101
|
+
`vlan_public` | The ID of the public VLAN | Automatically generated | no
|
102
|
+
|
103
|
+
\* The `hostname` could be specified either using `config.vm.hostname` or the provider parameter.
|
104
|
+
|
105
|
+
\** When defining the instance you can either specify an `image_guid` or `operating_system` with optional `disk_capacity`.
|
106
|
+
|
107
|
+
These can be set like typical provider-specific configuration:
|
108
|
+
|
109
|
+
```
|
110
|
+
Vagrant.configure("2") do |config|
|
111
|
+
# ... other stuff
|
112
|
+
|
113
|
+
config.vm.provider :softlayer do |sl|
|
114
|
+
sl.api_key = "foo"
|
115
|
+
sl.username = "bar"
|
116
|
+
sl.ssh_key = "Vagrant insecure key"
|
117
|
+
end
|
118
|
+
end
|
119
|
+
```
|
120
|
+
|
121
|
+
## OS Reload
|
122
|
+
|
123
|
+
Reload of an instance's operating system is performed with the `vagrant rebuild` command.
|
124
|
+
The primary disk of the instance will be formatted and a fresh copy of the underlying OS
|
125
|
+
will be applied. Note that only `ssh_key` and `post_install` parameter will be read
|
126
|
+
during rebuild, all the other parameters will be ignored. Provisioners will always run
|
127
|
+
after rebuild.
|
128
|
+
|
129
|
+
## Synced Folders
|
130
|
+
|
131
|
+
There is minimal support for synced folders. Upon `vagrant up`,
|
132
|
+
`vagrant reload`, and `vagrant provision`, the SoftLayer provider will use
|
133
|
+
`rsync` (if available) to uni-directionally sync the folder to
|
134
|
+
the remote machine over SSH.
|
135
|
+
|
136
|
+
This is good enough for all built-in Vagrant provisioners (shell, ansible,
|
137
|
+
chef, and puppet) to work!
|
138
|
+
|
139
|
+
## Other Examples
|
140
|
+
|
141
|
+
### Multiple disks
|
142
|
+
|
143
|
+
The `disk_capacity` parameter accepts an hash with the following structure:
|
144
|
+
|
145
|
+
```
|
146
|
+
{
|
147
|
+
disk_id => disk_size,
|
148
|
+
disk_id => disk_size,
|
149
|
+
...
|
150
|
+
}
|
151
|
+
```
|
152
|
+
|
153
|
+
Disk ID 1 is reserved is reserved for swap space, in the following example two disks
|
154
|
+
of 25Gb and 100Gb will be provisioned:
|
155
|
+
|
156
|
+
```
|
157
|
+
Vagrant.configure("2") do |config|
|
158
|
+
# ... other stuff
|
159
|
+
|
160
|
+
config.vm.provider :softlayer do |sl, override|
|
161
|
+
# ... other stuff
|
162
|
+
|
163
|
+
sl.disk_capacity = { 0 => 25, 2 => 100 }
|
164
|
+
end
|
165
|
+
end
|
166
|
+
```
|
167
|
+
|
168
|
+
### Override SSH Username
|
169
|
+
|
170
|
+
If you're running Vagrant with an user different from root, probably you need
|
171
|
+
to override the username used for ssh connection. You can do it using the standard
|
172
|
+
Vagrant syntax:
|
173
|
+
|
174
|
+
```
|
175
|
+
Vagrant.configure("2") do |config|
|
176
|
+
# ... other stuff
|
177
|
+
|
178
|
+
config.vm.provider :softlayer do |sl, override|
|
179
|
+
# ... other stuff
|
180
|
+
|
181
|
+
override.ssh.username = "root"
|
182
|
+
end
|
183
|
+
end
|
184
|
+
```
|
185
|
+
|
186
|
+
### Multiple SSH keys
|
187
|
+
|
188
|
+
Multiple SSH keys to be provisioned could be specified using an array:
|
189
|
+
|
190
|
+
```
|
191
|
+
Vagrant.configure("2") do |config|
|
192
|
+
# ... other stuff
|
193
|
+
|
194
|
+
config.vm.provider :softlayer do |sl|
|
195
|
+
sl.api_key = "foo"
|
196
|
+
sl.username = "bar"
|
197
|
+
# ssh_keys is just an alias of ssh_key
|
198
|
+
sl.ssh_keys = ["Vagrant insecure key", "My personal key"]
|
199
|
+
end
|
200
|
+
end
|
201
|
+
```
|
202
|
+
|
203
|
+
Also, a bunch of aliases for the `ssh_key` parameter are provided for better semantic:
|
204
|
+
|
205
|
+
* `ssh_keys`
|
206
|
+
* `ssh_key_id`
|
207
|
+
* `ssh_key_ids`
|
208
|
+
* `ssh_key_name`
|
209
|
+
* `ssh_key_names`
|
210
|
+
|
211
|
+
## Development
|
212
|
+
|
213
|
+
To work on the `vagrant-softlayer` plugin, clone this repository out, and use
|
214
|
+
[Bundler](http://gembundler.com) to get the dependencies:
|
215
|
+
|
216
|
+
```
|
217
|
+
$ bundle
|
218
|
+
```
|
219
|
+
|
220
|
+
Once you have the dependencies, verify the unit tests pass with `rake`:
|
221
|
+
|
222
|
+
```
|
223
|
+
$ bundle exec rake
|
224
|
+
```
|
225
|
+
|
226
|
+
If those pass, you're ready to start developing the plugin. You can test
|
227
|
+
the plugin without installing it into your Vagrant environment by just
|
228
|
+
creating a `Vagrantfile` in the top level of this directory (it is gitignored)
|
229
|
+
and add the following line to your `Vagrantfile`:
|
230
|
+
|
231
|
+
```
|
232
|
+
Vagrant.require_plugin "vagrant-softlayer"
|
233
|
+
```
|
234
|
+
|
235
|
+
Use bundler to execute Vagrant:
|
236
|
+
|
237
|
+
```
|
238
|
+
$ bundle exec vagrant up --provider=softlayer
|
239
|
+
```
|
240
|
+
|
241
|
+
## Credits
|
242
|
+
|
243
|
+
Emiliano Ticci (@emyl)
|
244
|
+
Julio Lajara (@ju2wheels)
|
245
|
+
|
246
|
+
[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/audiolize/vagrant-softlayer/trend.png)](https://bitdeli.com/free "Bitdeli Badge")
|
247
|
+
|
data/contrib/README.md
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
# vagrant-softlayer Contrib
|
2
|
+
|
3
|
+
Miscellaneous contributions which assist people in using vagrant-softlayer will
|
4
|
+
make their way into this directory. An up-to-date list of short descriptions
|
5
|
+
for each item will be kept below.
|
6
|
+
|
7
|
+
## List of Contrib Items
|
8
|
+
|
9
|
+
* `vagrant-softlayer-boxes` - Vagrant box creation tool which allows you to create
|
10
|
+
starter boxes from those offered in the SoftLayer API or from public/private compute
|
11
|
+
or flex images associated with your SoftLayer account.
|