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
2707fabd
Verified
Commit
2707fabd
authored
3 years ago
by
Alexander Olofsson
Browse files
Options
Downloads
Patches
Plain Diff
Support nextserver names if DHCP supports them
parent
5d5315c9
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/models/concerns/foreman_wds/nic_extensions.rb
+4
-1
4 additions, 1 deletion
app/models/concerns/foreman_wds/nic_extensions.rb
app/models/wds_server.rb
+5
-1
5 additions, 1 deletion
app/models/wds_server.rb
with
9 additions
and
2 deletions
app/models/concerns/foreman_wds/nic_extensions.rb
+
4
−
1
View file @
2707fabd
...
...
@@ -10,7 +10,10 @@ module ForemanWds
def
boot_server
return
super
if
host
.
nil?
||
!
host
.
wds?
||
host
.
wds_facet
.
nil?
return
host
.
wds_server
.
next_server_ip
if
host
.
build?
# TODO: Support choosing local boot method
if
host
.
build?
# TODO: Support choosing local boot method
return
host
.
wds_server
.
next_server_ip
unless
subnet
.
dhcp
.
has_capability?
(
:DHCP
,
:dhcp_filename_hostname
)
return
host
.
wds_server
.
next_server_name
end
super
end
...
...
This diff is collapsed.
Click to expand it.
app/models/wds_server.rb
+
5
−
1
View file @
2707fabd
...
...
@@ -110,8 +110,12 @@ class WdsServer < ApplicationRecord
end
end
def
next_server_name
URI
(
url
).
host
end
def
next_server_ip
res
=
Resolv
::
DNS
.
open
{
|
dns
|
dns
.
getaddresses
(
URI
(
url
).
host
)
}.
select
{
|
addr
|
addr
.
is_a?
Resolv
::
IPv4
}.
first
res
=
Resolv
::
DNS
.
open
{
|
dns
|
dns
.
getaddresses
(
next_server_name
)
}.
select
{
|
addr
|
addr
.
is_a?
Resolv
::
IPv4
}.
first
return
res
.
to_s
if
res
IPSocket
.
getaddress
URI
(
url
).
host
...
...
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