Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
foreman_wds
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_wds
Commits
924a89d9
Commit
924a89d9
authored
6 years ago
by
Alexander Olofsson
Browse files
Options
Downloads
Patches
Plain Diff
Add an endpoint to allow switching to local boot
parent
755dde8f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/controllers/concerns/foreman_wds/hosts_controller_extensions.rb
+22
-0
22 additions, 0 deletions
...llers/concerns/foreman_wds/hosts_controller_extensions.rb
with
22 additions
and
0 deletions
app/controllers/concerns/foreman_wds/hosts_controller_extensions.rb
+
22
−
0
View file @
924a89d9
...
...
@@ -8,6 +8,28 @@ module ForemanWds
render
partial:
'wds_servers/image_select'
,
locals:
{
item:
wds_facet
}
end
def
host_template
return
super
unless
params
[
:kind
]
==
'wds_localboot'
iface
=
@host
.
provision_interface
# Set PXE template parameters
@kernel
=
@host
.
operatingsystem
.
kernel
(
@host
.
arch
)
@initrd
=
@host
.
operatingsystem
.
initrd
(
@host
.
arch
)
@mediapath
=
@host
.
operatingsystem
.
mediumpath
(
@host
)
if
@host
.
operatingsystem
.
respond_to?
(
:mediumpath
)
# Xen requires additional boot files.
@xen
=
@host
.
operatingsystem
.
xen
(
host
.
arch
)
if
@host
.
operatingsystem
.
respond_to?
(
:xen
)
iface
.
send
:default_pxe_render
,
@host
.
operatingsystem
.
pxe_loader_kind
(
@host
)
render
inline:
"Success. Local boot template was deployed successfully.
\n
"
rescue
StandardError
=>
e
message
=
format
(
'Failed to set local boot template: %{error}'
,
error:
e
)
logger
.
error
message
render
text:
message
,
status: :error
,
content_type:
'text/plain'
end
def
host_params
(
top_level_hash
=
controller_name
.
singularize
)
# Don't create a WDS facet unless provisioning with it
params
[
:host
].
delete
:wds_facet_attributes
if
params
[
:host
]
&&
params
[
:host
][
:provision_method
]
!=
'wds'
...
...
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