install text #%include /tmp/source.ks cdrom reboot --eject lang en_US.UTF-8 keyboard us rootpw r00tme timezone --utc Etc/UTC firewall --disabled selinux --disabled # ignore unsupported hardware warning unsupported_hardware # SKIP CONFIGURING X skipx repo --name="mos-centos" --baseurl=file:///run/install/repo/mos-centos/ --cost=100 # NEVER ever place zerombr here, it breaks automated installation %include /tmp/bootloader.ks %include /tmp/partition.ks %include /tmp/post_partition.ks %packages --nobase @Core fuel fuel-library fuel-dockerctl authconfig bind-utils bridge-utils cronie crontabs curl dhcp docker fuel-bootstrap-cli fuel-bootstrap-image # NOTE(kozhukalov): We don't need target centos images in 8.0 # fuel-target-centos-images7.1.1503 fuelmenu fuel-docker-images fuel-mirror fuel-openstack-metadata gdisk lrzip lsof man mlocate nmap-ncat ntp ntpdate openssh-clients policycoreutils python-pypcap rsync puppet rubygem-netaddr rubygem-openstack selinux-policy-targeted strace sysstat system-config-firewall-base tcpdump telnet vim virt-what wget yum yum-plugin-priorities %end # PREINSTALL SECTION # HERE ARE COMMANDS THAT WILL BE LAUNCHED BEFORE # INSTALLATION PROCESS ITSELF %pre #!/bin/sh # hard drives drives="" removable_drives="" for drv in `ls -1 /sys/block | grep "sd\|hd\|vd\|cciss"`; do if !(blkid | grep -q "${drv}.*Fuel"); then if (grep -q 0 /sys/block/${drv}/removable); then drives="${drives} ${drv}" else removable_drives="${removable_drives} ${drv}" fi fi done default_drive=`echo ${drives} ${removable_drives} | awk '{print $1}'` installdrive=${installdrive:-undefined} forceformat=${forceformat:-no} for I in $(cat /proc/cmdline); do case "$I" in *=*) if ! [[ "${I}" =~ "." ]]; then eval "$I"; fi ;; esac done set ${drives} ${removable_drives} numdrives=`echo $#` tgtdrive="${installdrive}" function confirm_format { check_drive="$1" local confirm_format="no" if [[ "$forceformat" == "yes" ]] ; then return 0 fi if parted -s /dev/$check_drive print &>/dev/null ; then echo echo "$check_drive drive contains partition table:" parted -s /dev/$check_drive print echo read -p "Are you sure you want to erase ALL data on disk $check_drive? (y/N)" confirm_format if [[ "$confirm_format" == "y" ]] || [[ "$confirm_format" == "Y" ]] || [[ "$forceformat" == "yes" ]]; then return 0 else return 1 fi else return 0 fi } format_confirmed="no" if [ $numdrives -lt 1 ]; then exec < /dev/tty3 > /dev/tty3 2>&1 chvt 3 clear echo echo '********************************************************************' echo '* E R R O R *' echo '* *' echo '* There is no suitable media available for installation. *' echo '* Please attach a drive and try again. *' echo '*
nose # LGPL
coverage!=4.4,>=4.0 # Apache-2.0
/ cp ${SOURCE}/.treeinfo ${repodir}/centos/x86_64 # Copying Ubuntu files mkdir -p ${repodir}/ubuntu/x86_64/images cp -r ${SOURCE}/ubuntu/dists ${repodir}/ubuntu/x86_64 cp -r ${SOURCE}/ubuntu/pool ${repodir}/ubuntu/x86_64 # We do not ship debian-installer kernel and initrd on ISO. # But we still need to be able to create ubuntu cobbler distro # which requires kernel and initrd to be available. So, we # just touch these files to work around cobbler's limitation. touch ${repodir}/ubuntu/x86_64/images/linux touch ${repodir}/ubuntu/x86_64/images/initrd.gz # make links for backward compatibility ln -s ${repodir}/centos ${wwwdir}/centos ln -s ${repodir}/ubuntu ${wwwdir}/ubuntu #Make a symlink for mos-centos in /var/www/nailgun in iso/ks.template ln -s ${repodir}/mos-centos ${wwwdir}/mos-centos ln -s ${repodir}/extra-repos ${wwwdir}/extra-repos mkdir -p ${wwwdir}/targetimages cp ${SOURCE}/send2syslog.py /bin/send2syslog.py mkdir -p /var/lib/hiera touch /var/lib/hiera/common.yaml /etc/puppet/hiera.yaml # Prepare local repository specification rm /etc/yum.repos.d/CentOS*.repo cp ${SOURCE}/extra-repos/extra.repo /etc/yum.repos.d/ cat > /etc/yum.repos.d/nailgun.repo << EOF [nailgun] name=Nailgun Local Repo baseurl=file:/var/www/nailgun/${OPENSTACK_VERSION}/centos/x86_64 gpgcheck=0 [mos] name=MOS Local Repo baseurl=file:/var/www/nailgun/${OPENSTACK_VERSION}/mos-centos/x86_64 gpgcheck=0 EOF %end %post --log=/root/anaconda-post-configure-sysconfig.log #!/bin/bash set -x source "/root/anaconda.cmdline.vars" SOURCE=/tmp/source # Set correct docker volume group echo "VG=docker" >> /etc/sysconfig/docker-storage-setup # Disable create iptables rules by docker echo "DOCKER_NETWORK_OPTIONS=--iptables=false" > /etc/sysconfig/docker-network # Disable subscription-manager plugins sed -i 's/^enabled.*/enabled=0/' /etc/yum/pluginconf.d/product-id.conf || : sed -i 's/^enabled.*/enabled=0/' /etc/yum/pluginconf.d/subscription-manager.conf || : # Disable GSSAPI in ssh server config sed -i -e "/^\s*GSSAPICleanupCredentials yes/d" -e "/^\s*GSSAPIAuthentication yes/d" /etc/ssh/sshd_config # Enable MOTD banner in sshd sed -i -e "s/^\s*PrintMotd no/PrintMotd yes/g" /etc/ssh/sshd_config # Add note regarding local repos creation to MOTD cat >> /etc/motd << EOF All environments use online repositories by default. Use the following commands to create local repositories on master node and change default repository settings: * CentOS: fuel-mirror (see --help for options) * Ubuntu: fuel-mirror (see --help for options) Please refer to the following guide for more information: https://docs.mirantis.com/openstack/fuel/fuel-7.0/reference-architecture.html#fuel-rep-mirror EOF # Install bootstrap_admin_node.sh and enabling it install -m 0777 -D ${SOURCE}/bootstrap_admin_node.sh /usr/local/sbin/bootstrap_admin_node.sh echo "ENABLED=1" > /etc/sysconfig/bootstrap_admin_node # Copying version.yaml file. It contains COMMIT_SHA of last commit. RELEASE=$(awk '/release/{gsub(/"/, "");print $2}' ${SOURCE}/version.yaml) mkdir -p /etc/nailgun /etc/fuel/${RELEASE} /etc/fuel/release_versions cp ${SOURCE}/version.yaml /etc/nailgun/version.yaml cp ${SOURCE}/version.yaml /etc/fuel/${RELEASE}/version.yaml ln -s /etc/fuel/${RELEASE}/version.yaml /etc/fuel/version.yaml cp ${SOURCE}/version.yaml /etc/fuel/release_versions/`cat ${SOURCE}/openstack_version`.yaml # Generete Fuel UUID uuidgen > /etc/fuel/fuel-uuid # Prepare bootstrap_admin_node config cat > /etc/fuel/bootstrap_admin_node.conf << EOF #Set to yes to run Fuel Setup #Set to no to accept default settings ADMIN_INTERFACE=${adminif} showmenu=${showmenu:-no} wait_for_external_config=${wait_for_external_config:-no} EOF # Prepare custom /etc/issue logon banner and script for changing IP in it # We can have several interface naming schemes applied and several interface # UI will listen on ipstr="" NL=$'\n' for ip in `ip -o -4 a | grep -e "e[nt][hopsx].*" | awk '{print \$4 }' | cut -d/ -f1`; do ipstr="${ipstr}https://${ip}:8443${NL}" done cat > /etc/issue <> /etc/ntp.conf # Disabling splash sed -i --follow-symlinks -e '/^\slinux16/ s/rhgb/debug/' /boot/grub2/grub.cfg # Copying default bash settings to the root directory cp -f /etc/skel/.bash* /root/ # Blacklist i2c_piix4 module for VirtualBox so it does not create kernel errors (virt-what | fgrep -q "virtualbox") && echo "blacklist i2c_piix4" > /etc/modprobe.d/blacklist-i2c-piix4.conf # Blacklist intel_rapl module for VirtualBox so it does not create kernel errors (virt-what | fgrep -q "virtualbox") && echo "blacklist intel_rapl" > /etc/modprobe.d/blacklist-intel-rapl.conf # Disable sshd until after Fuel Setup if not running on VirtualBox # TODO(mattymo): Remove VBox exception after LP#1487047 is fixed (virt-what | fgrep -q "virtualbox") || systemctl disable sshd %end %post --log=/root/anaconda-post-configure-autologon.log #!/bin/bash set -x # Enable once root autologin for initial setup mkdir -p /etc/systemd/system/getty@tty1.service.d/ cat > /etc/systemd/system/getty@tty1.service.d/autologin.conf << 'EOF' [Service] ExecStart= ExecStart=-/sbin/agetty --autologin root --noclear %I 115200 linux EOF # Exec bootstrap_admin_node.sh if autologin enabled cat >> /root/.bashrc << 'EOF' if [[ "$(tty)" == "/dev/tty1" && -f /etc/systemd/system/getty@tty1.service.d/autologin.conf ]]; then rm -Rf "/etc/systemd/system/getty@tty1.service.d" /bin/systemctl daemon-reload if [ -x /usr/local/sbin/bootstrap_admin_node.sh ]; then exec /usr/local/sbin/bootstrap_admin_node.sh fi fi EOF %end %post --nochroot --log=/mnt/sysimage/root/anaconda-post-interface-settings.log #!/bin/bash set -x source "/mnt/sysimage/root/anaconda.cmdline.vars" if [[ ! -z $adminif ]]; then rm -f /mnt/sysimage/etc/sysconfig/network-scripts/ifcfg-${ifname%%:*} sed "s/${ifname%%:*}/${adminif}/g" \ /etc/sysconfig/network-scripts/ifcfg-${ifname%%:*} > \ /mnt/sysimage/etc/sysconfig/network-scripts/ifcfg-${adminif} fi %end