Skip to content
Snippets Groups Projects
Commit 6f456811 authored by Alexander Olofsson's avatar Alexander Olofsson
Browse files

Initial commit

parents
No related branches found
No related tags found
No related merge requests found
/.bundle/
/.yardoc
/Gemfile.lock
/_yardoc/
/coverage/
/doc/
/pkg/
/spec/reports/
/tmp/
sudo: false
language: ruby
rvm:
- 2.1.9
before_install: gem install bundler -v 1.13.7
source 'https://rubygems.org'
# Specify your gem's dependencies in foreman_vmware_advanced.gemspec
gemspec
The MIT License (MIT)
Copyright (c) 2018 Alexander Olofsson
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.
# Foreman VMWare Advanced
Adds in support for setting advanced values in the VMWare configuration
This is useful for specifying things like `disk.enableUUID=true` or `svga.autodetect=true`
## Installation
Follow the Foreman manual for [advanced installation from gems](https://theforeman.org/plugins/#2.3AdvancedInstallationfromGems)
## Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/ananace/foreman_vmware_advanced
## License
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
Rakefile 0 → 100644
require "bundler/gem_tasks"
require "rake/testtask"
Rake::TestTask.new(:test) do |t|
t.libs << "test"
t.libs << "lib"
t.test_files = FileList['test/**/*_test.rb']
end
task :default => :test
module ForemanVmwareAdvanced
module VmwareExtensions
extend ActiveSupport::Concern
included do
alias_method_chain :parse_args, :vmware_advanced
end
def parse_args_with_vmware_advanced(inp_args)
args = parse_args_without_vmware_advanced(inp_args)
args[:extra_config] = {
'bios.bootOrder' => 'ethernet0',
'disk.enableUUID' => 'TRUE',
'svga.autodetect' => 'TRUE'
}
args
end
end
end
# coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'foreman_vmware_advanced/version'
Gem::Specification.new do |spec|
spec.name = 'foreman_vmware_advanced'
spec.version = ForemanVmwareAdvanced::VERSION
spec.authors = ['Alexander Olofsson']
spec.email = ['alexander.olofsson@liu.se']
spec.summary = 'Adds advanced values to the VMWare vmx config'
spec.description = spec.summary
spec.homepage = 'https://github.com/ananace/foreman_vmware_advanced'
spec.license = 'MIT'
spec.files = `git ls-files -z`.split("\x0").reject do |f|
f.match(%r{^(test|spec|features)/})
end
spec.require_paths = ['lib']
spec.add_development_dependency 'bundler', '~> 1.13'
spec.add_development_dependency 'minitest', '~> 5.0'
spec.add_development_dependency 'rake', '~> 10.0'
end
require 'foreman_vmware_advanced/engine'
module ForemanVmwareAdvanced
end
module ForemanVmwareAdvanced
class Engine < ::Rails::Engine
engine_name 'foreman_vmware_advanced'
initializer 'foreman_vmware_advanced.register_plugin', before: :finisher_hook do |_app|
Foreman::Plugin.register :foreman_vmware_advanced do
requires_foreman '>= 1.14'
end
end
config.to_prepare do
begin
::Foreman::Model::Vmware.send :include, ForemanVmwareAdvanced::VmwareExtensions
rescue => e
Rails.logger.warn "ForemanVmwareAdvanced: skipping engine hook(#{e})"
end
end
end
end
module ForemanVmwareAdvanced
VERSION = '0.0.1'.freeze
end
require 'test_helper'
class ForemanVmwareAdvancedTest < Minitest::Test
def test_that_it_has_a_version_number
refute_nil ::ForemanVmwareAdvanced::VERSION
end
def test_it_does_something_useful
assert false
end
end
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
require 'foreman_vmware_advanced'
require 'minitest/autorun'
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment