├── .gitignore ├── Gemfile ├── Gemfile.lock ├── LICENSE.txt ├── README.md ├── Rakefile ├── Vagrantfile ├── box └── centos-6-x86_64 │ ├── VagrantFile │ ├── centos-6-x86_64.box │ ├── make_box.sh │ └── metadata.json ├── lib ├── vagrant-openvz.rb └── vagrant-openvz │ ├── action.rb │ ├── action │ ├── boot.rb │ ├── check_created.rb │ ├── check_running.rb │ ├── create.rb │ ├── created.rb │ ├── destroy.rb │ ├── destroy_confirm.rb │ ├── fetch_ip.rb │ ├── forced_halt.rb │ ├── is_running.rb │ ├── message.rb │ └── share_folders.rb │ ├── command │ └── version.rb │ ├── config.rb │ ├── driver.rb │ ├── driver │ └── cli.rb │ ├── errors.rb │ ├── plugin.rb │ ├── provider.rb │ ├── sudo_wrapper.rb │ └── version.rb ├── vagrant-openvz.gemspec └── vg.sh /.gitignore: -------------------------------------------------------------------------------- 1 | .vagrant/ 2 | pkg/ 3 | solo-setup.sh 4 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | # Specify your gem's dependencies in vagrant-openvz.gemspec 4 | gemspec 5 | 6 | group :development do 7 | gem "vagrant", :git => "git://github.com/mitchellh/vagrant.git" 8 | end 9 | -------------------------------------------------------------------------------- /Gemfile.lock: -------------------------------------------------------------------------------- 1 | GIT 2 | remote: git://github.com/mitchellh/vagrant.git 3 | revision: 2c8cc95e7928f8d25fb76dbbd9e9132ef08b7649 4 | specs: 5 | vagrant (1.3.4.dev) 6 | childprocess (~> 0.3.7) 7 | erubis (~> 2.7.0) 8 | i18n (~> 0.6.0) 9 | log4r (~> 1.1.9) 10 | net-scp (~> 1.1.0) 11 | net-ssh (~> 2.6.6) 12 | 13 | PATH 14 | remote: . 15 | specs: 16 | vagrant-openvz (0.0.7) 17 | 18 | GEM 19 | remote: https://rubygems.org/ 20 | specs: 21 | childprocess (0.3.9) 22 | ffi (~> 1.0, >= 1.0.11) 23 | erubis (2.7.0) 24 | ffi (1.9.0) 25 | i18n (0.6.5) 26 | log4r (1.1.10) 27 | net-scp (1.1.2) 28 | net-ssh (>= 2.6.5) 29 | net-ssh (2.6.8) 30 | rake (10.1.0) 31 | 32 | PLATFORMS 33 | ruby 34 | 35 | DEPENDENCIES 36 | bundler (~> 1.3) 37 | rake 38 | vagrant! 39 | vagrant-openvz! 40 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013 Aslan Brooke 2 | 3 | MIT License 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # vagrant-openvz 2 | 3 | [![Gem Version](https://badge.fury.io/rb/vagrant-openvz.png)](http://badge.fury.io/rb/vagrant-openvz) 4 | 5 | #### LINUX ONLY TECHNOLOGY. 6 | 7 | This is a provider plugin for vagrant. The provider integrates [OpenVZ](http://openvz.org/Main_Page) with the normal actions associated with vagrant including: up, ssh, halt, destroy. 8 | 9 | Successfully used in combination with the following vagrant plugins: 10 | 11 | - vagrant-omnibus 12 | - agrant-berkshelf 13 | 14 | ## Tested Platform 15 | ##### (vagrant + vagrant-openvz + OpenVZ) 16 | 17 | - Centos 6.4 18 | - Others may work, though usability unknown as of now. 19 | 20 | ## Installation through vagrant 21 | 22 | The plugin requires that you openvz and vagrant be installed. Then run the following from the command line which will install it from rubygems.org: 23 | 24 | ```shell 25 | vagrant plugin install vagrant-openvz 26 | ``` 27 | 28 | ## Boxes 29 | 30 | Boxes are bare bones and currently depend on the templates provided by OpenVZ. You can download the one tested box from "box/centos-6-x86_64/centos-6-x86_64.box" in this source repository, however on first usage the actual template for the box will be downloaded through openvz. Subsequent usages will use the cached template. This means that the second and subsequent usages will be significantly faster. 31 | 32 | ## Building the plugin 33 | 34 | 1. Download the source code (if your going to contribute see next section) 35 | 2. Install bundler 36 | 3. Navigate to the downloaded source code, and within the same folder as the "Gemfile" file run "bundle" to get depedencies. 37 | 38 | ##### Helpful Reference: 39 | * Book: Vagrant, up and running; Chapter 7; Section "Plugi-In Development Basics" 40 | 41 | ## Contributing 42 | 43 | During development on Centos 6(.4), in order to use: "bundle exec vagrant box add" I had to download the latest version of vagrant. Track down "bsdtar" and put it in a new folder, then add the folder path to the PATH. Then export it. This way the functionality would work properly. 44 | 45 | 1. Fork it 46 | 2. Create your feature branch (`git checkout -b my-new-feature`) 47 | 3. Commit your changes (`git commit -am 'Add some feature'`) 48 | 4. Push to the branch (`git push origin my-new-feature`) 49 | 5. Create new Pull Request 50 | 51 | ## ROADMAP (Features not yet added). 52 | 53 | * OpenVZ focused: [Virtual Ethernet devices](http://openvz.org/Virtual_Ethernet_device). 54 | * Vagrant focused: Port Forwarding. 55 | * Vagrant focuused: Improve usage of env[:ui] logging. 56 | * Vagrant focused: Tokenize all hardcoded text. 57 | 58 | ## Credits 59 | 60 | Two other code bases were studied during the creation of this plugin: 61 | 62 | - [mitchellh/vagrant](https://github.com/mitchellh/vagrant) 63 | - [fgrehm/vagrant-lxc](https://github.com/fgrehm/vagrant-lxc) 64 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | require "bundler/gem_tasks" 2 | -------------------------------------------------------------------------------- /Vagrantfile: -------------------------------------------------------------------------------- 1 | Vagrant.require_plugin "vagrant-openvz" 2 | 3 | $script = <