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 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.0 (December 5, 2013)
2
-
3
- NEW FEATURES:
4
-
5
- - Automatic joining of local load balancers.
6
-
7
- ## 0.1.0 (November 18, 2013)
8
-
9
- - Initial release.
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
- group :development do
6
- gem "vagrant", :git => "git://github.com/mitchellh/vagrant.git"
7
- end
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
- [![Code Climate](https://codeclimate.com/github/audiolize/vagrant-softlayer.png)](https://codeclimate.com/github/audiolize/vagrant-softlayer)
4
-
5
- This is a [Vagrant](http://www.vagrantup.com) 1.3+ plugin that adds a [SoftLayer](http://www.softlayer.com)
6
- provider to Vagrant, allowing Vagrant to control and provision SoftLayer CCI instances.
7
-
8
- **NOTE:** This plugin requires Vagrant 1.3+
9
-
10
- ## Features
11
-
12
- * Basic lifecycle (boot, halt, reboot) of SoftLayer CCI instances.
13
- * OS reload on a CCI (`vagrant rebuild`).
14
- * SSH into the instances.
15
- * Provision the instances with any built-in Vagrant provisioner.
16
- * Minimal synced folder support via `rsync`.
17
-
18
- ## Installation
19
-
20
- ### Set the `SSL_CERT_FILE` environment variable
21
-
22
- If you intend to use the public API endpoint, which is the default, you have to
23
- set the `SSL_CERT_FILE` environment variable.
24
-
25
- The *net/http* library of the Vagrant's embedded ruby does **not**
26
- check the validity of an SSL certificate during a TLS handshake. This breaks all
27
- the calls to the SoftLayer API, making the plugin unusable.
28
-
29
- For fixing this issue, you have to make ruby aware of a certificate authority
30
- bundle by setting `SSL_CERT_FILE`:
31
-
32
- **Linux**
33
-
34
- * To set this in your current command prompt session, type:
35
-
36
- `export SSL_CERT_FILE=/opt/vagrant/embedded/cacert.pem`
37
-
38
- * To make this a permanent setting, add this in `.bashrc` or `.profile`.
39
-
40
- **Mac OS X**
41
-
42
- * To set this in your current command prompt session, type:
43
-
44
- `export SSL_CERT_FILE=/Applications/Vagrant/embedded/cacert.pem`
45
-
46
- * To make this a permanent setting, add this in `/etc/launchd.conf`.
47
-
48
- **Windows**
49
-
50
- * To set this in your current command prompt session, type:
51
-
52
- `set SSL_CERT_FILE=C:\HashiCorp\Vagrant\embedded\cacert.pem`
53
-
54
- * To make this a permanent setting, add this in your [control panel](http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/environment_variables.mspx?mfr=true).
55
-
56
- ### Plugin installation
57
-
58
- Installation is performed in the prescribed manner for Vagrant 1.1+ plugins.
59
- After installing, `vagrant up` and specify the `softlayer` provider. An example is
60
- shown below.
61
-
62
- ```
63
- $ vagrant plugin install vagrant-softlayer
64
- ...
65
- $ vagrant up --provider=softlayer
66
- ...
67
- ```
68
-
69
- Of course prior to doing this, you'll need to obtain an SoftLayer-compatible
70
- box file for Vagrant.
71
-
72
- ## Box File Format
73
-
74
- Every provider in Vagrant must introduce a custom box format. This
75
- provider introduces `softlayer` boxes. You can view an example box in
76
- the `example_box/` directory. That directory also contains instructions
77
- on how to build a box.
78
-
79
- The box format is basically just the required `metadata.json` file
80
- along with a `Vagrantfile` that does default settings for the
81
- provider-specific configuration for this provider.
82
-
83
- ## Configuration
84
-
85
- This provider exposes quite a few provider-specific configuration options:
86
-
87
- ### Authentication
88
-
89
- Parameter | Description | Default | Required
90
- -------------- | ------------------------------------ | ---------------------------------- | --------
91
- `api_key` | The API key for accessing SoftLayer | | yes
92
- `endpoint_url` | The endpoint SoftLayer API url | SoftLayer::API_PUBLIC_ENDPOINT | yes
93
- `username` | The username for accessing SoftLayer | | yes
94
-
95
- > **NOTE**
96
- >
97
- > In place of the API key and username you can use environment variables, respectively `SL_API_KEY` and `SL_USERNAME`.
98
-
99
- ### DNS Management
100
-
101
- If the DNS zone of the configured domain is hosted by SoftLayer, you can automatically manage it.
102
-
103
- Parameter | Description | Default | Required
104
- ------------ | ------------------------------------- | ------- | --------
105
- `manage_dns` | Add/remove A record on create/destroy | false | no
106
-
107
- ### Join Local Load Balancers
108
-
109
- See [Join load balancers](https://github.com/audiolize/vagrant-softlayer/wiki/Join-load-balancers).
110
-
111
- ### Instance Configuration
112
-
113
- Parameter | Description | Default | Required
114
- ------------------ | ------------------------------------------- | ----------------------- | --------
115
- `datacenter` | Datacenter shortname | First available | no
116
- `dedicated` | Allocate a dedicated CCI (non-shared host) | false | no
117
- `domain` | The domain of the instance | | yes
118
- `hostname` | The hostname of the instance | | yes *
119
- `hourly_billing` | Hourly billing type (false for monthly) | true | no
120
- `local_disk` | Use a local disk (false for SAN) | true | no
121
- `max_memory` | The amount of RAM of the instance in Mb | 1024 | no
122
- `network_speed` | Network port speed in Mbps | 10 | no
123
- `operating_system` | The instance operating system identifier | UBUNTU_LATEST | no
124
- `post_install` | URI of Post-install script to download | | no
125
- `private_only` | Only create access to the private network | false | no
126
- `ssh_key` | ID or label of the SSH key(s) to provision | | yes
127
- `start_cpus` | The number of processors of the instance | 1 | no
128
- `user_data` | User defined metadata string | | no
129
- `vlan_private` | The ID of the private VLAN | Automatically generated | no
130
- `vlan_public` | The ID of the public VLAN | Automatically generated | no
131
-
132
- \* The `hostname` could be specified either using `config.vm.hostname` or the provider parameter.
133
-
134
- These can be set like typical provider-specific configuration:
135
-
136
- ```
137
- Vagrant.configure("2") do |config|
138
- # ... other stuff
139
-
140
- config.vm.provider :softlayer do |sl|
141
- sl.api_key = "foo"
142
- sl.username = "bar"
143
- sl.ssh_key = "Vagrant insecure key"
144
- end
145
- end
146
- ```
147
-
148
- ## OS Reload
149
-
150
- Reload of an instance's operating system is performed with the `vagrant rebuild` command.
151
- The primary disk of the instance will be formatted and a fresh copy of the underlying OS
152
- will be applied. Note that only `ssh_key` and `post_install` parameter will be read
153
- during rebuild, all the other parameters will be ignored. Provisioners will always run
154
- after rebuild.
155
-
156
- ## Synced Folders
157
-
158
- There is minimal support for synced folders. Upon `vagrant up`,
159
- `vagrant reload`, and `vagrant provision`, the SoftLayer provider will use
160
- `rsync` (if available) to uni-directionally sync the folder to
161
- the remote machine over SSH.
162
-
163
- This is good enough for all built-in Vagrant provisioners (shell, ansible,
164
- chef, and puppet) to work!
165
-
166
- ## Other Examples
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
- [![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/audiolize/vagrant-softlayer/trend.png)](https://bitdeli.com/free "Bitdeli Badge")
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.