Last active
August 29, 2015 14:13
-
-
Save imcleod/3d3348f866885cee97a7 to your computer and use it in GitHub Desktop.
CentOS CBS examples for docker and vagrant
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| install | |
| text | |
| keyboard us | |
| lang en_US.UTF-8 | |
| skipx | |
| network --device eth0 --bootproto dhcp | |
| rootpw %ROOTPW% | |
| firewall --disabled | |
| authconfig --enableshadow --enablemd5 | |
| selinux --enforcing | |
| timezone --utc America/New_York | |
| bootloader --location=mbr | |
| zerombr | |
| clearpart --all --drives=vda | |
| part biosboot --fstype=biosboot --size=1 | |
| part /boot --fstype ext4 --size=200 --ondisk=vda | |
| part pv.2 --size=1 --grow --ondisk=vda | |
| volgroup VolGroup00 --pesize=32768 pv.2 | |
| logvol swap --fstype swap --name=LogVol01 --vgname=VolGroup00 --size=768 --grow --maxsize=1536 | |
| logvol / --fstype ext4 --name=LogVol00 --vgname=VolGroup00 --size=1024 --grow | |
| reboot | |
| %packages | |
| @core | |
| %end | |
| %post | |
| # Needed to allow this to boot a second time with an unknown MAC | |
| grep -v HWADDR /etc/sysconfig/network-scripts/ifcfg-eth0 > /tmp/ifcfg-eth0 | |
| mv -f /tmp/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth0 | |
| %end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| install | |
| text | |
| keyboard us | |
| lang en_US.UTF-8 | |
| skipx | |
| network --device eth0 --bootproto dhcp | |
| rootpw %ROOTPW% | |
| firewall --disabled | |
| authconfig --enableshadow --enablemd5 | |
| selinux --enforcing | |
| timezone --utc America/New_York | |
| # The biosdevname and ifnames options ensure we get "eth0" as our interface | |
| # even in environments like virtualbox that emulate a real NW card | |
| bootloader --location=mbr --append="console=tty0 console=ttyS0,115200 net.ifnames=0 biosdevname=0" | |
| zerombr | |
| clearpart --all --drives=vda | |
| user --name=vagrant --password=vagrant | |
| part biosboot --fstype=biosboot --size=1 | |
| part /boot --fstype ext4 --size=200 --ondisk=vda | |
| part pv.2 --size=1 --grow --ondisk=vda | |
| volgroup VolGroup00 --pesize=32768 pv.2 | |
| logvol swap --fstype swap --name=LogVol01 --vgname=VolGroup00 --size=768 --grow --maxsize=1536 | |
| logvol / --fstype ext4 --name=LogVol00 --vgname=VolGroup00 --size=1024 --grow | |
| reboot | |
| %packages | |
| @core | |
| %end | |
| %post | |
| # Needed to allow this to boot a second time with an unknown MAC | |
| grep -v HWADDR /etc/sysconfig/network-scripts/ifcfg-eth0 > /tmp/ifcfg-eth0 | |
| mv -f /tmp/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth0 | |
| # sudo | |
| echo "%vagrant ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers.d/vagrant | |
| sed -i "s/^.*requiretty/#Defaults requiretty/" /etc/sudoers | |
| # 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 | |
| %end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| koji -p cbs image-build \ | |
| centos-7-docker-scratch 1 atomic7-el7.centos \ | |
| http://mirror.centos.org/centos/7/os/x86_64/ x86_64 \ | |
| --release=1 \ | |
| --distro RHEL-7.0 \ | |
| --ksver RHEL7 \ | |
| --kickstart=./centos-jeos-docker.ks \ | |
| --format=qcow2 \ | |
| --format=docker \ | |
| --scratch \ | |
| --nowait \ | |
| --disk-size=10 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # The current Factory/koji code enables rsync sync by default | |
| # to the Vagrant global default location in the guest, which is: | |
| # | |
| # /vagrant | |
| # | |
| # You can override this, for example for Atomic, where root is not | |
| # writeable, by adding the following option: | |
| # | |
| # --ova-option vagrant_sync_directory=/home/vagrant/sync \ | |
| # | |
| koji -p cbs image-build \ | |
| centos-7-atomic-imcleod-scratch 1 atomic7-el7.centos \ | |
| http://mirror.centos.org/centos/7/os/x86_64/ x86_64 \ | |
| --release=1 \ | |
| --distro RHEL-7.0 \ | |
| --ksver RHEL7 \ | |
| --kickstart=./centos-jeos-vagrant.ks \ | |
| --format=qcow2 \ | |
| --format=vsphere-ova \ | |
| --format=rhevm-ova \ | |
| --ova-option vsphere_ova_format=vagrant-virtualbox \ | |
| --ova-option rhevm_ova_format=vagrant-libvirt \ | |
| --scratch \ | |
| --nowait \ | |
| --disk-size=10 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment