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 0000000..850cf98 Binary files /dev/null and b/uploads/updates.img differ