SimpleBootServer - henk52/knowledgesharing GitHub Wiki
= Introduction =
-
http://kickstart-tools.sourceforge.net/howkickstartworks.html
-
http://serverfault.com/questions/340679/centos-6-kickstart-ignoring-selinux-disabled
-
Puppet in kickstart ** http://projects.puppetlabs.com/projects/1/wiki/bootstrapping_with_puppet ** http://projects.theforeman.org/projects/foreman/wiki/Kickstart
-
Kickstart ** http://fedoraproject.org/wiki/Anaconda/Kickstart#firstboot ** http://docs.fedoraproject.org/en-US/Fedora/20/html/Installation_Guide/ch-kickstart2.html ** http://docs.fedoraproject.org/en-US/Fedora/17/html/Installation_Guide/index.html ** http://llbb.wordpress.com/2007/06/14/installing-ubuntu-or-fedora-via-pxe-netboot/ ** http://docs.fedoraproject.org/en-US/Fedora/14/html/Storage_Administration_Guide/nfs-diskless-systems.html ** http://docs.oracle.com/cd/E37670_01/E37355/html/ol_config_os_containers.html ** http://wiki.pcprobleemloos.nl/using_lxc_linux_containers_on_debian_squeeze/creating_a_lxc_virtual_machine_template ** https://peterpap.net/index.php/Installing_CentOS/RedHat_on_disks_larger_than_2Tb
-
Jumpstart ** http://www.petertribble.co.uk/Solaris/isosetup.html
-
Ubuntu kickstart
-
FreeBSD pxe boot
-
rsync
-
Auto deploy/provisioning tools
- http://ifireball.wordpress.com/2013/01/08/quick-list-of-server-deploymentlife-cycle-management-systems/
- See: http://arstechnica.com/civis/viewtopic.php?f=16&t=1202969
- Cobbler
- RH Satellite
- Katello http://www.katello.org/
- razor
- crowbar
- spacewalk
-
fedorahosted.org/spin-kickstarts
-
- yum-config-manager
See: http://www.techrepublic.com/blog/linux-and-open-source/create-your-own-yum-repository/609/
-
Installing it
- sudo yum install createrepo
-
Creating the repo:
- This will create a
- yumdownloader --destdir DIR --resolve
install: sudo yum install yum-utils
- rpm -ql puppet
- rpm -qR puppet
Make sure the packages aren't there already. grep libyaml c601b1538f5b6e6f6d1e927cc1c6d51b8e00c70f51e5ec66e680fa581e2df069-filelists.xml | grep "<package" | awk -F '"' '{ print $4 }'
prompt 1
default netboot
timeout 1
# http://www.centos.org/docs/5/html/Installation_Guide-en-US/s1-kickstart2-startinginstall.html
label netboot
kernel centos_65_x86_64/vmlinuz
append initrd=centos_65_x86_64/initrd.img ksdevice=eth0 ks=nfs:10.1.2.3:/var/ks/configs/ks_centos-65-x86_64_nfs.cfg ramdisk_size=9216 noapic acpi=off selinux=0
#platform=x86, AMD64, or Intel EM64T
#version=DEVEL
# Install OS instead of upgrade
install
# Firewall configuration
firewall --disabled
# SELinux configuration
selinux --disabled
# Use text mode install
text
# Do not configure the X Window System
skipx
# Reboot after installation
reboot
# Keyboard layouts
keyboard 'us'
# Root password
rootpw --iscrypted $1$IjWi6ehu$LZ2U1SN7HwomM/uQWb6fJ1
# System timezone
timezone Europe/Amsterdam --isUtc
# System language
lang en_US
# Choose the installation media
nfs --server=10.1.2.3 --dir=/var/ks/images/centos_65_x86_64
# Network information
# See: http://docs.fedoraproject.org/en-US/Fedora/20/html/Installation_Guide/s1-kickstart2-options.html
network --device eth0 --bootproto dhcp
#network --device=eth0 --bootproto=dhcp
# System authorization information
auth --useshadow --passalgo=sha512
# System bootloader configuration
bootloader --location=mbr
# Clear the Master Boot Record
zerombr
# Partition clearing information
clearpart --all --initlabel
# Disk partitioning information
part swap --fstype="swap" --size=1024
part / --fstype="ext4" --grow --size=1
%packages
@core
%end
-
cd /etc/puppet/modules/
-
sudo tar -zxf /var/webstorage/puppet/puppetlabs-rsync-0.4.0.tar.gz
-
sudo ln -s puppetlabs-rsync-0.4.0 rsync
-
Puppet manifest:
rsync::server::module{ 'extrarepo':
path => "$szKickStartExtraRepos",
require => File[ "$szKickStartExtraRepos" ],
read_only => 'yes',
list => 'yes',
}
On the client node:
- rsync -avz rsync://10.1.2.3:/extrarepo/rhel_63_x86_64_puppetlabs rhel_63_x86_64_puppetlabs
1 dnf -y install https://yum.theforeman.org/releases/1.13/f24/x86_64/foreman-release.rpm 1 dnf -y install foreman-installer
- pungi -c /vagrant/files/fedora19_boot_server_ks.cfg --nosource --destdir=/var/ks/pungi --force >& pungi.log
- grep fail pungi.log | awk '{ print $2 }'
- or: grep fail pungi.log | awk '{ printf("%s ", $2) }'
- yumdownloader --resolve --destdir tmp tmux firstboot firstaidkit-plugin-passwd firstaidkit-plugin-key-recovery firstaidkit-plugin-mdadm-conf memtest86+ anaconda-dracut xorg-x11-drivers at-spi jfsutils python-volume_key volume_key system-storage-manager python-ethtool tigervnc-server-module mt-st hdparm libmlx4 madan-fonts xorg-x11-fonts-misc gdb-gdbserver python-epdb icfg yum-plugin-fastestmirror
- sudo cp ~vagrant/tmp/
*
.rpm /var/ks/repo/fedora-19/x86_64 - yumdownloader --resolve --destdir /var/ks/repo/fedora-19/x86_64 dbus-libs
- yumdownloader --resolve --destdir /var/ks/repo/fedora-19/x86_64 dbus
- pushd /var/ks/repo/fedora-19/x86_64
- sudo createrepo .
- sudo chown -R vagrant:vagrant .
- cd /var/ks/pungi
- Create it using: /usr/sbin/system-config-kickstart
- yum install system-config-kickstart
#platform=x86, AMD64, or Intel EM64T
#version=DEVEL
# This is for setting up a boot server, replicating itself ;-)
# TODO replace 'fedora-19' wit $releasever or whatever it is.
repo --name=local --baseurl=http://192.168.3.2/fedora-19/$basearch
repo --name=fedora19 --baseurl=http://192.168.3.2/images/fedora-19/$basearch
# Install OS instead of upgrade
install
# Firewall configuration
firewall --disabled
# Reboot after installation
reboot
# Root password
rootpw --iscrypted REPLACE_WITH_ENCRYPTED_PASSWORD
# System timezone
timezone CET --isUtc
# System language
lang en_US
# Use NFS installation media
nfs --server=192.168.3.2 --dir=/var/ks/images/fedora-19/x86_64
# Network information
network --bootproto=dhcp --device=eth0
network --bootproto=static --ip=192.168.3.2 --netmask=255.255.255.0 --gateway=192.168.3.2 --nameserver=192.168.3.2 --device=eth1
# System authorization information
auth --useshadow --passalgo=sha512
# Use text mode install
text
# SELinux configuration
selinux --disabled
# Do not configure the X Window System
skipx
# System bootloader configuration
bootloader --location=mbr
# Clear the Master Boot Record
zerombr
# Partition clearing information
clearpart --all --initlabel
# Disk partitioning information
part swap --fstype="swap" --size=1024
part / --fstype="ext4" --grow --size=1
%packages
@core
puppet
# grub2 to hopefully be able to install from an ISO.
grub2
lvm2
grub2-tools
grubby
kernel
# Puppet needs to be added and then that needs to take care of package installation and configuration.
# TODO NTP server.
# find packages with: rpm -qf /usr/sbin/ifconfig
# for debugging:
strace
tcpdump
# /usr/sbin/ifonfig
net-tools
%end
-
http://unix.stackexchange.com/questions/81240/manually-generate-password-for-etc-shadow
$hFinishedValues{EncryptedPassword} =
echo "ChangeMe"|openssl passwd -1 -stdin
; chomp($hFinishedValues{EncryptedPassword});
/var/tftp/pxelinux.0
- Part of the
- Defined in the dhcp.conf file as a general parameter:
filename "pxelinux.0";
1 "pxelinux.cfg/f57b9dda-d79e-4296-90a3-ab91a8565a8b" 1 "pxelinux.cfg/01-08-00-27-60-03-49" * Mac address with '01-' prepended to it. 1 "pxelinux.cfg/0A01E991" * IP address, that was given to the client. 1 "pxelinux.cfg/0A01E99" 1 "pxelinux.cfg/0A01E9" 1 "pxelinux.cfg/0A01E" 1 "pxelinux.cfg/0A01" 1 "pxelinux.cfg/0A0" 1 "pxelinux.cfg/0A" 1 "pxelinux.cfg/0" 1 "pxelinux.cfg/0" 1 "pxelinux.cfg/0" 1 "pxelinux.cfg/default"
- https://pubs.vmware.com/vsphere-51/index.jsp?topic=%2Fcom.vmware.vsphere.install.doc%2FGUID-5B132E25-0CFC-40D0-993D-40A83981E0E5.html
- http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=2004582
- http://www.virtuallyghetto.com/2012/09/automating-esxi-51-kickstart-tips-tricks.html
- http://www.routereflector.com/2014/01/unattended-vmware-esxi-installation-via-pxe-boot-and-kickstart/
- Fedora 20 takes up 56GB. 8 GB in the release and 48 GB in the update part.
The script for doing the update.
#!/bin/bash
rsync -vaH --filter=". fedora_filters.txt" --numeric-ids --delete rsync://dl.fedoraproject.org/fedora-enchilada /var/ks/repo
fedora_filters.txt
+ linux/
+ linux/updates/
+ linux/updates/20/
+ linux/updates/20/x86_64/
+ linux/updates/20/i386/
+ linux/releases/
+ linux/releases/20/
+ linux/releases/20/Fedora/
+ linux/releases/20/Fedora/x86_64/
+ linux/releases/20/Fedora/x86_64/os/
+ linux/releases/20/Fedora/i386/
+ linux/releases/20/Fedora/i386/os/
- linux/releases/20/Fedora/x86_64/*
- linux/releases/20/Fedora/i386/*
- linux/releases/20/Fedora/*
- linux/releases/20/*
- linux/releases/*
- linux/updates/20/i386/debug/*
- linux/updates/20/i386/drpms/*
- linux/updates/20/*
- linux/updates/*
- linux/*
I've started looking into foreman
- Foreman YouTube channel: https://www.youtube.com/channel/UCCo7AZ1oG6TbG0-dwjRqCmw
- katello: (Foreman deep dive: Introduction to Katello) https://www.youtube.com/watch?v=ggn85eNeqSQ = Troubleshooting =
YumRPMCheckError: [u ERROR with transaction check vs depsolve: , dbus-libs(x86-64) = 1:1.6.8-5.fc19 is needed by dbus-1:1.6.8-5.fc19.x86_64 ]
Hacking away:
cd /var/ks/repo/fedora-19/x86_64/
[root@vagrant-fedora-schrodinger x86_64]# ls | grep dbus
dbus-1.6.12-2.fc19.x86_64.rpm
dbus-glib-0.100-5.fc19.i686.rpm
dbus-libs-1.6.12-2.fc19.i686.rpm
dbus-libs-1.6.12-2.fc19.x86_64.rpm
[root@vagrant-fedora-schrodinger x86_64]# rm dbus-1.6.12-2.fc19.x86_64.rpm dbus-libs-1.6.12-2.fc19.i686.rpm dbus-libs-1.6.12-2.fc19.x86_64.rpm dbus-glib-0.100-5.fc19.i686.rpm
rm: remove regular file ‘dbus-1.6.12-2.fc19.x86_64.rpm’? y
rm: remove regular file ‘dbus-libs-1.6.12-2.fc19.i686.rpm’? y
rm: remove regular file ‘dbus-libs-1.6.12-2.fc19.x86_64.rpm’? y
rm: remove regular file ‘dbus-glib-0.100-5.fc19.i686.rpm’? y
createrepo .
Pungi:INFO: Adding repo ourtree
Pungi:INFO: URL for repo ourtree is ['file:///var/ks/pungi/20131209/x86_64/os']
hfsplus-tools-540.1.linux3-4.fc19.x86_64
checking for root privileges
checking the selinux mode
checking yum base object
setting up build architecture
setting up build parameters
installing runtime packages
got release: fedora-release
running runtime-install.tmpl
Looking for extra fedup-dracut packages...
installpkg *-fedup-dracut failed: No package(s) available to install
Warning: Reusing existing destination directory.
Could not find valid repo at: /var/ks/pungi/20131209/x86_64/os
Spawning worker 0 with 245 pkgs
Workers Finished
Saving Primary metadata
Saving file lists metadata
Saving other metadata
Generating sqlite DBs
Sqlite DBs complete
Could not find valid repo at: /var/ks/pungi/20131209/x86_64/debug
Saving Primary metadata
Saving file lists metadata
Saving other metadata
Generating sqlite DBs
Sqlite DBs complete
downloading packages
checking package signatures
running test transaction
template command error in runtime-install.tmpl:
run_pkg_transaction
YumRPMCheckError: [u'ERROR with transaction check vs depsolve:', 'dbus-libs(x86-64) = 1:1.6.8-5.fc19 is needed by dbus-1:1.6.8-5.fc19.x86_64']
Traceback (most recent call last):
File "/bin/pungi", line 256, in <module>
main()
File "/bin/pungi", line 146, in main
mypungi.doBuildinstall()
File "/usr/lib/python2.7/site-packages/pypungi/__init__.py", line 937, in doBuildinstall
workdir=workdir, outputdir=outputdir)
File "/usr/lib/python2.7/site-packages/pylorax/__init__.py", line 243, in run
rb.install()
File "/usr/lib/python2.7/site-packages/pylorax/treebuilder.py", line 104, in install
self._runner.run("runtime-install.tmpl")
File "/usr/lib/python2.7/site-packages/pylorax/ltmpl.py", line 180, in run
self._run(commands)
File "/usr/lib/python2.7/site-packages/pylorax/ltmpl.py", line 199, in _run
f(*args)
File "/usr/lib/python2.7/site-packages/pylorax/ltmpl.py", line 488, in run_pkg_transaction
rpmDisplay=LoraxRpmCallback())
File "/usr/lib/python2.7/site-packages/yum/__init__.py", line 6378, in processTransaction
self._doTestTransaction(callback,display=rpmTestDisplay)
File "/usr/lib/python2.7/site-packages/yum/__init__.py", line 6457, in _doTestTransaction
raise Errors.YumRPMCheckError,retmsgs
yum.Errors.YumRPMCheckError: [u'ERROR with transaction check vs depsolve:', 'dbus-libs(x86-64) = 1:1.6.8-5.fc19 is needed by dbus-1:1.6.8-5.fc19.x86_64']
Manually adding grub2 and lvm to the %packages section, fixed this.
During installation on the target the installation process fails with a long list of issues Where this stands out:
NoSuchPackage: grub2
I've only found this page with it: https://bugzilla.redhat.com/show_bug.cgi?id=871143
Possibly be inspired by: http://www.redhat.com/archives/fedora-buildsys-list/2008-July/msg00062.html
-
boot from cdrom
-
choose troublshooting
-
rescue the image
-
cd /mnt/sysimage/var/log/anaconda
-
grep WARN anaconda.log
-
grep ERR anacondo.log
-
WARN anaconda: no kernel was installed -- bootloader config unchanged
-
ERR anaconda: unknown selinux state: None
Sites to look at:
- http://nemeye.blogspot.com/2012/01/error-booting-centos-in-virtualbox.html
- http://www.wilderssecurity.com/showthread.php?t=339852
- http://rerouting.org/tip-trick/solved-booting-local-disk-fatal-int18-boot-failure-18.html
- http://www.dedoimedo.com/computers/fedora-fatal-18.html
alt-F2 will give you a command line prompt.
/tmp/anaconda.log will give you information on what has been going on so far.
Each of the %pre/%post scripts in the ks.cfg is stored, along with a log file in /tmp.
Perhaps adding: ksdevice=bootif
to the pxelinux.cfg file will help.
See below
'initrd=' was missing in the pxelinux.cfg boot command file.
For some reason 6.1 doesn't like to get the ks.cfg via http, but nfs works fine.
Add: kernel.x86_64 To the package list in the kickstart file.
This seems to have occurred due to the inclusion of an i386 repo.
Starting init: /bin/sh exists but couldn't execute it (error -8)
Kernel panic - not syncing: No working init found. Try passing init= option to kernel. See Linux Documentation/init.txt for guidance.
The real issue, one of the packages can't be resolved. Start removing packages from the install list until it works. One of the anaconda tabs may explain why.
https://bugzilla.redhat.com/show_bug.cgi?id=1419945
- Installation source 4) [!] Software selection (http://10.1.2.3/images/rhe (Source changed - please l73) verify)
The path given in --location was different from the path given in 'url' in the ks.cfg
Hope: I had generated a new repodata dir, I copied the original back in and hope this helps.
Running the command ends up with this anaconda error: NoSuchGroup: core