Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #
- # Installation: KVM - LXC - LetsEncrypt - Ovirt - The Foreman
- # Tested on HOST Xeon D-1520 64G with CentOS 7.2-1511
- # Inspiration: https://raymii.org/s/articles/virt-install_introduction_and_copy_paste_distro_install_commands.html
- # version 1.00
- # written by Henry den Hengst
- #
- #
- if [[ $EUID -ne 0 ]]; then
- echo "This script must be run as root"
- exit 1
- fi
- # MAKE SURE you have an active and static TCP/IP:
- # cat /etc/sysconfig/network-scripts/ifcfg-eth0
- # MAKE SURE you have configured your hostfile and DNS well:
- # cat /etc/hosts
- # hostname -f
- # MUST return with a FQDN
- cd /etc
- cp hosts hosts-backup
- wget -c https://dl.dropboxusercontent.com/u/36257811/hosts
- cd /root
- wget -c https://dl.dropboxusercontent.com/u/36257811/ovirt-answer.txt
- yum update
- setenforce 0
- sed -i 's!SELINUX=enforcing!SELINUX=disabled!g' /etc/selinux/config
- yum -y install deltarpm
- yum -y install qemu-kvm libvirt virt-install bridge-utils qemu-img libvirt-python libvirt-client libguestfs-tools-c git epel-release ntp
- yum install -y oz libguestfs-tools
- systemctl start libvirtd
- systemctl enable libvirtd
- mkdir /iso
- mkdir /iso-download
- mkdir /vm
- mkdir /scripts
- virsh pool-define-as VMpool01 dir - - - - "/vm/"
- virsh pool-build VMpool01
- virsh pool-start VMpool01
- virsh pool-autostart VMpool01
- qemu-img create -f raw /vm/VM-Vol1.img 100G
- # download all (current) templates to the local cache
- virt-builder --cache-all-templates
- #
- # automated KVM installation scripts of CentOS 7, OpenSUSE 13, Ubuntu 16.04 LTS and Debian 8
- cd /scripts
- wget -c https://dl.dropboxusercontent.com/u/36257811/centos7.sh
- chmod 755 centos7.sh
- # ./centos7.sh
- wget -c https://dl.dropboxusercontent.com/u/36257811/deb8.sh
- chmod 755 deb8.sh
- # ./deb8.sh
- wget -c https://dl.dropboxusercontent.com/u/36257811/opensuse13.sh
- chmod 755 opensuse13.sh
- # ./opensuse13.sh
- wget -c https://dl.dropboxusercontent.com/u/36257811/ubuntu1604.sh
- chmod 755 ubuntu1604.sh
- # ./ubuntu1604.sh
- wget -c https://dl.dropboxusercontent.com/u/36257811/win2012r2.sh
- chmod 755 win2012r2.sh
- wget -c https://dl.dropboxusercontent.com/u/36257811/autounattend.xml
- # ./win2012r2.sh
- wget -c https://dl.dropboxusercontent.com/u/36257811/create_autostart_iso.sh
- chmod 755 create_autostart_iso.sh
- # ./create_autostart_iso.sh
- #
- # Download Popular Linux Distro ISOs. Put a # before line to skip
- cd /iso-download
- wget -c http://releases.ubuntu.com/16.04/ubuntu-16.04.1-server-amd64.iso
- wget -c http://ftp.tudelft.nl/centos.org/7/isos/x86_64/CentOS-7-x86_64-Everything-1511.iso
- wget -c http://frafiles.pfsense.org/mirror/downloads/pfSense-CE-2.3.2-RELEASE-amd64.iso.gz
- gunzip pfSense-CE-2.3.2-RELEASE-amd64.iso.gz
- wget -c ftp://ftp.freebsd.org/pub/FreeBSD/releases/amd64/amd64/ISO-IMAGES/10.3/FreeBSD-10.3-RELEASE-amd64-dvd1.iso
- wget -c ftp://opensuse.mirrors.ovh.net/opensuse/distribution/13.2/iso/openSUSE-13.2-DVD-x86_64.iso
- wget -c http://slackware.mirrors.ovh.net/ftp.slackware.com/slackware64-14.2-iso/slackware64-14.2-install-dvd.iso
- wget -c http://archlinux.mirrors.ovh.net/archlinux/iso/2016.09.03/archlinux-2016.09.03-dual.iso
- wget -c http://download.fedoraproject.org/pub/fedora/linux/releases/24/Server/x86_64/iso/Fedora-Server-dvd-x86_64-24-1.2.iso
- wget -c https://dl.dropboxusercontent.com/u/36257811/en_windows_server_2012_r2_vl_with_update_x64_dvd_6052766.iso
- wget -c http://cdimage.debian.org/debian-cd/8.5.0/amd64/iso-dvd/debian-8.5.0-amd64-DVD-1.iso
- wget -c http://cdimage.debian.org/debian-cd/8.5.0/amd64/iso-dvd/debian-8.5.0-amd64-DVD-2.iso
- wget -c http://cdimage.debian.org/debian-cd/8.5.0/amd64/iso-dvd/debian-8.5.0-amd64-DVD-3.iso
- End of Downloading ISOs.
- #
- # Install the oVirt engine repository and then install the oVirt-engine package:
- hostnamectl set-hostname www.vendorlock.nl
- yum -y install http://plain.resources.ovirt.org/pub/yum-repo/ovirt-release40.rpm
- yum -y install ovirt-engine
- # engine-setup --generate-answer=/root/ovirt-answer.txt
- #
- # login with admin=admin password=password
- engine-setup --config=/root/ovirt-answer.txt
- #
- # UNDER CONSTRUCTION !!!
- # If you can help contact [email protected]
- #
- # Now let us clone the github repository of Let's encrypt
- # cd /root/
- # git clone https://github.com/letsencrypt/letsencrypt
- # cd to the letsencrypt directory
- # cd letsencrypt
- # Run the auto installer
- # ./letsencrypt-auto
- #
- # LetsEncrypt comes up with this error after installing:
- # " ovirt "sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target" "
- # https://bugzilla.redhat.com/show_bug.cgi?id=1336838
- # Letsencrypt is not in the default list of CAs in the Oracle Java JDK. Discussion here: https://community.letsencrypt.org/t/will-the-cross-root-cover-trust-by-the-default-list-in-the-jdk-jre/134
- # Therefor you will have to do without nice SSL certificate :(
- #
- # Install The Foreman
- # rpm -ivh https://yum.puppetlabs.com/puppetlabs-release-pc1-el-7.noarch.rpm
- # yum -y install epel-release https://yum.theforeman.org/releases/1.12/el7/x86_64/foreman-release.rpm
- # yum -y install foreman-installer
- # hostname -f
- # foreman-installer
Advertisement
Add Comment
Please, Sign In to add comment