Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
foreman_uuid_boot
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LiU IT - Infrastructure
foreman_uuid_boot
Commits
fba32bbd
Verified
Commit
fba32bbd
authored
2 years ago
by
Alexander Olofsson
Browse files
Options
Downloads
Patches
Plain Diff
Add support for foreman_discovery
parent
57f7d2b9
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/models/concerns/foreman_uuid_boot/host_discovered_extensions.rb
+10
-0
10 additions, 0 deletions
.../concerns/foreman_uuid_boot/host_discovered_extensions.rb
lib/foreman_uuid_boot/engine.rb
+16
-1
16 additions, 1 deletion
lib/foreman_uuid_boot/engine.rb
with
26 additions
and
1 deletion
app/models/concerns/foreman_uuid_boot/host_discovered_extensions.rb
0 → 100644
+
10
−
0
View file @
fba32bbd
# frozen_string_literal: true
module
ForemanUuidBoot
module
HostDiscoveredExtensions
def
populate_fields_from_facts
(
parser
,
type
,
source_proxy
)
super
populate_facet_fields
(
parser
,
type
,
source_proxy
)
end
end
end
This diff is collapsed.
Click to expand it.
lib/foreman_uuid_boot/engine.rb
+
16
−
1
View file @
fba32bbd
...
...
@@ -4,6 +4,7 @@ module ForemanUuidBoot
class
Engine
<
::
Rails
::
Engine
engine_name
'foreman_uuid_boot'
config
.
autoload_paths
+=
Dir
[
"
#{
config
.
root
}
/app/models/concerns"
]
config
.
autoload_paths
+=
Dir
[
"
#{
config
.
root
}
/app/services/foreman/unattended_installation/concerns"
]
initializer
'foreman_uuid_boot.load_app_instance_data'
do
|
app
|
...
...
@@ -17,13 +18,27 @@ module ForemanUuidBoot
requires_foreman
'>= 2.5'
register_facet
ForemanUuidBoot
::
UuidbootHostFacet
,
:uuidboot_facet
do
set_dependent_action
:destroy
configure_host
do
set_dependent_action
:destroy
end
end
end
end
config
.
to_prepare
do
::
Foreman
::
UnattendedInstallation
::
HostFinder
.
prepend
ForemanUuidBoot
::
HostFinderExtensions
# Slight hack for foreman_discovery - to store UUID for provision
begin
# Ensure that Host::Discovered applies host facets
unless
::
Host
::
Discovered
.
include?
Facets
::
ModelExtensionsBase
::
Host
::
Discovered
.
include
SelectiveClone
::
Host
::
Discovered
.
include
Facets
::
ManagedHostExtensions
::
Host
::
Discovered
.
prepend
ForemanUuidBoot
::
HostDiscoveredExtensions
end
rescue
NameError
=>
e
Rails
.
logger
.
warn
"ForemanUuidBoot: Discovery not installed(
#{
e
}
), skipping discovery extensions"
end
rescue
StandardError
=>
e
Rails
.
logger
.
warn
"ForemanUuidBoot: skipping engine hook(
#{
e
}
)"
end
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment