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
25f90795
Commit
25f90795
authored
6 years ago
by
Alexander Olofsson
Browse files
Options
Downloads
Patches
Plain Diff
Stub out some more unattend handling
parent
8f0c563d
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/host_extensions.rb
+1
-0
1 addition, 0 deletions
app/models/concerns/foreman_wds/host_extensions.rb
app/models/wds_server.rb
+20
-3
20 additions, 3 deletions
app/models/wds_server.rb
with
21 additions
and
3 deletions
app/models/concerns/foreman_wds/host_extensions.rb
+
1
−
0
View file @
25f90795
...
...
@@ -91,6 +91,7 @@ module ForemanWds
return
unless
client
wds_server
.
delete_client
(
client
)
wds_server
.
delete_unattend
(
self
)
true
rescue
ScriptError
,
StandardError
=>
ex
Rails
.
logger
.
error
"Failed to remove WDS client,
#{
ex
}
"
...
...
This diff is collapsed.
Click to expand it.
app/models/wds_server.rb
+
20
−
3
View file @
25f90795
...
...
@@ -102,7 +102,7 @@ class WdsServer < ApplicationRecord
end
def
ensure_unattend
(
host
)
r
eturn
# TODO
r
aise
NotImplementedException
,
'TODO: Not implemented yet'
connection
.
shell
(
:powershell
)
do
|
sh
|
unattend_path
=
''
# TODO: find or specify remoteinstall path as a parameter
unattend_file
=
"
#{
unattend_path
}
\\
#{
host
.
mac
.
tr
':'
,
'_'
}
.xml"
...
...
@@ -128,9 +128,26 @@ class WdsServer < ApplicationRecord
end
end
def
self
.
bootfile_path
(
architecture_name
,
loader
=
:bios
,
boot_type
=
:pxe
)
puts
"bootfile_path(
#{
architecture_name
.
inspect
}
,
#{
loader
.
inspect
}
,
#{
boot_type
.
inspect
}
)"
def
delete_unattend
(
host
)
raise
NotImplementedException
,
'TODO: Not implemented yet'
image
=
host
.
wds_facet
.
install_image
group
=
SETTINGS
[
:wds_unattend_group
]
if
group
image
=
image
.
dup
.
tap
{
|
i
|
i
.
image_group
=
group
}
else
image
.
file_name
=
"install-
#{
host
.
mac
.
tr
':'
,
'_'
}
.wim"
image
.
image_name
=
"
#{
image
.
image_name
}
(for
#{
host
.
name
}
)"
end
unattend_path
=
''
# TODO: find or specify remoteinstall path as a parameter
unattend_file
=
"
#{
unattend_path
}
\\
#{
host
.
mac
.
tr
':'
,
'_'
}
.xml"
connection
.
shell
(
:powershell
)
do
|
sh
|
sh
.
run
(
"Remove-WdsInstallImage -ImageGroup '
#{
image
.
image_group
}
' -ImageName '
#{
image
.
image_name
}
' -FileName '
#{
image
.
file_name
}
'"
)
sh
.
run
(
"Remove-Item -Path '
#{
unattend_file
}
'"
)
end
end
def
self
.
bootfile_path
(
architecture_name
,
loader
=
:bios
,
boot_type
=
:pxe
)
file_name
=
nil
if
boot_type
==
:local
file_name
=
'bootmgfw.efi'
if
loader
==
:uefi
...
...
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