Move to all shell scripts
This commit is contained in:
+2
-4
@@ -9,10 +9,8 @@ isolinux.cfg
|
|||||||
Vagrantfile
|
Vagrantfile
|
||||||
|
|
||||||
# Generated distros
|
# Generated distros
|
||||||
distros/fedora-rawhide-*.hcl
|
distros/fedora/rawhide/*.hcl
|
||||||
distros/centos-8stream-*.hcl
|
distros/nixos/**/*.hcl
|
||||||
distros/centos-9stream-*.hcl
|
|
||||||
cellar/centos-9stream-*.hcl
|
|
||||||
|
|
||||||
__pycache__
|
__pycache__
|
||||||
*.pyc
|
*.pyc
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ sys.path.append(str(Path(__file__).parent / "lib"))
|
|||||||
from support import Support, BASE
|
from support import Support, BASE
|
||||||
import time
|
import time
|
||||||
|
|
||||||
|
source test.xsh
|
||||||
|
|
||||||
|
|
||||||
year, month, day, hour, minute, second, wday, jday, dst = time.localtime()
|
year, month, day, hour, minute, second, wday, jday, dst = time.localtime()
|
||||||
STAMP = f"build={year}.{month}.{day}.{hour}"
|
STAMP = f"build={year}.{month}.{day}.{hour}"
|
||||||
@@ -59,7 +61,12 @@ def do_build(build):
|
|||||||
packer build -var @(headless) -var @(args.stamp) @(build.var_file) @(build.only) @(BASE / "sources")
|
packer build -var @(headless) -var @(args.stamp) @(build.var_file) @(build.only) @(BASE / "sources")
|
||||||
else:
|
else:
|
||||||
upload = "-except=upload"
|
upload = "-except=upload"
|
||||||
packer build -var @(headless) -var @(args.stamp) @(build.var_file) @(build.only) -except=upload @(BASE / "sources")
|
# Skip building file if we already have built it
|
||||||
|
output = Path(__file__).parent / "output" / get_vagrant_provider(build.provider.name) / f"{build.distro}-{build.version}-{build.provider.arch}.box"
|
||||||
|
if output.exists():
|
||||||
|
print(f"Skipping {build} as box already exists")
|
||||||
|
else:
|
||||||
|
packer build -var @(headless) -var @(args.stamp) @(build.var_file) @(build.only) -except=upload @(BASE / "sources")
|
||||||
|
|
||||||
if args.all or (args.distro and args.version and args.build):
|
if args.all or (args.distro and args.version and args.build):
|
||||||
process_all()
|
process_all()
|
||||||
|
|||||||
@@ -83,16 +83,13 @@ EOF
|
|||||||
|
|
||||||
# sshd: disable password authentication and DNS checks
|
# sshd: disable password authentication and DNS checks
|
||||||
ex -s /etc/ssh/sshd_config <<EOF
|
ex -s /etc/ssh/sshd_config <<EOF
|
||||||
:%substitute/^\(PasswordAuthentication\) yes$/\1 no/
|
:%substitute/^.*\(PasswordAuthentication\) yes$/\1 yes/
|
||||||
:%substitute/^#\(UseDNS\) yes$/&\r\1 no/
|
:%substitute/^#\(UseDNS\) yes$/&\r\1 no/
|
||||||
:update
|
:update
|
||||||
:quit
|
:quit
|
||||||
EOF
|
EOF
|
||||||
cat >>/etc/sysconfig/sshd <<EOF
|
cat >>/etc/sysconfig/sshd <<EOF
|
||||||
|
echo PubkeyAcceptedKeyTypes +ssh-rsa >> /etc/ssh/sshd_config
|
||||||
echo << EOF > /etc/ssh/sshd_config.d/00-vagrant_accept_pubkey.conf
|
|
||||||
PubkeyAcceptedKeyTypes +ssh-rsa
|
|
||||||
EOF
|
|
||||||
|
|
||||||
# Decrease connection time by preventing reverse DNS lookups
|
# Decrease connection time by preventing reverse DNS lookups
|
||||||
# (see https://lists.centos.org/pipermail/centos-devel/2016-July/014981.html
|
# (see https://lists.centos.org/pipermail/centos-devel/2016-July/014981.html
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ EOF
|
|||||||
|
|
||||||
# sshd: disable password authentication and DNS checks
|
# sshd: disable password authentication and DNS checks
|
||||||
ex -s /etc/ssh/sshd_config <<EOF
|
ex -s /etc/ssh/sshd_config <<EOF
|
||||||
:%substitute/^\(PasswordAuthentication\) yes$/\1 no/
|
:%substitute/^.*\(PasswordAuthentication\) yes$/\1 yes/
|
||||||
:%substitute/^#\(UseDNS\) yes$/&\r\1 no/
|
:%substitute/^#\(UseDNS\) yes$/&\r\1 no/
|
||||||
:update
|
:update
|
||||||
:quit
|
:quit
|
||||||
|
|||||||
@@ -5,10 +5,8 @@ apt update
|
|||||||
apt upgrade -y
|
apt upgrade -y
|
||||||
|
|
||||||
# Configure sshd to be faster
|
# Configure sshd to be faster
|
||||||
echo << EOF > /etc/ssh/sshd_config.d/00-vagrant_accept_pubkey.conf
|
sed -i -E -e 's,^.*(UseDNS).*$,\1 No,' /etc/ssh/sshd_config
|
||||||
UseDNS no
|
echo "PubkeyAcceptedKeyTypes +ssh-rsa" >> /etc/ssh/sshd_config
|
||||||
PubkeyAcceptedKeyTypes +ssh-rsa
|
|
||||||
EOF
|
|
||||||
|
|
||||||
# Clean up after ourselves
|
# Clean up after ourselves
|
||||||
apt-get clean
|
apt-get clean
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
distro = "fedora"
|
distro = "fedora"
|
||||||
version = "rawhide"
|
version = "rawhide"
|
||||||
iso = {
|
iso = {
|
||||||
url = "https://download.fedoraproject.org/pub/fedora/linux/development/rawhide/Server/x86_64/iso/./Fedora-Server-dvd-x86_64-Rawhide-20230814.n.0.iso"
|
url = "https://download.fedoraproject.org/pub/fedora/linux/development/rawhide/Server/x86_64/iso/./Fedora-Server-dvd-x86_64-Rawhide-20230823.n.0.iso"
|
||||||
checksum = "e682844d4d61e9e51b5dd98ebabb4738ed3460d02e217125c6f77f9089c87142"
|
checksum = "4ed35d456b51b2d27cfa083220cc0ac4b593f63db0513d69d79af622711783a6"
|
||||||
}
|
}
|
||||||
boot_command = [
|
boot_command = [
|
||||||
"<up>e<down><down><end><bs><bs><bs><bs><bs>",
|
"<up>e<down><down><end><bs><bs><bs><bs><bs>",
|
||||||
|
|||||||
@@ -6,4 +6,4 @@
|
|||||||
- arch: x86_64
|
- arch: x86_64
|
||||||
provider: vmware-iso
|
provider: vmware-iso
|
||||||
38: *supp
|
38: *supp
|
||||||
rawhide: []
|
rawhide: *supp
|
||||||
|
|||||||
@@ -1 +1,2 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
set -ex
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -ex
|
set -ex
|
||||||
|
|
||||||
sed -i -e 's,#PROVIDER_PLACEHOLDER,guest-agent.nix,' /etc/nixos/configuration.nix
|
sed -i -e 's,#PROVIDER_PLACEHOLDER,./guest-agent.nix,' /etc/nixos/configuration.nix
|
||||||
cat << EOF > /etc/nixos/guest-agent.nix
|
cat << EOF > /etc/nixos/guest-agent.nix
|
||||||
{...}:
|
{...}:
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -ex
|
set -ex
|
||||||
|
|
||||||
sed -i -e 's,#PROVIDER_PLACEHOLDER,guest-agent.nix,' /etc/nixos/configuration.nix
|
sed -i -e 's,#PROVIDER_PLACEHOLDER,./guest-agent.nix,' /etc/nixos/configuration.nix
|
||||||
cat << EOF > /etc/nixos/guest-agent.nix
|
cat << EOF > /etc/nixos/guest-agent.nix
|
||||||
{...}:
|
{...}:
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -ex
|
set -ex
|
||||||
|
|
||||||
sed -i -e 's,#PROVIDER_PLACEHOLDER,guest-agent.nix,' /etc/nixos/configuration.nix
|
sed -i -e 's,#PROVIDER_PLACEHOLDER,./guest-agent.nix,' /etc/nixos/configuration.nix
|
||||||
cat << EOF > /etc/nixos/guest-agent.nix
|
cat << EOF > /etc/nixos/guest-agent.nix
|
||||||
{...}:
|
{...}:
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -ex
|
set -ex
|
||||||
|
|
||||||
|
apt update
|
||||||
apt install -y qemu-guest-agent
|
apt install -y qemu-guest-agent
|
||||||
systemctl start qemu-guest-agent
|
systemctl start qemu-guest-agent
|
||||||
systemctl enable qemu-guest-agent
|
systemctl enable qemu-guest-agent
|
||||||
|
|||||||
+1
-2
@@ -1,7 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
set -e
|
set -ex
|
||||||
set -x
|
|
||||||
|
|
||||||
rm -rf /home/vagrant/.ansible
|
rm -rf /home/vagrant/.ansible
|
||||||
sudo rm -rf /root/.ansible
|
sudo rm -rf /root/.ansible
|
||||||
|
|||||||
Reference in New Issue
Block a user