foreman_ipxe 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: cfc852927c96c23627c18d000d58c49d6e8279b6
4
+ data.tar.gz: e8dbaa9a5b65805e06471ebbf71413bd1bd68151
5
+ SHA512:
6
+ metadata.gz: 128182c97baeb0b5baa50e10d26cb69644a42f72740f60b233f45b23ca8acfea86bd93050d1a843552948a4de795d265998ace84c21989a7462dcfcef08de19e
7
+ data.tar.gz: cbd1a39f93b79d58af811403277dd5e36a58487b641b8145dd393996264f2e1838dcaa65868800fbd148a59e02182c62c08aeafe7f23e2439c599e6b7293845a
data/.gitignore ADDED
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
data/.travis.yml ADDED
@@ -0,0 +1,5 @@
1
+ sudo: false
2
+ language: ruby
3
+ rvm:
4
+ - 2.1.9
5
+ before_install: gem install bundler -v 1.13.7
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in foreman_ipxe.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2017 Alexander Olofsson
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,41 @@
1
+ # foreman_ipxe
2
+
3
+ Adds in PXE loaders for chainloaded iPXE (`undionly.kpxe`, `ipxe.efi`)
4
+
5
+
6
+ ## Installation
7
+
8
+ Follow the Foreman manual for [advanced installation from gems](https://theforeman.org/plugins/#2.3AdvancedInstallationfromGems)
9
+
10
+
11
+ ## Usage
12
+
13
+ To use the chainloading, you need to generate the iPXE executables first.
14
+
15
+ ```sh
16
+ git clone git://git.ipxe.org/ipxe.git
17
+ cd ipxe/src
18
+
19
+ cat <<EOF > default.ipxe
20
+ #!ipxe
21
+
22
+ dhcp
23
+ chain https://foreman.example.com/unattended/iPXE
24
+ EOF
25
+
26
+ make bin/undionly.kpxe EMBED=default.ipxe
27
+ make bin-x86_64-efi/ipxe.efi EMBED=default.ipxe
28
+ ```
29
+
30
+ The generated executables should then be uploaded to the root of your TFTP server (or depending on your root path DHCP option).
31
+
32
+
33
+ ## Contributing
34
+
35
+ Bug reports and pull requests are welcome on GitHub at https://github.com/ace13/foreman_ipxe.
36
+
37
+
38
+ ## License
39
+
40
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
41
+
data/Rakefile ADDED
@@ -0,0 +1,10 @@
1
+ require "bundler/gem_tasks"
2
+ require "rake/testtask"
3
+
4
+ Rake::TestTask.new(:test) do |t|
5
+ t.libs << "test"
6
+ t.libs << "lib"
7
+ t.test_files = FileList['test/**/*_test.rb']
8
+ end
9
+
10
+ task :default => :test
@@ -0,0 +1,13 @@
1
+ module ForemanIpxe
2
+ module OperatingsystemExtensions
3
+ extend ActiveSupport::Concern
4
+
5
+ module ClassMethods
6
+ def all_loaders_map(arch = 'x64')
7
+ super(arch)
8
+ .merge('iPXE BIOS' => 'undionly.kpxe', 'iPXE UEFI' => 'ipxe.efi')
9
+ .freeze
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,26 @@
1
+ # coding: utf-8
2
+
3
+ lib = File.expand_path('../lib', __FILE__)
4
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
+ require 'foreman_ipxe/version'
6
+
7
+ Gem::Specification.new do |spec|
8
+ spec.name = 'foreman_ipxe'
9
+ spec.version = ForemanIpxe::VERSION
10
+ spec.authors = ['Alexander Olofsson']
11
+ spec.email = ['alexander.olofsson@liu.se']
12
+
13
+ spec.summary = 'Adds chainloaded iPXE loaders'
14
+ spec.description = 'Allows provisioning iPXE with chainloaded iPXE binaries'
15
+ spec.homepage = 'https://github.com/ace13/foreman_ipxe'
16
+ spec.license = 'MIT'
17
+
18
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
19
+ f.match(%r{^(test|spec|features)/})
20
+ end
21
+ spec.require_paths = ['lib']
22
+
23
+ spec.add_development_dependency 'bundler', '~> 1.13'
24
+ spec.add_development_dependency 'rake', '~> 10.0'
25
+ spec.add_development_dependency 'minitest', '~> 5.0'
26
+ end
@@ -0,0 +1,19 @@
1
+ module ForemanIpxe
2
+ class Engine < ::Rails::Engine
3
+ engine_name 'foreman_ipxe'
4
+
5
+ initializer 'foreman_ipxe.register_plugin', before: :finisher_hook do |_app|
6
+ Foreman::Plugin.register :foreman_ipxe do
7
+ requires_foreman '>= 1.14'
8
+ end
9
+ end
10
+
11
+ config.to_prepare do
12
+ begin
13
+ ::Operatingsystem.send :include, ForemanIpxe::OperatingsystemExtensions
14
+ rescue => e
15
+ Rails.logger.warn "ForemanIpxe: skipping engine hook(#{e})"
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,3 @@
1
+ module ForemanIpxe
2
+ VERSION = '0.1.0'.freeze
3
+ end
@@ -0,0 +1,4 @@
1
+ require 'foreman_ipxe/engine'
2
+
3
+ module ForemanIpxe
4
+ end
metadata ADDED
@@ -0,0 +1,97 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: foreman_ipxe
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Alexander Olofsson
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2017-09-01 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.13'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.13'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: minitest
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '5.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '5.0'
55
+ description: Allows provisioning iPXE with chainloaded iPXE binaries
56
+ email:
57
+ - alexander.olofsson@liu.se
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - ".gitignore"
63
+ - ".travis.yml"
64
+ - Gemfile
65
+ - LICENSE.txt
66
+ - README.md
67
+ - Rakefile
68
+ - app/models/concerns/foreman_ipxe/operatingsystem_extensions.rb
69
+ - foreman_ipxe.gemspec
70
+ - lib/foreman_ipxe.rb
71
+ - lib/foreman_ipxe/engine.rb
72
+ - lib/foreman_ipxe/version.rb
73
+ homepage: https://github.com/ace13/foreman_ipxe
74
+ licenses:
75
+ - MIT
76
+ metadata: {}
77
+ post_install_message:
78
+ rdoc_options: []
79
+ require_paths:
80
+ - lib
81
+ required_ruby_version: !ruby/object:Gem::Requirement
82
+ requirements:
83
+ - - ">="
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
86
+ required_rubygems_version: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - ">="
89
+ - !ruby/object:Gem::Version
90
+ version: '0'
91
+ requirements: []
92
+ rubyforge_project:
93
+ rubygems_version: 2.6.12
94
+ signing_key:
95
+ specification_version: 4
96
+ summary: Adds chainloaded iPXE loaders
97
+ test_files: []