Move everything off of Ansible

This commit is contained in:
Greg Hellings
2023-08-22 00:18:02 -05:00
parent d0672aa88c
commit b43b95e124
80 changed files with 525 additions and 111 deletions
+4 -7
View File
@@ -90,18 +90,16 @@ ex -s /etc/ssh/sshd_config <<EOF
EOF
cat >>/etc/sysconfig/sshd <<EOF
echo << EOF > /etc/ssh/sshd_config.d/00-vagrant_accept_pubkey.conf
PubkeyAcceptedKeyTypes +ssh-rsa
EOF
# Decrease connection time by preventing reverse DNS lookups
# (see https://lists.centos.org/pipermail/centos-devel/2016-July/014981.html
# and man sshd for more information)
OPTIONS="-u0"
EOF
# Default insecure vagrant key
mkdir -m 0700 -p /home/vagrant/.ssh
echo "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key" >> /home/vagrant/.ssh/authorized_keys
chmod 600 /home/vagrant/.ssh/authorized_keys
chown -R vagrant:vagrant /home/vagrant/.ssh
# Fix for issue #76, regular users can gain admin privileges via su
ex -s /etc/pam.d/su <<'EOF'
# allow vagrant to use su, but prevent others from becoming root or vagrant
@@ -152,4 +150,3 @@ rm -rf /etc/ssh/ssh_host_*
hostnamectl set-hostname localhost.localdomain
rm -rf /etc/udev/rules.d/70-*
%end
+6
View File
@@ -0,0 +1,6 @@
#!/usr/bin/env bash
set -ex
dnf -y update
dnf clean all
+6
View File
@@ -0,0 +1,6 @@
#!/usr/bin/env bash
set -ex
dnf install -y qemu-guest-agent
systemctl start qemu-guest-agent
systemctl enable qemu-guest-agent
+10
View File
@@ -0,0 +1,10 @@
#!/usr/bin/env bash
set -ex
packages="bzip2 dkms kernel-devel kernel-headers make perl gcc"
dnf install -y ${packages} # Intentionally not quoted
mount -t auto /home/vagrant/VBoxGuestAdditions.iso /mnt
/mnt/VBoxLinuxAdditions.run install 2>&1 | tee /root/vbox_addon_install.log
dnf uninstall -y ${packages} # Also intentionally not quoted
umount /mnt
rm /home/vagrant/VBoxGuestAdditions.iso
+4
View File
@@ -0,0 +1,4 @@
#!/usr/bin/env bash
set -ex
dnf install -y open-vm-tools
+2 -2
View File
@@ -1,5 +1,5 @@
distro = "centos"
version = "8stream"
distro = "centos-stream"
version = "8"
iso = {
url = "http://mirror.centos.org/centos/8-stream/isos/x86_64/CentOS-Stream-8-x86_64-latest-boot.iso"
checksum = "029ead89f720becd5ee2a8cf9935aad12fda7494d61674710174b4674b357530"
@@ -12,8 +12,8 @@ done
sha="$(cat "${checksums}" | grep latest-boot | grep SHA256 | cut -d' ' -f 4)"
cat << HERPDERP > "${name}"
distro = "centos"
version = "8stream"
distro = "centos-stream"
version = "8"
iso = {
url = "http://mirror.centos.org/centos/8-stream/isos/x86_64/CentOS-Stream-8-x86_64-latest-boot.iso"
checksum = "${sha}"
+4 -7
View File
@@ -99,18 +99,16 @@ ex -s /etc/ssh/sshd_config <<EOF
EOF
cat >>/etc/sysconfig/sshd <<EOF
echo << EOF > /etc/ssh/sshd_config.d/00-vagrant_accept_pubkey.conf
PubkeyAcceptedKeyTypes +ssh-rsa
EOF
# Decrease connection time by preventing reverse DNS lookups
# (see https://lists.centos.org/pipermail/centos-devel/2016-July/014981.html
# and man sshd for more information)
OPTIONS="-u0"
EOF
# Default insecure vagrant key
mkdir -m 0700 -p /home/vagrant/.ssh
echo "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key" >> /home/vagrant/.ssh/authorized_keys
chmod 600 /home/vagrant/.ssh/authorized_keys
chown -R vagrant:vagrant /home/vagrant/.ssh
# Fix for issue #76, regular users can gain admin privileges via su
ex -s /etc/pam.d/su <<'EOF'
# allow vagrant to use su, but prevent others from becoming root or vagrant
@@ -161,4 +159,3 @@ rm -rf /etc/ssh/ssh_host_*
hostnamectl set-hostname localhost.localdomain
rm -rf /etc/udev/rules.d/70-*
%end
+6
View File
@@ -0,0 +1,6 @@
#!/usr/bin/env bash
set -ex
dnf -y update
dnf clean all
+6
View File
@@ -0,0 +1,6 @@
#!/usr/bin/env bash
set -ex
dnf install -y qemu-guest-agent
systemctl start qemu-guest-agent
systemctl enable qemu-guest-agent
+10
View File
@@ -0,0 +1,10 @@
#!/usr/bin/env bash
set -ex
packages="bzip2 dkms kernel-devel kernel-headers make perl gcc"
dnf install -y ${packages} # Intentionally not quoted
mount -t auto /home/vagrant/VBoxGuestAdditions.iso /mnt
/mnt/VBoxLinuxAdditions.run install 2>&1 | tee /root/vbox_addon_install.log
dnf uninstall -y ${packages} # Also intentionally not quoted
umount /mnt
rm /home/vagrant/VBoxGuestAdditions.iso
+4
View File
@@ -0,0 +1,4 @@
#!/usr/bin/env bash
set -ex
dnf install -y open-vm-tools
+2 -2
View File
@@ -1,5 +1,5 @@
distro = "centos"
version = "9stream"
distro = "centos-stream"
version = "9"
iso = {
url = "https://mirror.stream.centos.org/9-stream/BaseOS/x86_64/iso/CentOS-Stream-9-latest-x86_64-boot.iso"
checksum = "be2104d6deac0bf5e52e7262511b7acd3cab0dff96ddef1f2604b2de892e060d"
@@ -14,8 +14,8 @@ sha="$(cat "${checksums}" | awk '/SHA256/ {print $4}')"
rm "${checksums}"
cat << HERPDERP > "${name}"
distro = "centos"
version = "9stream"
distro = "centos-stream"
version = "9"
iso = {
url = "${baseurl}"
checksum = "${sha}"