Skip to content

Instantly share code, notes, and snippets.

@vtta
Last active April 7, 2019 07:52
Show Gist options
  • Save vtta/0083133208969b4cf6e395e83896d4a6 to your computer and use it in GitHub Desktop.
Save vtta/0083133208969b4cf6e395e83896d4a6 to your computer and use it in GitHub Desktop.
A script to convert a CentOS Minimal to an oVirt template
#!/bin/bash
# A script to convert a CentOS Minimal to an oVirt template
yum install https://resources.ovirt.org/pub/yum-repo/ovirt-release43.rpm
yum install -y wget git vim ovirt-guest-agent-common cloud-init
yum clean all
systemctl enable ovirt-guest-agent
# systemctl enable cloud-init
echo > /etc/machine-id
rm -f /etc/ssh/ssh_host_*
rm -rf /root/.ssh/*
rm -f /root/anaconda-ks.cfg
rm -f /root/.bash_history
unset HISTFILE
rm -f /var/log/boot.log
rm -f /var/log/cron
rm -f /var/log/dmesg
rm -f /var/log/grubby
rm -f /var/log/lastlog
rm -f /var/log/maillog
rm -f /var/log/messages
rm -f /var/log/secure
rm -f /var/log/spooler
rm -f /var/log/tallylog
rm -f /var/log/wpa_supplicant.log
rm -f /var/log/wtmp
rm -f /var/log/yum.log
rm -f /var/log/audit/audit.log
rm -f /var/log/ovirt-guest-agent/ovirt-guest-agent.log
rm -f /var/log/tuned/tuned.log
sys-unconfig
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment