-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: prepare for using fedora image based ci
Signed-off-by: Ming Lei <[email protected]>
- Loading branch information
Ming Lei
committed
Aug 15, 2023
1 parent
e6a02dc
commit 8261bcf
Showing
8 changed files
with
70 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#cloud-config | ||
chpasswd: | ||
list: | | ||
root:linux | ||
expire: False | ||
ssh_pwauth: True | ||
resize_rootfs: noblock | ||
resize_rootfs: true | ||
|
||
bootcmd: | ||
- [ sh, -c, echo "=========bootcmd=========" ] | ||
|
||
runcmd: | ||
- [ sh, -c, echo "=========runcmd=========" ] | ||
- [ sh, -c, echo "deltarpm=false" >> /etc/dnf/dnf.conf ] | ||
- [ sh, -c, echo "keepcache=true" >> /etc/dnf/dnf.conf ] | ||
- [ sh, -c, echo "ip_resolve=4" >> /etc/dnf/dnf.conf ] | ||
- [ sh, -c, echo "fastestmirror=true" >> /etc/dnf/dnf.conf ] | ||
- [ sh, -c, echo "PermitRootLogin yes" >> /etc/ssh/sshd_config ] | ||
- [ sh, -c, sed -i '/^SELINUX=/ s/=.*/=disabled/' /etc/selinux/config ] | ||
- [ sh, -c, cat /etc/ssh/sshd_config ] | ||
- [ sh, -c, systemctl restart sshd ] | ||
|
||
final_message: "SYSTEM READY TO LOG IN" |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/bash | ||
|
||
VM_ID=$1 | ||
VM_DIR=$2 | ||
ROOT_SIZE=4G | ||
|
||
MY_DIR=$(cd "$(dirname "$0")";pwd) | ||
USER_DATA=${MY_DIR}/fedora-user-data | ||
LINK=https://ftp-nyc.osuosl.org/pub/fedora/linux/releases/38/Cloud/x86_64/images/Fedora-Cloud-Base-38-1.6.x86_64.qcow2 | ||
BASE_NAME=`basename $LINK` | ||
|
||
cd $VM_DIR | ||
|
||
rm -f $BASE_NAME | ||
wget $LINK | ||
#create root.qcow2, need qemu-system-x86 package | ||
qemu-img create -f qcow2 -F qcow2 -b `basename $LINK` root.qcow2 | ||
qemu-img resize root.qcow2 $ROOT_SIZE | ||
qemu-img info root.qcow2 | ||
|
||
echo "instance-id: ktest${VM_ID}" > ./meta-data | ||
echo "local-hostname: ktest-${VM_ID}" >> ./meta-data | ||
cp -f $USER_DATA ./user-data | ||
genisoimage -output seed.iso -volid cidata -joliet -rock user-data meta-data | ||
|
||
rm -f meta-data | ||
rm -f user-data | ||
cd - |