-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
38 changed files
with
1,686 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
.vagrant/* | ||
pkg/* | ||
Gemfile.lock | ||
test-* | ||
.yardoc/* | ||
doc/* | ||
Vagrantfile | ||
puppet/* | ||
*.gem |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
MethodLength: | ||
CountComments: false # count full line comments? | ||
Enabled: false | ||
|
||
MethodName: | ||
EnforcedStyle: snake_case | ||
|
||
AccessorMethodName: | ||
Description: Check the naming of accessor methods for get_/set_. | ||
Enabled: false | ||
|
||
Encoding: | ||
Description: 'Use UTF-8 as the source file encoding.' | ||
Enabled: true | ||
|
||
HashSyntax: | ||
Description: >- | ||
Prefer Ruby 1.9 hash syntax { a: 1, b: 2 } over 1.8 syntax | ||
{ :a => 1, :b => 2 }. | ||
Enabled: false | ||
EnforcedStyle: hash_rockets | ||
|
||
LineEndConcatenation: | ||
Description: 'Use \\ instead of + to concatenate two string literals at line end.' | ||
Enabled: true | ||
|
||
LineLength: | ||
Description: 'Limit lines to 79 characters.' | ||
Enabled: true | ||
Max: 80 | ||
|
||
CyclomaticComplexity: | ||
Description: 'Avoid complex methods.' | ||
Enabled: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
source 'http://rubygems.org' | ||
|
||
gemspec | ||
|
||
group :development do | ||
gem 'vagrant', :git => 'git://github.com/mitchellh/vagrant.git' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2013 Fabio Rapposelli | ||
|
||
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: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,90 @@ | ||
# vagrant-vcenter | ||
[Vagrant](http://www.vagrantup.com) provider for VMware vCenter® | ||
============= | ||
|
||
Vagrant provider for VMware vCenter ® | ||
[Version 0.1.0](../../releases/tag/v0.1.0) has been released! | ||
------------- | ||
|
||
Please note that this is NOT PRODUCTION READY yet. | ||
Please note that this software is still Alpha/Beta quality and is not recommended for production usage. | ||
|
||
If you're feeling adventurous, check the ```develop``` branch. | ||
Right now a [Precise32](http://vagrant.gosddc.com/boxes/precise32-vcenter.box) is available for use, or you can roll your own as you please, make sure to install VMware tools in it. | ||
|
||
Install | ||
------------- | ||
|
||
Latest version can be easily installed by running the following command: | ||
|
||
```vagrant plugin install vagrant-vcenter``` | ||
|
||
Vagrant will download all the required gems during the installation process. | ||
|
||
After the install has completed a ```vagrant up --provider=vcenter``` will trigger the newly installed provider. | ||
|
||
Configuration | ||
------------- | ||
|
||
Here's a sample Multi-VM Vagrantfile: | ||
|
||
```ruby | ||
precise32_box_url = 'http://vagrant.tsugliani.fr/precise32-vcenter.box' | ||
|
||
nodes = [ | ||
{ hostname: 'web-vm', | ||
box: 'precise32', | ||
box_url: precise32_box_url }, | ||
{ hostname: 'ssh-vm', | ||
box: 'precise32', | ||
box_url: precise32_box_url }, | ||
{ hostname: 'sql-vm', | ||
box: 'precise32', | ||
box_url: precise32_box_url }, | ||
{ hostname: 'lb-vm', | ||
box: 'precise32', | ||
box_url: precise32_box_url } | ||
] | ||
|
||
Vagrant.configure('2') do |config| | ||
|
||
config.vm.provider :vcenter do |vcenter| | ||
vcenter.hostname = 'my.vcenter.hostname' | ||
vcenter.username = 'myUsername' | ||
vcenter.password = 'myPassword' | ||
vcenter.folder_name = 'myFolderName' | ||
vcenter.datacenter_name = 'MyDatacenterName' | ||
vcenter.computer_name = 'MyHostOrCluster' | ||
vcenter.datastore_name = 'MyDatastore' | ||
vcenter.template_folder_name = 'My/Template/Folder/Path' | ||
vcenter.network_name = 'myNetworkName' | ||
# If you want to use linked clones, set this to true | ||
vcenter.linked_clones = true | ||
end | ||
|
||
# Go through nodes and configure each of them.j | ||
nodes.each do |node| | ||
config.vm.define node[:hostname] do |node_config| | ||
node_config.vm.box = node[:box] | ||
node_config.vm.hostname = node[:hostname] | ||
node_config.vm.box_url = node[:box_url] | ||
# node_config.vm.provision :puppet do |puppet| | ||
# puppet.manifests_path = 'puppet/manifests' | ||
# puppet.manifest_file = 'site.pp' | ||
# puppet.module_path = 'puppet/modules' | ||
# puppet.options = "--verbose --debug" | ||
# end | ||
end | ||
end | ||
end | ||
``` | ||
|
||
Contribute | ||
------------- | ||
|
||
What is still missing: | ||
|
||
- TEST SUITES! (working on that). | ||
- Speed, the code is definitely not optimized. | ||
- Thorough testing. | ||
- Error checking is absymal. | ||
- Some spaghetti code here and there. | ||
- Bugs, bugs and BUGS!. | ||
|
||
If you're a developer and want to lend us a hand, head over to our ```develop``` branch and send us PRs! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
require 'rubygems' | ||
require 'bundler/setup' | ||
require 'rspec/core/rake_task' | ||
|
||
# Immediately sync all stdout so that tools like buildbot can | ||
# immediately load in the output. | ||
$stdout.sync = true | ||
$stderr.sync = true | ||
|
||
# Change to the y of this file. | ||
Dir.chdir(File.expand_path('../', __FILE__)) | ||
|
||
Bundler::GemHelper.install_tasks | ||
|
||
RSpec::Core::RakeTask.new | ||
|
||
task :default => 'spec' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# vagrant-vcenter box specifications [WIP] | ||
|
||
*Note that vagrant-vcenter currently supports only single VM vApp boxes* | ||
|
||
BOX package should contain: | ||
|
||
- `metadata.json` -- Vagrant metadata file | ||
- `<boxname>.ovf` -- OVF descriptor of the vApp. | ||
- `<boxname>.mf` -- OVF manifest file containing file hashes. | ||
- `<boxname>-disk-<#>.vmdk` -- Associated VMDK files. | ||
- `Vagrantfile`-- vagrant-vcenter default Vagrantfile | ||
|
||
A [task is open](https://github.com/frapposelli/vagrant-vcenter/issues/12) for creating a veewee plugin to facilitate Box creation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Vagrant::Config.run do |config| | ||
config.vm.base_mac = "<mac address>" | ||
end | ||
|
||
include_vagrantfile = File.expand_path("../include/_Vagrantfile", __FILE__) | ||
load include_vagrantfile if File.exist?(include_vagrantfile) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"provider": "vagrant-vcenter"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
require 'pathname' | ||
require 'vagrant-vcenter/plugin' | ||
|
||
module VagrantPlugins | ||
# Initialize the plugin. | ||
module VCenter | ||
lib_path = Pathname.new(File.expand_path('../vagrant-vcenter', __FILE__)) | ||
autoload :Action, lib_path.join('action') | ||
autoload :Errors, lib_path.join('errors') | ||
|
||
# This returns the path to the source of this plugin. | ||
# | ||
# @return [Pathname] | ||
def self.source_root | ||
@source_root ||= Pathname.new(File.expand_path('../../', __FILE__)) | ||
end | ||
end | ||
end |
Oops, something went wrong.