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
2f775ea0
Verified
Commit
2f775ea0
authored
3 years ago
by
Alexander Olofsson
Browse files
Options
Downloads
Patches
Plain Diff
Add wds-localboot parameter for template usage
parent
2707fabd
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/controllers/concerns/foreman_wds/unattended_controller_extensions.rb
+5
-0
5 additions, 0 deletions
.../concerns/foreman_wds/unattended_controller_extensions.rb
app/models/concerns/foreman_wds/host_extensions.rb
+10
-0
10 additions, 0 deletions
app/models/concerns/foreman_wds/host_extensions.rb
with
15 additions
and
0 deletions
app/controllers/concerns/foreman_wds/unattended_controller_extensions.rb
+
5
−
0
View file @
2f775ea0
...
...
@@ -30,6 +30,11 @@ module ForemanWds
iface
.
send
:rebuild_tftp
iface
.
send
:rebuild_dhcp
@host
.
parameters
.
where
(
name:
'wds-specifictemplate'
).
first_or_initialize
.
tap
do
|
p
|
p
.
value
=
'local-boot'
p
.
save
end
render
inline:
"Success. Local boot template was deployed successfully.
\n
"
rescue
StandardError
=>
e
message
=
format
(
'Failed to set local boot template: %{error}'
,
error:
e
)
...
...
This diff is collapsed.
Click to expand it.
app/models/concerns/foreman_wds/host_extensions.rb
+
10
−
0
View file @
2f775ea0
...
...
@@ -3,6 +3,7 @@ module ForemanWds
def
self
.
prepended
(
base
)
base
.
class_eval
do
after_build
:ensure_wds_client
after_build
:ensure_wds_boot
before_provision
:remove_wds_client
has_one
:wds_facet
,
...
...
@@ -89,6 +90,15 @@ module ForemanWds
private
def
ensure_wds_boot
return
unless
wds?
parameters
.
where
(
name:
'wds-specifictemplate'
).
each
(
&
:destroy
)
Rails
.
logger
.
info
'Ensuring WDS boot'
rescue
StandardError
=>
ex
Rails
.
logger
.
error
"Failed to ensure WDS boot,
#{
ex
}
"
end
def
ensure_wds_client
raise
NotImplementedError
,
'Not implemented yet'
return
unless
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