mirror of
https://github.com/rocky-linux/createhdds.git
synced 2024-11-17 18:51:25 +00:00
keep upload files locally, activate network in kickstarts
Summary: I've come to dislike the approach where we source files that get included in the disk images remotely; it's unnecessarily complicated and needlessly exposes us to unexpected changes in the remote files. So simply keep the files in this git repo instead, none of them is very big. This also simplifies the code. Also, change all the kickstarts to specify --device=link and --activate on their network lines. These arguments *should* be included, according to the documentation (the first to specify which device the config is for, the second to specify that it should be activated in the installer environment), and I think the lack of the second is actually now a problem for the FreeIPA kickstart enrolment test (not sure exactly what changed to make this a problem where it wasn't before, but *something* has, and this fixes it). Test Plan: check that all tests still run properly. The FreeIPA enrolment kickstart test should now get somewhat further. Before this change, for F25 and Rawhide, it fails to enrol at all during install. Now it should enrol properly - that's what the kickstart changes fix, it was failing because it wasn't using the right network config - but it still fails when trying to log in as test1, due to RHBZ #1366403 . Reviewers: jskladan, garretraziel Reviewed By: garretraziel Subscribers: tflink Differential Revision: https://phab.qadevel.cloud.fedoraproject.org/D968
This commit is contained in:
parent
fe8a8e6665
commit
8c0493ac35
@ -144,24 +144,11 @@ class GuestfsImage(object):
|
||||
# download a file from an http server and transfer that
|
||||
# to the image
|
||||
for upload in self.uploads:
|
||||
# download the file to a temp file - borrowed from
|
||||
# fedora_openqa_schedule (which stole it from SO)
|
||||
(_, tmpfname) = tempfile.mkstemp(prefix="createhdds")
|
||||
with open(tmpfname, 'wb') as tmpfh:
|
||||
resp = urlopen(upload['source'])
|
||||
while True:
|
||||
# This is the number of bytes to read between buffer
|
||||
# flushes. Value taken from the SO example.
|
||||
buff = resp.read(8192)
|
||||
if not buff:
|
||||
break
|
||||
tmpfh.write(buff)
|
||||
# as with write, the dict must specify a target
|
||||
# partition and location ('target')
|
||||
partn = gfs.list_partitions()[int(upload['part'])-1]
|
||||
gfs.mount(partn, "/")
|
||||
gfs.upload(tmpfname, upload['target'])
|
||||
os.remove(tmpfname)
|
||||
gfs.upload('/'.join((SCRIPTDIR, 'uploads', upload['source'])), upload['target'])
|
||||
gfs.sync()
|
||||
gfs.umount_opts("/")
|
||||
# we're all done! rename to the correct name
|
||||
|
10
hdds.json
10
hdds.json
@ -54,7 +54,7 @@
|
||||
{
|
||||
"name" : "ks",
|
||||
"size" : "100M",
|
||||
"imgver" : "2",
|
||||
"imgver" : "3",
|
||||
"parts" : [
|
||||
{
|
||||
"filesystem" : "ext4",
|
||||
@ -67,17 +67,17 @@
|
||||
{
|
||||
"part" : "1",
|
||||
"target" : "/root-user-crypted-net.ks",
|
||||
"source" : "https://jskladan.fedorapeople.org/kickstarts/root-user-crypted-net.ks"
|
||||
"source" : "root-user-crypted-net.ks"
|
||||
},
|
||||
{
|
||||
"part" : "1",
|
||||
"target" : "/freeipa.ks",
|
||||
"source" : "https://www.happyassassin.net/ks/oqipas.ks"
|
||||
"source" : "freeipa.ks"
|
||||
},
|
||||
{
|
||||
"part" : "1",
|
||||
"target" : "/freeipaclient.ks",
|
||||
"source" : "https://www.happyassassin.net/ks/oqipac.ks"
|
||||
"source" : "freeipaclient.ks"
|
||||
}
|
||||
]
|
||||
},
|
||||
@ -98,7 +98,7 @@
|
||||
{
|
||||
"part" : "1",
|
||||
"target" : "/updates.img",
|
||||
"source" : "https://fedorapeople.org/groups/qa/updates/updates-openqa.img"
|
||||
"source" : "updates.img"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
17
uploads/freeipa.ks
Normal file
17
uploads/freeipa.ks
Normal file
@ -0,0 +1,17 @@
|
||||
install
|
||||
cdrom
|
||||
bootloader --location=mbr
|
||||
network --device=link --activate --bootproto=static --ip=10.0.2.100 --netmask=255.255.255.0 --gateway=10.0.2.2 --hostname=ipa001.domain.local
|
||||
lang en_US.UTF-8
|
||||
keyboard us
|
||||
timezone --utc America/New_York
|
||||
clearpart --all
|
||||
autopart
|
||||
%packages
|
||||
@^server-product-environment
|
||||
@freeipa-server
|
||||
# we need this to create the fake repo to make DNF happy for offline deployment
|
||||
createrepo_c
|
||||
%end
|
||||
rootpw anaconda
|
||||
reboot
|
15
uploads/freeipaclient.ks
Normal file
15
uploads/freeipaclient.ks
Normal file
@ -0,0 +1,15 @@
|
||||
install
|
||||
cdrom
|
||||
bootloader --location=mbr
|
||||
network --device=link --activate --bootproto=static --ip=10.0.2.101 --netmask=255.255.255.0 --gateway=10.0.2.2 --hostname=client001.domain.local --nameserver=10.0.2.100
|
||||
lang en_US.UTF-8
|
||||
keyboard us
|
||||
timezone --utc America/New_York
|
||||
clearpart --all
|
||||
autopart
|
||||
%packages
|
||||
@^server-product-environment
|
||||
%end
|
||||
rootpw anaconda
|
||||
reboot
|
||||
realm join --one-time-password=monkeys ipa001.domain.local
|
18
uploads/root-user-crypted-net.ks
Normal file
18
uploads/root-user-crypted-net.ks
Normal file
@ -0,0 +1,18 @@
|
||||
install
|
||||
bootloader --location=mbr
|
||||
network --device=link --activate --bootproto=dhcp
|
||||
url --mirrorlist=https://mirrors.fedoraproject.org/mirrorlist?repo=fedora-$releasever&arch=$basearch
|
||||
lang en_US.UTF-8
|
||||
keyboard us
|
||||
timezone --utc America/New_York
|
||||
clearpart --all
|
||||
autopart
|
||||
|
||||
rootpw --iscrypted $6$ansiogjasd0io9u3$9E1vMbLbXW14grtguedFGVjvhyBz1T.KIA3MJl1SWnGbtTpiXIAjbazIQAUKRNkNIEmd3mI0NCkFIVBrN41fZ.
|
||||
user --name=test --password=$6$ansioasgfgadsghd$O8O8zom5hx.V8ib1jV91xuvIgYqA2b99tzhibkk3URITdCrDtbRbwJjMK1kW4l0/9W0brraGC4NUBtDoGv4Kl. --iscrypted
|
||||
|
||||
reboot
|
||||
|
||||
%packages
|
||||
@core
|
||||
%end
|
BIN
uploads/updates.img
Normal file
BIN
uploads/updates.img
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user