From 8c0493ac353dd03f8b5c7bf9cbd9b9a7889b18bf Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Mon, 15 Aug 2016 17:02:05 -0700 Subject: [PATCH] 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 --- createhdds.py | 15 +-------------- hdds.json | 10 +++++----- uploads/freeipa.ks | 17 +++++++++++++++++ uploads/freeipaclient.ks | 15 +++++++++++++++ uploads/root-user-crypted-net.ks | 18 ++++++++++++++++++ uploads/updates.img | Bin 0 -> 233 bytes 6 files changed, 56 insertions(+), 19 deletions(-) create mode 100644 uploads/freeipa.ks create mode 100644 uploads/freeipaclient.ks create mode 100644 uploads/root-user-crypted-net.ks create mode 100644 uploads/updates.img diff --git a/createhdds.py b/createhdds.py index 07a2812..319d676 100755 --- a/createhdds.py +++ b/createhdds.py @@ -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 diff --git a/hdds.json b/hdds.json index eca5c18..7975775 100644 --- a/hdds.json +++ b/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" } ] }, diff --git a/uploads/freeipa.ks b/uploads/freeipa.ks new file mode 100644 index 0000000..199d948 --- /dev/null +++ b/uploads/freeipa.ks @@ -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 diff --git a/uploads/freeipaclient.ks b/uploads/freeipaclient.ks new file mode 100644 index 0000000..d1ed3e2 --- /dev/null +++ b/uploads/freeipaclient.ks @@ -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 diff --git a/uploads/root-user-crypted-net.ks b/uploads/root-user-crypted-net.ks new file mode 100644 index 0000000..4a4fcc3 --- /dev/null +++ b/uploads/root-user-crypted-net.ks @@ -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 diff --git a/uploads/updates.img b/uploads/updates.img new file mode 100644 index 0000000000000000000000000000000000000000..850cf987c37da1c5156661f904edfee5c11721f0 GIT binary patch literal 233 zcmVt1Kp3y3W87&hF$v)bUJCx93z6R@EfSdTxwOu41hER6MN%)<1Mm2qQFS5s~6Lm1)(MT0B=#Ql%0l1))iO6i&R*vL`f+%e-OHN+=SR juK6?n`ePDP@5VS?*oF3H>xZH!a(~PPOVdmK00aO4klb;X literal 0 HcmV?d00001