vagrant-hp 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +59 -59
- data/CHANGELOG.md +6 -3
- data/Gemfile +10 -10
- data/LICENSE +9 -0
- data/README.md +172 -167
- data/Rakefile +21 -21
- data/example_box/README.md +13 -13
- data/example_box/Vagrantfile +7 -7
- data/example_box/metadata.json +3 -3
- data/lib/vagrant-hp.rb +18 -18
- data/lib/vagrant-hp/action.rb +110 -110
- data/lib/vagrant-hp/action/connect_hp.rb +54 -54
- data/lib/vagrant-hp/action/create_server.rb +124 -121
- data/lib/vagrant-hp/action/delete_server.rb +30 -30
- data/lib/vagrant-hp/action/halt_server.rb +30 -30
- data/lib/vagrant-hp/action/is_created.rb +23 -23
- data/lib/vagrant-hp/action/is_running.rb +23 -23
- data/lib/vagrant-hp/action/message_already_created.rb +21 -21
- data/lib/vagrant-hp/action/message_not_created.rb +21 -21
- data/lib/vagrant-hp/action/read_ssh_info.rb +51 -51
- data/lib/vagrant-hp/action/read_state.rb +43 -43
- data/lib/vagrant-hp/action/sync_folders.rb +63 -63
- data/lib/vagrant-hp/action/timed_provision.rb +27 -27
- data/lib/vagrant-hp/action/warn_networks.rb +24 -24
- data/lib/vagrant-hp/config.rb +159 -157
- data/lib/vagrant-hp/errors.rb +24 -24
- data/lib/vagrant-hp/plugin.rb +78 -78
- data/lib/vagrant-hp/provider.rb +55 -55
- data/lib/vagrant-hp/util/timer.rb +17 -17
- data/lib/vagrant-hp/version.rb +10 -10
- data/locales/en.yml +91 -91
- data/spec/vagrant-hp/config_spec.rb +42 -42
- data/vagrant-hp.gemspec +59 -59
- metadata +4 -3
data/.gitignore
CHANGED
@@ -1,60 +1,60 @@
|
|
1
|
-
# Compiled source #
|
2
|
-
###################
|
3
|
-
*.com
|
4
|
-
*.class
|
5
|
-
*.dll
|
6
|
-
*.exe
|
7
|
-
*.o
|
8
|
-
*.so
|
9
|
-
|
10
|
-
# Packages #
|
11
|
-
############
|
12
|
-
# it's better to unpack these files and commit the raw source
|
13
|
-
# git has its own built in compression methods
|
14
|
-
*.7z
|
15
|
-
*.dmg
|
16
|
-
*.gz
|
17
|
-
*.iso
|
18
|
-
*.jar
|
19
|
-
*.rar
|
20
|
-
*.tar
|
21
|
-
*.zip
|
22
|
-
|
23
|
-
# Logs and databases #
|
24
|
-
######################
|
25
|
-
*.log
|
26
|
-
*.sql
|
27
|
-
*.sqlite
|
28
|
-
|
29
|
-
# OS generated files #
|
30
|
-
######################
|
31
|
-
.DS_Store
|
32
|
-
.DS_Store?
|
33
|
-
._*
|
34
|
-
.Spotlight-V100
|
35
|
-
.Trashes
|
36
|
-
Icon?
|
37
|
-
ehthumbs.db
|
38
|
-
Thumbs.db
|
39
|
-
|
40
|
-
# Ruby file #
|
41
|
-
#############
|
42
|
-
Gemfile.lock
|
43
|
-
*.gem
|
44
|
-
*.rbc
|
45
|
-
.bundle
|
46
|
-
.config
|
47
|
-
coverage
|
48
|
-
InstalledFiles
|
49
|
-
lib/bundler/man
|
50
|
-
pkg
|
51
|
-
rdoc
|
52
|
-
spec/reports
|
53
|
-
test/tmp
|
54
|
-
test/version_tmp
|
55
|
-
tmp
|
56
|
-
|
57
|
-
# YARD artifacts
|
58
|
-
.yardoc
|
59
|
-
_yardoc
|
1
|
+
# Compiled source #
|
2
|
+
###################
|
3
|
+
*.com
|
4
|
+
*.class
|
5
|
+
*.dll
|
6
|
+
*.exe
|
7
|
+
*.o
|
8
|
+
*.so
|
9
|
+
|
10
|
+
# Packages #
|
11
|
+
############
|
12
|
+
# it's better to unpack these files and commit the raw source
|
13
|
+
# git has its own built in compression methods
|
14
|
+
*.7z
|
15
|
+
*.dmg
|
16
|
+
*.gz
|
17
|
+
*.iso
|
18
|
+
*.jar
|
19
|
+
*.rar
|
20
|
+
*.tar
|
21
|
+
*.zip
|
22
|
+
|
23
|
+
# Logs and databases #
|
24
|
+
######################
|
25
|
+
*.log
|
26
|
+
*.sql
|
27
|
+
*.sqlite
|
28
|
+
|
29
|
+
# OS generated files #
|
30
|
+
######################
|
31
|
+
.DS_Store
|
32
|
+
.DS_Store?
|
33
|
+
._*
|
34
|
+
.Spotlight-V100
|
35
|
+
.Trashes
|
36
|
+
Icon?
|
37
|
+
ehthumbs.db
|
38
|
+
Thumbs.db
|
39
|
+
|
40
|
+
# Ruby file #
|
41
|
+
#############
|
42
|
+
Gemfile.lock
|
43
|
+
*.gem
|
44
|
+
*.rbc
|
45
|
+
.bundle
|
46
|
+
.config
|
47
|
+
coverage
|
48
|
+
InstalledFiles
|
49
|
+
lib/bundler/man
|
50
|
+
pkg
|
51
|
+
rdoc
|
52
|
+
spec/reports
|
53
|
+
test/tmp
|
54
|
+
test/version_tmp
|
55
|
+
tmp
|
56
|
+
|
57
|
+
# YARD artifacts
|
58
|
+
.yardoc
|
59
|
+
_yardoc
|
60
60
|
doc/
|
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
source "https://rubygems.org"
|
2
|
-
|
3
|
-
gemspec
|
4
|
-
|
5
|
-
group :development do
|
6
|
-
# We depend on Vagrant for development, but we don't add it as a
|
7
|
-
# gem dependency because we expect to be installed within the
|
8
|
-
# Vagrant environment itself using `vagrant plugin`.
|
9
|
-
gem "vagrant", :git => "git://github.com/mohitsethi/vagrant.git"
|
10
|
-
end
|
1
|
+
source "https://rubygems.org"
|
2
|
+
|
3
|
+
gemspec
|
4
|
+
|
5
|
+
group :development do
|
6
|
+
# We depend on Vagrant for development, but we don't add it as a
|
7
|
+
# gem dependency because we expect to be installed within the
|
8
|
+
# Vagrant environment itself using `vagrant plugin`.
|
9
|
+
gem "vagrant", :git => "git://github.com/mohitsethi/vagrant.git"
|
10
|
+
end
|
data/LICENSE
ADDED
@@ -0,0 +1,9 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
Copyright (c) 2013 Mitchell Hashimoto
|
3
|
+
Copyright (c) 2013 Mohit Sethi
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
6
|
+
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
8
|
+
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
CHANGED
@@ -1,167 +1,172 @@
|
|
1
|
-
# Vagrant HP Provider
|
2
|
-
|
3
|
-
This is a [Vagrant](http://www.vagrantup.com) 1.1+ plugin that adds an [HP](http://www.hpcloud.com)
|
4
|
-
provider to Vagrant, allowing Vagrant to control and provision machines on HP Cloud.
|
5
|
-
|
6
|
-
**NOTE:** This plugin requires Vagrant 1.1+,
|
7
|
-
|
8
|
-
## Features
|
9
|
-
|
10
|
-
* Boot Servers on HP Cloud
|
11
|
-
* SSH into the instances.
|
12
|
-
* Provision the instances with any built-in Vagrant provisioner.
|
13
|
-
* Minimal synced folder support via `rsync`.
|
14
|
-
|
15
|
-
## Usage
|
16
|
-
|
17
|
-
Install using standard Vagrant 1.1+ plugin installation methods. After
|
18
|
-
installing, `vagrant up` and specify the `hp` provider. An example is
|
19
|
-
shown below.
|
20
|
-
|
21
|
-
```
|
22
|
-
$ vagrant plugin install vagrant-hp
|
23
|
-
...
|
24
|
-
$ vagrant up --provider=hp
|
25
|
-
...
|
26
|
-
```
|
27
|
-
|
28
|
-
Of course prior to doing this, you'll need to obtain an HP-compatible
|
29
|
-
box file for Vagrant.
|
30
|
-
|
31
|
-
## Quick Start
|
32
|
-
|
33
|
-
After installing the plugin (instructions above), the quickest way to get
|
34
|
-
started is to actually use a dummy HP box and specify all the details
|
35
|
-
manually within a `config.vm.provider` block. So first, add the dummy
|
36
|
-
box using any name you want:
|
37
|
-
|
38
|
-
```
|
39
|
-
$ vagrant box add dummy https://github.com/mohitsethi/vagrant-hp/raw/master/dummy_hp.box
|
40
|
-
...
|
41
|
-
```
|
42
|
-
|
43
|
-
And then make a Vagrantfile that looks like the following, filling in
|
44
|
-
your information where necessary.
|
45
|
-
|
46
|
-
```
|
47
|
-
Vagrant.configure("2") do |config|
|
48
|
-
config.vm.box = "dummy"
|
49
|
-
|
50
|
-
config.vm.provider :hp do |rs|
|
51
|
-
rs.access_key = "<hp_access_key>"
|
52
|
-
rs.secret_key = "<hp_secret_key>"
|
53
|
-
rs.flavor = "standard.xsmall"
|
54
|
-
rs.tenant_id = "<hp_tenant_id>"
|
55
|
-
rs.server_name = "<server_name>"
|
56
|
-
rs.image = "Ubuntu Precise 12.04 LTS Server 64-bit 20121026 (b)"
|
57
|
-
rs.keypair_name = "<your_key_pair_name_on_hpcloud>"
|
58
|
-
rs.ssh_private_key_path = "<private_key_location>"
|
59
|
-
rs.ssh_username = "<ssh_username>"
|
60
|
-
rs.availability_zone = "az1"
|
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
|
-
rs.
|
117
|
-
rs.
|
118
|
-
rs.
|
119
|
-
rs.
|
120
|
-
rs.
|
121
|
-
rs.
|
122
|
-
rs.
|
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
|
-
|
1
|
+
# Vagrant HP Provider
|
2
|
+
|
3
|
+
This is a [Vagrant](http://www.vagrantup.com) 1.1+ plugin that adds an [HP](http://www.hpcloud.com)
|
4
|
+
provider to Vagrant, allowing Vagrant to control and provision machines on HP Cloud.
|
5
|
+
|
6
|
+
**NOTE:** This plugin requires Vagrant 1.1+,
|
7
|
+
|
8
|
+
## Features
|
9
|
+
|
10
|
+
* Boot Servers on HP Cloud
|
11
|
+
* SSH into the instances.
|
12
|
+
* Provision the instances with any built-in Vagrant provisioner.
|
13
|
+
* Minimal synced folder support via `rsync`.
|
14
|
+
|
15
|
+
## Usage
|
16
|
+
|
17
|
+
Install using standard Vagrant 1.1+ plugin installation methods. After
|
18
|
+
installing, `vagrant up` and specify the `hp` provider. An example is
|
19
|
+
shown below.
|
20
|
+
|
21
|
+
```
|
22
|
+
$ vagrant plugin install vagrant-hp
|
23
|
+
...
|
24
|
+
$ vagrant up --provider=hp
|
25
|
+
...
|
26
|
+
```
|
27
|
+
|
28
|
+
Of course prior to doing this, you'll need to obtain an HP-compatible
|
29
|
+
box file for Vagrant.
|
30
|
+
|
31
|
+
## Quick Start
|
32
|
+
|
33
|
+
After installing the plugin (instructions above), the quickest way to get
|
34
|
+
started is to actually use a dummy HP box and specify all the details
|
35
|
+
manually within a `config.vm.provider` block. So first, add the dummy
|
36
|
+
box using any name you want:
|
37
|
+
|
38
|
+
```
|
39
|
+
$ vagrant box add dummy https://github.com/mohitsethi/vagrant-hp/raw/master/dummy_hp.box
|
40
|
+
...
|
41
|
+
```
|
42
|
+
|
43
|
+
And then make a Vagrantfile that looks like the following, filling in
|
44
|
+
your information where necessary.
|
45
|
+
|
46
|
+
```
|
47
|
+
Vagrant.configure("2") do |config|
|
48
|
+
config.vm.box = "dummy"
|
49
|
+
|
50
|
+
config.vm.provider :hp do |rs|
|
51
|
+
rs.access_key = "<hp_access_key>"
|
52
|
+
rs.secret_key = "<hp_secret_key>"
|
53
|
+
rs.flavor = "standard.xsmall"
|
54
|
+
rs.tenant_id = "<hp_tenant_id>"
|
55
|
+
rs.server_name = "<server_name>"
|
56
|
+
rs.image = "Ubuntu Precise 12.04 LTS Server 64-bit 20121026 (b)"
|
57
|
+
rs.keypair_name = "<your_key_pair_name_on_hpcloud>"
|
58
|
+
rs.ssh_private_key_path = "<private_key_location>"
|
59
|
+
rs.ssh_username = "<ssh_username>"
|
60
|
+
rs.availability_zone = "az1"
|
61
|
+
# Security Groups defaults to ["default"]
|
62
|
+
# rs.security_groups = ["group1", "group2"]
|
63
|
+
end
|
64
|
+
end
|
65
|
+
```
|
66
|
+
|
67
|
+
And then run `vagrant up --provider=hp`.
|
68
|
+
|
69
|
+
This will start an Ubuntu 12.04 instance in the az1 availability zone within
|
70
|
+
your HP Cloud account. And assuming your SSH information was filled in properly
|
71
|
+
within your Vagrantfile, SSH and provisioning will work as well.
|
72
|
+
|
73
|
+
Note that normally a lot of this boilerplate is encoded within the box
|
74
|
+
file, but the box file used for the quick start, the "dummy" box, has
|
75
|
+
no preconfigured defaults.
|
76
|
+
|
77
|
+
## Box Format
|
78
|
+
|
79
|
+
Every provider in Vagrant must introduce a custom box format. This
|
80
|
+
provider introduces `hp` boxes. You can view an example box in
|
81
|
+
the [example_box/ directory](https://github.com/mohitsethi/vagrant-hp/tree/master/example_box).
|
82
|
+
That directory also contains instructions on how to build a box.
|
83
|
+
|
84
|
+
The box format is basically just the required `metadata.json` file
|
85
|
+
along with a `Vagrantfile` that does default settings for the
|
86
|
+
provider-specific configuration for this provider.
|
87
|
+
|
88
|
+
## Configuration
|
89
|
+
|
90
|
+
This provider exposes quite a few provider-specific configuration options:
|
91
|
+
|
92
|
+
* `access_key` - The access key for accessing HP Cloud
|
93
|
+
* `image` - The Image-id or Image-Name to boot, such as
|
94
|
+
"Ubuntu Precise 12.04 LTS Server 64-bit 20121026 (b)"
|
95
|
+
* `availability_zone` - The availability zone to launch the server.
|
96
|
+
If nil, it will use 'az1'.
|
97
|
+
* `flavor` - The type of flavor, such as "standard.xsmall"
|
98
|
+
* `keypair_name` - The name of the keypair to use to bootstrap image
|
99
|
+
which support it.
|
100
|
+
* `secret_key` - The secret access key for accessing HP Cloud.
|
101
|
+
* `ssh_private_key_path` - The path to the SSH private key. This overrides
|
102
|
+
`config.ssh.private_key_path`.
|
103
|
+
* `ssh_username` - The SSH username, which overrides `config.ssh.username`.
|
104
|
+
* `server_name` - The name of the server provisioned on HP Cloud.
|
105
|
+
* `tenant_id` - The tenant_id to launch the server.
|
106
|
+
* `security_groups` - An array of strings defining the security groups in which this VM is included.
|
107
|
+
|
108
|
+
These can be set like typical provider-specific configuration:
|
109
|
+
|
110
|
+
|
111
|
+
```ruby
|
112
|
+
Vagrant.configure("2") do |config|
|
113
|
+
# ... other stuff
|
114
|
+
|
115
|
+
config.vm.provider :hp do |rs|
|
116
|
+
rs.access_key = "<hp_access_key>"
|
117
|
+
rs.secret_key = "<hp_secret_key>"
|
118
|
+
rs.flavor = "standard.xsmall"
|
119
|
+
rs.tenant_id = "<hp_tenant_id>"
|
120
|
+
rs.server_name = "<server_name>"
|
121
|
+
rs.image = "Ubuntu Precise 12.04 LTS Server 64-bit 20121026 (b)"
|
122
|
+
rs.keypair_name = "<your_key_pair_name_on_hpcloud>"
|
123
|
+
rs.ssh_private_key_path = "<private_key_location>"
|
124
|
+
rs.ssh_username = "<ssh_username>"
|
125
|
+
rs.availability_zone = "az1"
|
126
|
+
# Security Groups defaults to ["default"]
|
127
|
+
# rs.security_groups = ["group1", "group2"]
|
128
|
+
end
|
129
|
+
|
130
|
+
end
|
131
|
+
```
|
132
|
+
|
133
|
+
## Networks
|
134
|
+
|
135
|
+
Networking features in the form of `config.vm.network` are not
|
136
|
+
supported with `vagrant-hp`, currently. If any of these are
|
137
|
+
specified, Vagrant will emit a warning, but will otherwise boot
|
138
|
+
the HP machine.
|
139
|
+
|
140
|
+
## Synced Folders
|
141
|
+
|
142
|
+
There is minimal support for synced folders. Upon `vagrant up`,
|
143
|
+
`vagrant reload`, and `vagrant provision`, the HP provider will use
|
144
|
+
`rsync` (if available) to uni-directionally sync the folder to
|
145
|
+
the remote machine over SSH.
|
146
|
+
|
147
|
+
This is good enough for all built-in Vagrant provisioners (shell,
|
148
|
+
chef, and puppet) to work!
|
149
|
+
|
150
|
+
## Development
|
151
|
+
|
152
|
+
To work on the `vagrant-hp` plugin, clone this repository out, and use
|
153
|
+
[Bundler](http://gembundler.com) to get the dependencies:
|
154
|
+
|
155
|
+
```
|
156
|
+
$ bundle
|
157
|
+
```
|
158
|
+
|
159
|
+
Once you have the dependencies, verify the unit tests pass with `rake`:
|
160
|
+
|
161
|
+
```
|
162
|
+
$ bundle exec rake
|
163
|
+
```
|
164
|
+
|
165
|
+
If those pass, you're ready to start developing the plugin. You can test
|
166
|
+
the plugin without installing it into your Vagrant environment by just
|
167
|
+
creating a `Vagrantfile` in the top level of this directory (it is gitignored)
|
168
|
+
that uses it, and uses bundler to execute Vagrant:
|
169
|
+
|
170
|
+
```
|
171
|
+
$ bundle exec vagrant up --provider=hp
|
172
|
+
```
|