├── .gitignore ├── CHANGELOG.md ├── LICENSE ├── README.md ├── http ├── ks.cfg ├── ks_cloud_centos.cfg └── ks_cloud_oel.cfg ├── packer-centos-6.json ├── packer-oel-6.json ├── packer-rhel-6.json └── scripts ├── base.sh ├── chef.sh ├── cleanup.sh ├── cloud.sh ├── cloud_oel.sh ├── development.sh ├── epel.sh ├── puppet.sh ├── rhn_reg.sh ├── rhn_unreg.sh ├── vagrant.sh ├── virtualbox.sh └── zerodisk.sh /.gitignore: -------------------------------------------------------------------------------- 1 | prepare 2 | /packer_cache/* 3 | /img* 4 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | ## 2.0 (June, 2015) 4 | 5 | * update to latest 6.6 versions 6 | * implement file system resize 7 | * remove swap partitions for cloud images 8 | 9 | ## v1.1 (March 04, 2014) 10 | 11 | * Initial release 12 | 13 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | 2 | Apache License 3 | Version 2.0, January 2004 4 | http://www.apache.org/licenses/ 5 | 6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 7 | 8 | 1. Definitions. 9 | 10 | "License" shall mean the terms and conditions for use, reproduction, 11 | and distribution as defined by Sections 1 through 9 of this document. 12 | 13 | "Licensor" shall mean the copyright owner or entity authorized by 14 | the copyright owner that is granting the License. 15 | 16 | "Legal Entity" shall mean the union of the acting entity and all 17 | other entities that control, are controlled by, or are under common 18 | control with that entity. For the purposes of this definition, 19 | "control" means (i) the power, direct or indirect, to cause the 20 | direction or management of such entity, whether by contract or 21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 22 | outstanding shares, or (iii) beneficial ownership of such entity. 23 | 24 | "You" (or "Your") shall mean an individual or Legal Entity 25 | exercising permissions granted by this License. 26 | 27 | "Source" form shall mean the preferred form for making modifications, 28 | including but not limited to software source code, documentation 29 | source, and configuration files. 30 | 31 | "Object" form shall mean any form resulting from mechanical 32 | transformation or translation of a Source form, including but 33 | not limited to compiled object code, generated documentation, 34 | and conversions to other media types. 35 | 36 | "Work" shall mean the work of authorship, whether in Source or 37 | Object form, made available under the License, as indicated by a 38 | copyright notice that is included in or attached to the work 39 | (an example is provided in the Appendix below). 40 | 41 | "Derivative Works" shall mean any work, whether in Source or Object 42 | form, that is based on (or derived from) the Work and for which the 43 | editorial revisions, annotations, elaborations, or other modifications 44 | represent, as a whole, an original work of authorship. For the purposes 45 | of this License, Derivative Works shall not include works that remain 46 | separable from, or merely link (or bind by name) to the interfaces of, 47 | the Work and Derivative Works thereof. 48 | 49 | "Contribution" shall mean any work of authorship, including 50 | the original version of the Work and any modifications or additions 51 | to that Work or Derivative Works thereof, that is intentionally 52 | submitted to Licensor for inclusion in the Work by the copyright owner 53 | or by an individual or Legal Entity authorized to submit on behalf of 54 | the copyright owner. For the purposes of this definition, "submitted" 55 | means any form of electronic, verbal, or written communication sent 56 | to the Licensor or its representatives, including but not limited to 57 | communication on electronic mailing lists, source code control systems, 58 | and issue tracking systems that are managed by, or on behalf of, the 59 | Licensor for the purpose of discussing and improving the Work, but 60 | excluding communication that is conspicuously marked or otherwise 61 | designated in writing by the copyright owner as "Not a Contribution." 62 | 63 | "Contributor" shall mean Licensor and any individual or Legal Entity 64 | on behalf of whom a Contribution has been received by Licensor and 65 | subsequently incorporated within the Work. 66 | 67 | 2. Grant of Copyright License. Subject to the terms and conditions of 68 | this License, each Contributor hereby grants to You a perpetual, 69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 70 | copyright license to reproduce, prepare Derivative Works of, 71 | publicly display, publicly perform, sublicense, and distribute the 72 | Work and such Derivative Works in Source or Object form. 73 | 74 | 3. Grant of Patent License. Subject to the terms and conditions of 75 | this License, each Contributor hereby grants to You a perpetual, 76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 77 | (except as stated in this section) patent license to make, have made, 78 | use, offer to sell, sell, import, and otherwise transfer the Work, 79 | where such license applies only to those patent claims licensable 80 | by such Contributor that are necessarily infringed by their 81 | Contribution(s) alone or by combination of their Contribution(s) 82 | with the Work to which such Contribution(s) was submitted. If You 83 | institute patent litigation against any entity (including a 84 | cross-claim or counterclaim in a lawsuit) alleging that the Work 85 | or a Contribution incorporated within the Work constitutes direct 86 | or contributory patent infringement, then any patent licenses 87 | granted to You under this License for that Work shall terminate 88 | as of the date such litigation is filed. 89 | 90 | 4. Redistribution. You may reproduce and distribute copies of the 91 | Work or Derivative Works thereof in any medium, with or without 92 | modifications, and in Source or Object form, provided that You 93 | meet the following conditions: 94 | 95 | (a) You must give any other recipients of the Work or 96 | Derivative Works a copy of this License; and 97 | 98 | (b) You must cause any modified files to carry prominent notices 99 | stating that You changed the files; and 100 | 101 | (c) You must retain, in the Source form of any Derivative Works 102 | that You distribute, all copyright, patent, trademark, and 103 | attribution notices from the Source form of the Work, 104 | excluding those notices that do not pertain to any part of 105 | the Derivative Works; and 106 | 107 | (d) If the Work includes a "NOTICE" text file as part of its 108 | distribution, then any Derivative Works that You distribute must 109 | include a readable copy of the attribution notices contained 110 | within such NOTICE file, excluding those notices that do not 111 | pertain to any part of the Derivative Works, in at least one 112 | of the following places: within a NOTICE text file distributed 113 | as part of the Derivative Works; within the Source form or 114 | documentation, if provided along with the Derivative Works; or, 115 | within a display generated by the Derivative Works, if and 116 | wherever such third-party notices normally appear. The contents 117 | of the NOTICE file are for informational purposes only and 118 | do not modify the License. You may add Your own attribution 119 | notices within Derivative Works that You distribute, alongside 120 | or as an addendum to the NOTICE text from the Work, provided 121 | that such additional attribution notices cannot be construed 122 | as modifying the License. 123 | 124 | You may add Your own copyright statement to Your modifications and 125 | may provide additional or different license terms and conditions 126 | for use, reproduction, or distribution of Your modifications, or 127 | for any such Derivative Works as a whole, provided Your use, 128 | reproduction, and distribution of the Work otherwise complies with 129 | the conditions stated in this License. 130 | 131 | 5. Submission of Contributions. Unless You explicitly state otherwise, 132 | any Contribution intentionally submitted for inclusion in the Work 133 | by You to the Licensor shall be under the terms and conditions of 134 | this License, without any additional terms or conditions. 135 | Notwithstanding the above, nothing herein shall supersede or modify 136 | the terms of any separate license agreement you may have executed 137 | with Licensor regarding such Contributions. 138 | 139 | 6. Trademarks. This License does not grant permission to use the trade 140 | names, trademarks, service marks, or product names of the Licensor, 141 | except as required for reasonable and customary use in describing the 142 | origin of the Work and reproducing the content of the NOTICE file. 143 | 144 | 7. Disclaimer of Warranty. Unless required by applicable law or 145 | agreed to in writing, Licensor provides the Work (and each 146 | Contributor provides its Contributions) on an "AS IS" BASIS, 147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 148 | implied, including, without limitation, any warranties or conditions 149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 150 | PARTICULAR PURPOSE. You are solely responsible for determining the 151 | appropriateness of using or redistributing the Work and assume any 152 | risks associated with Your exercise of permissions under this License. 153 | 154 | 8. Limitation of Liability. In no event and under no legal theory, 155 | whether in tort (including negligence), contract, or otherwise, 156 | unless required by applicable law (such as deliberate and grossly 157 | negligent acts) or agreed to in writing, shall any Contributor be 158 | liable to You for damages, including any direct, indirect, special, 159 | incidental, or consequential damages of any character arising as a 160 | result of this License or out of the use or inability to use the 161 | Work (including but not limited to damages for loss of goodwill, 162 | work stoppage, computer failure or malfunction, or any and all 163 | other commercial damages or losses), even if such Contributor 164 | has been advised of the possibility of such damages. 165 | 166 | 9. Accepting Warranty or Additional Liability. While redistributing 167 | the Work or Derivative Works thereof, You may choose to offer, 168 | and charge a fee for, acceptance of support, warranty, indemnity, 169 | or other liability obligations and/or rights consistent with this 170 | License. However, in accepting such obligations, You may act only 171 | on Your own behalf and on Your sole responsibility, not on behalf 172 | of any other Contributor, and only if You agree to indemnify, 173 | defend, and hold each Contributor harmless for any liability 174 | incurred by, or claims asserted against, such Contributor by reason 175 | of your accepting any such warranty or additional liability. 176 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Packer Image Builder for RHEL Family (RedHat, CentOS, Oracle Linux) 2 | 3 | ## Introduction 4 | 5 | This packer templates create vagrant, vmware and kvm images of RedHat 6, CentOS 6 and Oracle Linux 6. The templates support VirtualBox, VmWare and KVM. The kvm images, also run in OpenStack. 6 | 7 | The OS versions are: 8 | 9 | - RedHat 6.6 10 | - Centos 6.6 11 | - Oracle Linux 6.6 12 | 13 | For all operating systems we generate images for 14 | 15 | - Virtual Box (user: packer/packer) 16 | - VmWare (user: packer/packer) 17 | - OpenStack 18 | 19 | This template only is tested against 64 bit systems. 20 | 21 | ## Requirements 22 | 23 | The templates are only tested with [packer](http://www.packer.io/downloads.html) 0.5.2 and later. 24 | 25 | ## Run conversion process 26 | 27 | # Build CentOS virtualbox image 28 | PACKER_LOG=1 packer build -only="centos-6-vbox" packer-centos-6.json 29 | 30 | # Build Oracle Linux virtualbox image 31 | PACKER_LOG=1 packer build -only="oel-6-vbox" packer-oel-6.json 32 | 33 | ## Build cloud images for openstack 34 | 35 | ### CentOS 36 | 37 | # Build CentOS openstack image and compress qcow2 image before 38 | # upload (normally from 4.5 GB to less than 500 MB) 39 | packer build -only="centos-6-cloud-kvm" packer-centos-6.json 40 | 41 | # Reduce the file size 42 | qemu-img convert -c -f qcow2 -O qcow2 -o cluster_size=2M img_centos_6_openstack/centos6_openstack.qcow2 img_centos_6_openstack/centos6_openstack_compressed.qcow2 43 | 44 | # Upload the file to open stack 45 | glance image-create --name "CentOS 6.5" --container-format ovf --disk-format qcow2 --file img_centos_6_openstack/centos6_openstack_compressed.qcow2 --is-public True --progress 46 | 47 | ### Oracle Linux 48 | 49 | # Build Oracle Linux openstack image and compress qcow2 image before 50 | packer build -only="oel-6-cloud-kvm" packer-oel-6.json 51 | 52 | # Reduce the file size 53 | qemu-img convert -c -f qcow2 -O qcow2 -o cluster_size=2M img_oel_6_openstack/oel6_openstack.qcow2 img_oel_6_openstack/oel6_openstack_compressed.qcow2 54 | 55 | # Upload the file to open stack 56 | glance image-create --name "OEL 6.5" --container-format ovf --disk-format qcow2 --file img_oel_6_openstack/centos6_openstack_compressed.qcow2 --is-public True --progress 57 | 58 | ### RedHat 59 | 60 | Before you start with RedHat you need a valid subscription to download the latest iso image. Update the `iso_url` parameter in rhel6.json accordingly. Additionally you need to modify the file `scripts/rhn_reg` with your user credentials to recieve yum updates during the packer run. 61 | 62 | # Build RedHat openstack image 63 | packer build -only="rhel-6-cloud-kvm" packer-rhel-6.json 64 | 65 | # Reduce the file size 66 | qemu-img convert -c -f qcow2 -O qcow2 -o cluster_size=2M rhel6_openstack.qcow2 rhel6_openstack_compressed.qcow2 67 | 68 | # Upload the file to open stack 69 | glance image-create --name "RedHat 6.5" --container-format ovf --disk-format qcow2 --file rhel6_openstack_compressed.qcow2 --is-public True --progress 70 | 71 | 72 | ## Issues during build time 73 | 74 | If you experience issues with packer, please use `PACKER_LOG=1 packer ... ` to find the errors. 75 | 76 | ## Author 77 | 78 | - Author:: Christoph Hartmann () 79 | 80 | # License 81 | 82 | Company: Deutsche Telekom AG 83 | 84 | Licensed under the Apache License, Version 2.0 (the "License"); 85 | you may not use this file except in compliance with the License. 86 | You may obtain a copy of the License at 87 | 88 | http://www.apache.org/licenses/LICENSE-2.0 89 | 90 | Unless required by applicable law or agreed to in writing, software 91 | distributed under the License is distributed on an "AS IS" BASIS, 92 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 93 | See the License for the specific language governing permissions and 94 | limitations under the License. 95 | -------------------------------------------------------------------------------- /http/ks.cfg: -------------------------------------------------------------------------------- 1 | 2 | # We want to "install" 3 | install 4 | 5 | cdrom 6 | 7 | # Set the language 8 | lang en_US.UTF-8 9 | 10 | keyboard us 11 | network --bootproto=dhcp 12 | 13 | # Sets the root password because we do not want any prompt during installation (password) 14 | rootpw changeme 15 | 16 | firewall --enabled --service=ssh 17 | authconfig --enableshadow --passalgo=sha512 18 | selinux --disabled 19 | timezone UTC 20 | bootloader --location=mbr 21 | 22 | text 23 | skipx 24 | zerombr 25 | 26 | clearpart --all --initlabel 27 | autopart 28 | 29 | auth --useshadow --enablemd5 30 | firstboot --disabled 31 | reboot 32 | 33 | # install only base packages and openssh 34 | %packages --nobase 35 | @core 36 | openssh-clients 37 | %end 38 | 39 | %post 40 | /usr/bin/yum -y install sudo 41 | /usr/sbin/groupadd packer 42 | /usr/sbin/useradd packer -g packer -G wheel 43 | echo "packer"|passwd --stdin packer 44 | echo "packer ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers.d/packer 45 | chmod 0440 /etc/sudoers.d/packer 46 | %end 47 | 48 | -------------------------------------------------------------------------------- /http/ks_cloud_centos.cfg: -------------------------------------------------------------------------------- 1 | # See documentation: 2 | # https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Installation_Guide/s1-kickstart2-options.html 3 | # We want to "install" 4 | install 5 | 6 | cdrom 7 | 8 | # Set the language 9 | lang en_US.UTF-8 10 | 11 | keyboard us 12 | network --bootproto=dhcp 13 | 14 | # Sets the root password because we do not want any prompt during installation (password) 15 | rootpw changeme 16 | 17 | firewall --enabled --service=ssh 18 | authconfig --enableshadow --passalgo=sha512 --enablefingerprint 19 | selinux --disabled 20 | timezone UTC 21 | bootloader --location=mbr 22 | 23 | # repo to install the OS 24 | url --url=http://mirror.centos.org/centos/6/os/x86_64/ 25 | repo --name=updates --baseurl=http://mirror.centos.org/centos/6/updates/x86_64/ 26 | # repos to install packages in %packages section 27 | repo --name=extras --baseurl=http://mirror.centos.org/centos/6/extras/x86_64/ 28 | repo --name=epel --baseurl=http://dl.fedoraproject.org/pub/epel/6Server/x86_64/ 29 | 30 | skipx 31 | zerombr yes 32 | 33 | clearpart --all --initlabel 34 | part / --fstype ext4 --size=1100 --grow --asprimary 35 | 36 | reboot 37 | 38 | # install only base packages and openssh 39 | %packages --nobase --excludedocs --instLangs=en 40 | @Core 41 | -bfa-firmware-3.0.3.1-1.el6.noarch 42 | -iwl1000-firmware-39.31.5.1-1.el6.noarch 43 | -ql2400-firmware-5.08.00-1.el6.noarch 44 | -libertas-usb8388-firmware-5.110.22.p23-3.1.el6.noarch 45 | -zd1211-firmware-1.4-4.el6.noarch 46 | -ql2200-firmware-2.02.08-3.1.el6.noarch 47 | -ipw2200-firmware-3.1-4.el6.noarch 48 | -iwl5150-firmware-8.24.2.2-1.el6.noarch 49 | -iwl6050-firmware-41.28.5.1-2.el6.noarch 50 | -iwl6000g2a-firmware-17.168.5.3-1.el6.noarch 51 | -iwl6000-firmware-9.221.4.1-1.el6.noarch 52 | -iwl5000-firmware-8.83.5.1_1-1.el6_1.1.noarch 53 | -ivtv-firmware-20080701-20.2.noarch 54 | -xorg-x11-drv-ati-firmware-6.99.99-1.el6.noarch 55 | -atmel-firmware-1.3-7.el6.noarch 56 | -iwl4965-firmware-228.61.2.24-2.1.el6.noarch 57 | -iwl3945-firmware-15.32.2.9-4.el6.noarch 58 | -rt73usb-firmware-1.8-7.el6.noarch 59 | -ql23xx-firmware-3.03.27-3.1.el6.noarch 60 | -iwl100-firmware-39.31.5.1-1.el6.noarch 61 | -aic94xx-firmware-30-2.el6.noarch 62 | -ql2100-firmware-1.19.38-3.1.el6.noarch 63 | -ql2500-firmware-5.08.00-1.el6.noarch 64 | -rt61pci-firmware-1.2-7.el6.noarch 65 | -ipw2100-firmware-1.3-11.el6.noarch 66 | -b43-fwcutter 67 | -b43-openfwwf 68 | -perl 69 | -perl-Module-Pluggable 70 | -perl-Pod-Escapes 71 | -perl-Pod-Simple 72 | -perl-libs 73 | -perl-version 74 | -vim-enhanced 75 | -abrt 76 | -abrt-addon-ccpp 77 | -abrt-addon-kerneloops 78 | -abrt-addon-python 79 | -abrt-cli 80 | -abrt-libs 81 | -abrt-tui 82 | -libreport 83 | -libreport-cli 84 | -libreport-compat 85 | -libreport-plugin-kerneloops 86 | -libreport-plugin-logger 87 | -libreport-plugin-mailx 88 | -libreport-plugin-reportuploader 89 | -libreport-plugin-rhtsupport 90 | -libreport-python 91 | -cups-libs 92 | -fprintd 93 | -fprintd-pam 94 | -gtk2 95 | -libfprint 96 | -mysql-libs 97 | -cronie 98 | -cronie-anacron 99 | -crontabs 100 | -postfix 101 | -sysstat 102 | -alsa-lib 103 | -alsa-utils 104 | -man 105 | -man-pages 106 | -man-pages-overrides 107 | -yum-utils 108 | -system-config-firewall-base 109 | -system-config-firewall-tui 110 | -system-config-network-tui 111 | -systemtap-runtime 112 | -at 113 | -atk 114 | -avahi-libs 115 | -bc 116 | -bind-libs 117 | -bind-utils 118 | -biosdevname 119 | -blktrace 120 | -busybox 121 | -cairo 122 | -centos-indexhtml 123 | -ConsoleKit 124 | -ConsoleKit-libs 125 | -cpuspeed 126 | -crda 127 | -cyrus-sasl-plain 128 | -dbus 129 | -dbus-python 130 | -desktop-file-utils 131 | -dmidecode 132 | -dmraid 133 | -dmraid-events 134 | -dosfstools 135 | -ed 136 | -eggdbus 137 | -eject 138 | -elfutils-libs 139 | -fontconfig 140 | -freetype 141 | -gnutls 142 | -hal 143 | -hal-info 144 | -hal-libs 145 | -hdparm 146 | -hicolor-icon-theme 147 | -hunspell 148 | -hunspell-en 149 | -irqbalance 150 | -iw 151 | -jasper-libs 152 | -kexec-tools 153 | -ledmon 154 | -libjpeg-turbo 155 | -libnl 156 | -libpcap 157 | -libpng 158 | -libtasn1 159 | -libthai 160 | -libtiff 161 | -libusb1 162 | -libX11 163 | -libX11-common 164 | -libXau 165 | -libxcb 166 | -libXcomposite 167 | -libXcursor 168 | -libXdamage 169 | -libXext 170 | -libXfixes 171 | -libXft 172 | -libXi 173 | -libXinerama 174 | -libxml2-python 175 | -libXrandr 176 | -libXrender 177 | -lsof 178 | -mailx 179 | -microcode_ctl 180 | -mlocate 181 | -mtr 182 | -nano 183 | -ntp 184 | -ntpdate 185 | -ntsysv 186 | -numactl 187 | -pam_passwdqc 188 | -pango 189 | -parted 190 | -pciutils 191 | -pcmciautils 192 | -pinfo 193 | -pixman 194 | -pkgconfig 195 | -pm-utils 196 | -polkit 197 | -prelink 198 | -psacct 199 | -python-ethtool 200 | -python-iwlib 201 | -quota 202 | -rdate 203 | -readahead 204 | -rfkill 205 | -rng-tools 206 | -rsync 207 | -scl-utils 208 | -setserial 209 | -setuptool 210 | -sg3_utils-libs 211 | -sgpio 212 | -smartmontools 213 | -sos 214 | -strace 215 | -tcpdump 216 | -tcp_wrappers 217 | -tcsh 218 | -time 219 | -tmpwatch 220 | -traceroute 221 | -unzip 222 | -usbutils 223 | -usermode 224 | -vconfig 225 | -wget 226 | -wireless-tools 227 | -words 228 | -xdg-utils 229 | -xz 230 | -xz-lzma-compat 231 | -yum-plugin-security 232 | -yum-utils 233 | -zip 234 | 235 | openssh-clients 236 | 237 | # cloud-init 238 | dracut-modules-growroot 239 | 240 | %end 241 | 242 | %post --log=/root/post.log --nochroot 243 | 244 | # rebuild the initramfs 245 | # http://lists.openstack.org/pipermail/openstack/2015-January/011245.html 246 | # http://lists.openstack.org/pipermail/openstack/2014-August/008802.html 247 | dracut --force 248 | 249 | %end -------------------------------------------------------------------------------- /http/ks_cloud_oel.cfg: -------------------------------------------------------------------------------- 1 | # See documentation: 2 | # https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Installation_Guide/s1-kickstart2-options.html 3 | # We want to "install" 4 | install 5 | 6 | cdrom 7 | 8 | # Set the language 9 | lang en_US.UTF-8 10 | 11 | keyboard us 12 | network --bootproto=dhcp 13 | 14 | # Sets the root password because we do not want any prompt during installation (password) 15 | rootpw changeme 16 | 17 | firewall --enabled --service=ssh 18 | authconfig --enableshadow --passalgo=sha512 --enablefingerprint 19 | selinux --disabled 20 | timezone UTC 21 | bootloader --location=mbr 22 | 23 | skipx 24 | zerombr yes 25 | 26 | clearpart --all --initlabel 27 | part / --fstype ext4 --size=2400 --grow --asprimary 28 | 29 | reboot 30 | 31 | # install only base packages and openssh 32 | %packages --nobase --excludedocs --instLangs=en 33 | @Core 34 | -bfa-firmware-3.0.3.1-1.el6.noarch 35 | -iwl1000-firmware-39.31.5.1-1.el6.noarch 36 | -ql2400-firmware-5.08.00-1.el6.noarch 37 | -libertas-usb8388-firmware-5.110.22.p23-3.1.el6.noarch 38 | -zd1211-firmware-1.4-4.el6.noarch 39 | -ql2200-firmware-2.02.08-3.1.el6.noarch 40 | -ipw2200-firmware-3.1-4.el6.noarch 41 | -iwl5150-firmware-8.24.2.2-1.el6.noarch 42 | -iwl6050-firmware-41.28.5.1-2.el6.noarch 43 | -iwl6000g2a-firmware-17.168.5.3-1.el6.noarch 44 | -iwl6000-firmware-9.221.4.1-1.el6.noarch 45 | -iwl5000-firmware-8.83.5.1_1-1.el6_1.1.noarch 46 | -ivtv-firmware-20080701-20.2.noarch 47 | -xorg-x11-drv-ati-firmware-6.99.99-1.el6.noarch 48 | -atmel-firmware-1.3-7.el6.noarch 49 | -iwl4965-firmware-228.61.2.24-2.1.el6.noarch 50 | -iwl3945-firmware-15.32.2.9-4.el6.noarch 51 | -rt73usb-firmware-1.8-7.el6.noarch 52 | -ql23xx-firmware-3.03.27-3.1.el6.noarch 53 | -iwl100-firmware-39.31.5.1-1.el6.noarch 54 | -aic94xx-firmware-30-2.el6.noarch 55 | -ql2100-firmware-1.19.38-3.1.el6.noarch 56 | -ql2500-firmware-5.08.00-1.el6.noarch 57 | -rt61pci-firmware-1.2-7.el6.noarch 58 | -ipw2100-firmware-1.3-11.el6.noarch 59 | -b43-fwcutter 60 | -b43-openfwwf 61 | -perl 62 | -perl-Module-Pluggable 63 | -perl-Pod-Escapes 64 | -perl-Pod-Simple 65 | -perl-libs 66 | -perl-version 67 | -vim-enhanced 68 | -abrt 69 | -abrt-addon-ccpp 70 | -abrt-addon-kerneloops 71 | -abrt-addon-python 72 | -abrt-cli 73 | -abrt-libs 74 | -abrt-tui 75 | -libreport 76 | -libreport-cli 77 | -libreport-compat 78 | -libreport-plugin-kerneloops 79 | -libreport-plugin-logger 80 | -libreport-plugin-mailx 81 | -libreport-plugin-reportuploader 82 | -libreport-plugin-rhtsupport 83 | -libreport-python 84 | -cups-libs 85 | -fprintd 86 | -fprintd-pam 87 | -gtk2 88 | -libfprint 89 | -mysql-libs 90 | -cronie 91 | -cronie-anacron 92 | -crontabs 93 | -postfix 94 | -sysstat 95 | -alsa-lib 96 | -alsa-utils 97 | -man 98 | -man-pages 99 | -man-pages-overrides 100 | -yum-utils 101 | -system-config-firewall-base 102 | -system-config-firewall-tui 103 | -system-config-network-tui 104 | -systemtap-runtime 105 | -at 106 | -atk 107 | -avahi-libs 108 | -bc 109 | -bind-libs 110 | -bind-utils 111 | -biosdevname 112 | -blktrace 113 | -busybox 114 | -cairo 115 | -centos-indexhtml 116 | -ConsoleKit 117 | -ConsoleKit-libs 118 | -cpuspeed 119 | -crda 120 | -cyrus-sasl-plain 121 | -dbus 122 | -dbus-python 123 | -desktop-file-utils 124 | -dmidecode 125 | -dmraid 126 | -dmraid-events 127 | -dosfstools 128 | -ed 129 | -eggdbus 130 | -eject 131 | -elfutils-libs 132 | -fontconfig 133 | -freetype 134 | -gnutls 135 | -hal 136 | -hal-info 137 | -hal-libs 138 | -hdparm 139 | -hicolor-icon-theme 140 | -hunspell 141 | -hunspell-en 142 | -irqbalance 143 | -iw 144 | -jasper-libs 145 | -kexec-tools 146 | -ledmon 147 | -libjpeg-turbo 148 | -libnl 149 | -libpcap 150 | -libpng 151 | -libtasn1 152 | -libthai 153 | -libtiff 154 | -libusb1 155 | -libX11 156 | -libX11-common 157 | -libXau 158 | -libxcb 159 | -libXcomposite 160 | -libXcursor 161 | -libXdamage 162 | -libXext 163 | -libXfixes 164 | -libXft 165 | -libXi 166 | -libXinerama 167 | -libxml2-python 168 | -libXrandr 169 | -libXrender 170 | -lsof 171 | -mailx 172 | -microcode_ctl 173 | -mlocate 174 | -mtr 175 | -nano 176 | -ntp 177 | -ntpdate 178 | -ntsysv 179 | -numactl 180 | -pam_passwdqc 181 | -pango 182 | -parted 183 | -pciutils 184 | -pcmciautils 185 | -pinfo 186 | -pixman 187 | -pkgconfig 188 | -pm-utils 189 | -polkit 190 | -prelink 191 | -psacct 192 | -python-ethtool 193 | -python-iwlib 194 | -quota 195 | -rdate 196 | -readahead 197 | -rfkill 198 | -rng-tools 199 | -rsync 200 | -scl-utils 201 | -setserial 202 | -setuptool 203 | -sg3_utils-libs 204 | -sgpio 205 | -smartmontools 206 | -sos 207 | -strace 208 | -tcpdump 209 | -tcp_wrappers 210 | -tcsh 211 | -time 212 | -tmpwatch 213 | -traceroute 214 | -unzip 215 | -usbutils 216 | -usermode 217 | -vconfig 218 | -wget 219 | -wireless-tools 220 | -words 221 | -xdg-utils 222 | -xz 223 | -xz-lzma-compat 224 | -yum-plugin-security 225 | -yum-utils 226 | -zip 227 | 228 | openssh-clients 229 | 230 | %end 231 | -------------------------------------------------------------------------------- /packer-centos-6.json: -------------------------------------------------------------------------------- 1 | { 2 | "provisioners": [{ 3 | "type": "shell", 4 | "scripts": [ 5 | "scripts/base.sh", 6 | "scripts/epel.sh", 7 | "scripts/development.sh", 8 | "scripts/chef.sh", 9 | "scripts/puppet.sh", 10 | "scripts/vagrant.sh", 11 | "scripts/virtualbox.sh", 12 | "scripts/cleanup.sh", 13 | "scripts/zerodisk.sh" 14 | ], 15 | "override": { 16 | "centos-6-vbox": { 17 | "execute_command": "echo 'packer'|sudo -S sh '{{.Path}}'" 18 | }, 19 | "centos-6-vmware": { 20 | "execute_command": "echo 'packer'|sudo -S sh '{{.Path}}'" 21 | } 22 | }, 23 | "only": ["centos-6-vbox", "centos-6-vmware"] 24 | }, { 25 | "type": "shell", 26 | "scripts": [ 27 | "scripts/base.sh", 28 | "scripts/epel.sh", 29 | "scripts/cloud.sh", 30 | "scripts/cleanup.sh", 31 | "scripts/zerodisk.sh" 32 | ], 33 | "override": { 34 | "centos-6-cloud-kvm": { 35 | "execute_command": "sh '{{.Path}}'" 36 | }, 37 | "centos-6-cloud-vbox": { 38 | "execute_command": "sh '{{.Path}}'" 39 | } 40 | }, 41 | "only": ["centos-6-cloud-kvm", "centos-6-cloud-vbox"] 42 | }], 43 | "builders": [{ 44 | "name": "centos-6-vbox", 45 | "type": "virtualbox-iso", 46 | "boot_command": [ 47 | " text ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/ks.cfg" 48 | ], 49 | "boot_wait": "10s", 50 | "disk_size": 10140, 51 | "guest_os_type": "RedHat_64", 52 | "http_directory": "http", 53 | "iso_checksum": "5458f357e8a55e3a866dd856896c7e0ac88e7f9220a3dd74c58a3b0acede8e4d", 54 | "iso_checksum_type": "sha256", 55 | "iso_url": "http://ftp.tu-chemnitz.de/pub/linux/centos/6.6/isos/x86_64/CentOS-6.6-x86_64-minimal.iso", 56 | "output_directory": "img_centos_6_virtualbox", 57 | "ssh_username": "packer", 58 | "ssh_password": "packer", 59 | "ssh_port": 22, 60 | "ssh_wait_timeout": "10000s", 61 | "shutdown_command": "echo '/sbin/halt -h -p' > shutdown.sh; echo 'packer'|sudo -S sh 'shutdown.sh'", 62 | "guest_additions_path": "VBoxGuestAdditions_{{.Version}}.iso", 63 | "virtualbox_version_file": ".vbox_version", 64 | "vboxmanage": [ 65 | [ 66 | "modifyvm", 67 | "{{.Name}}", 68 | "--memory", 69 | "480" 70 | ], 71 | [ 72 | "modifyvm", 73 | "{{.Name}}", 74 | "--cpus", 75 | "1" 76 | ] 77 | ] 78 | }, { 79 | "name": "centos-6-vmware", 80 | "type": "vmware-iso", 81 | "boot_command": [ 82 | " text ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/ks.cfg" 83 | ], 84 | "boot_wait": "10s", 85 | "disk_size": 10140, 86 | "guest_os_type": "RedHat_64", 87 | "http_directory": "http", 88 | "iso_checksum": "5458f357e8a55e3a866dd856896c7e0ac88e7f9220a3dd74c58a3b0acede8e4d", 89 | "iso_checksum_type": "sha256", 90 | "iso_url": "http://ftp.tu-chemnitz.de/pub/linux/centos/6.6/isos/x86_64/CentOS-6.6-x86_64-minimal.iso", 91 | "output_directory": "img_centos_6_vmware", 92 | "ssh_username": "packer", 93 | "ssh_password": "packer", 94 | "ssh_port": 22, 95 | "ssh_wait_timeout": "10000s", 96 | "shutdown_command": "echo '/sbin/halt -h -p' > shutdown.sh; echo 'packer'|sudo -S sh 'shutdown.sh'", 97 | "vmx_data": { 98 | "memsize": "480", 99 | "numvcpus": "1", 100 | "cpuid.coresPerSocket": "1" 101 | } 102 | }, { 103 | "name": "centos-6-cloud-kvm", 104 | "type": "qemu", 105 | "iso_checksum": "5458f357e8a55e3a866dd856896c7e0ac88e7f9220a3dd74c58a3b0acede8e4d", 106 | "iso_checksum_type": "sha256", 107 | "iso_url": "http://ftp.tu-chemnitz.de/pub/linux/centos/6.6/isos/x86_64/CentOS-6.6-x86_64-minimal.iso", 108 | "output_directory": "img_centos_6_openstack", 109 | "ssh_wait_timeout": "30s", 110 | "shutdown_command": "shutdown -P now", 111 | "disk_size": 1200, 112 | "format": "raw", 113 | "qemuargs": [ 114 | [ "-m", "1024m" ], 115 | ["-machine", "type=pc,accel=kvm"], 116 | ["-device", "virtio-net-pci,netdev=user.0"] 117 | ], 118 | "headless": true, 119 | "accelerator": "kvm", 120 | "http_directory": "http", 121 | "http_port_min": 10082, 122 | "http_port_max": 10089, 123 | "ssh_host_port_min": 2222, 124 | "ssh_host_port_max": 2229, 125 | "ssh_username": "root", 126 | "ssh_password": "changeme", 127 | "ssh_port": 22, 128 | "ssh_wait_timeout": "90m", 129 | "vm_name": "centos6_openstack", 130 | "net_device": "virtio-net", 131 | "disk_interface": "virtio", 132 | "boot_command": [ 133 | " text ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/ks_cloud_centos.cfg" 134 | ] 135 | }, { 136 | "name": "centos-6-cloud-vbox", 137 | "type": "virtualbox-iso", 138 | "boot_command": [ 139 | " text ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/ks_cloud_centos.cfg" 140 | ], 141 | "boot_wait": "10s", 142 | "disk_size": 6000, 143 | "guest_os_type": "RedHat_64", 144 | "http_directory": "http", 145 | "iso_checksum": "5458f357e8a55e3a866dd856896c7e0ac88e7f9220a3dd74c58a3b0acede8e4d", 146 | "iso_checksum_type": "sha256", 147 | "iso_url": "http://ftp.tu-chemnitz.de/pub/linux/centos/6.6/isos/x86_64/CentOS-6.6-x86_64-minimal.iso", 148 | "output_directory": "img_centos_6_virtualbox", 149 | "headless": true, 150 | "ssh_username": "root", 151 | "ssh_password": "changeme", 152 | "ssh_port": 22, 153 | "ssh_wait_timeout": "10000s", 154 | "shutdown_command": "echo '/sbin/halt -h -p' > shutdown.sh; echo 'packer'|sudo -S sh 'shutdown.sh'", 155 | "vboxmanage": [ 156 | [ 157 | "modifyvm", 158 | "{{.Name}}", 159 | "--memory", 160 | "480" 161 | ], 162 | [ 163 | "modifyvm", 164 | "{{.Name}}", 165 | "--cpus", 166 | "1" 167 | ] 168 | ] 169 | }], 170 | "post-processors": [{ 171 | "type": "vagrant", 172 | "compression_level": 1, 173 | "keep_input_artifact": true, 174 | "only": ["centos-6-vbox", "centos-6-vmware"] 175 | }] 176 | } 177 | -------------------------------------------------------------------------------- /packer-oel-6.json: -------------------------------------------------------------------------------- 1 | { 2 | "provisioners": [{ 3 | "type": "shell", 4 | "scripts": [ 5 | "scripts/base.sh", 6 | "scripts/epel.sh", 7 | "scripts/development.sh", 8 | "scripts/chef.sh", 9 | "scripts/puppet.sh", 10 | "scripts/vagrant.sh", 11 | "scripts/virtualbox.sh", 12 | "scripts/cleanup.sh", 13 | "scripts/zerodisk.sh" 14 | ], 15 | "override": { 16 | "oel-6-vbox": { 17 | "execute_command": "echo 'packer'|sudo -S sh '{{.Path}}'" 18 | }, 19 | "oel-6-vmware": { 20 | "execute_command": "echo 'packer'|sudo -S sh '{{.Path}}'" 21 | } 22 | }, 23 | "only": ["oel-6-vbox", "oel-6-vmware"] 24 | }, { 25 | "type": "shell", 26 | "scripts": [ 27 | "scripts/base.sh", 28 | "scripts/epel.sh", 29 | "scripts/cloud.sh", 30 | "scripts/cloud_oel.sh", 31 | "scripts/cleanup.sh", 32 | "scripts/zerodisk.sh" 33 | ], 34 | "override": { 35 | "oel-6-cloud-kvm": { 36 | "execute_command": "sh '{{.Path}}'" 37 | }, 38 | "oel-6-cloud-vbox": { 39 | "execute_command": "sh '{{.Path}}'" 40 | } 41 | }, 42 | "only": ["oel-6-cloud-kvm", "oel-6-cloud-vbox"] 43 | }], 44 | "builders": [ 45 | { 46 | "name": "oel-6-vbox", 47 | "type": "virtualbox-iso", 48 | "boot_command": [ 49 | " text ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/ks.cfg" 50 | ], 51 | "boot_wait": "10s", 52 | "disk_size": 10140, 53 | "guest_os_type": "RedHat_64", 54 | "http_directory": "http", 55 | "iso_checksum": "5738f10a506d3630edfd297ef179b553091c6a48", 56 | "iso_checksum_type": "sha1", 57 | "iso_url": "http://mirror.netcologne.de/oracle-linux/OL6/U6/x86_64/OracleLinux-R6-U6-Server-x86_64-dvd.iso", 58 | "output_directory": "img_oel_6_virtualbox", 59 | "ssh_username": "packer", 60 | "ssh_password": "packer", 61 | "ssh_port": 22, 62 | "ssh_wait_timeout": "10000s", 63 | "shutdown_command": "echo '/sbin/halt -h -p' > shutdown.sh; echo 'packer'|sudo -S sh 'shutdown.sh'", 64 | "guest_additions_path": "VBoxGuestAdditions_{{.Version}}.iso", 65 | "virtualbox_version_file": ".vbox_version", 66 | "vboxmanage": [ 67 | [ 68 | "modifyvm", 69 | "{{.Name}}", 70 | "--memory", 71 | "480" 72 | ], 73 | [ 74 | "modifyvm", 75 | "{{.Name}}", 76 | "--cpus", 77 | "1" 78 | ] 79 | ] 80 | }, 81 | { 82 | "name": "oel-6-vmware", 83 | "type": "vmware-iso", 84 | "boot_command": [ 85 | " text ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/ks.cfg" 86 | ], 87 | "boot_wait": "10s", 88 | "disk_size": 10140, 89 | "guest_os_type": "rhel6-64", 90 | "http_directory": "http", 91 | "iso_checksum": "5738f10a506d3630edfd297ef179b553091c6a48", 92 | "iso_checksum_type": "sha1", 93 | "iso_url": "http://mirror.netcologne.de/oracle-linux/OL6/U6/x86_64/OracleLinux-R6-U6-Server-x86_64-dvd.iso", 94 | "output_directory": "img_oel_6_vmware", 95 | "ssh_username": "packer", 96 | "ssh_password": "packer", 97 | "ssh_port": 22, 98 | "ssh_wait_timeout": "10000s", 99 | "shutdown_command": "echo '/sbin/halt -h -p' > shutdown.sh; echo 'packer'|sudo -S sh 'shutdown.sh'", 100 | "vmx_data": { 101 | "memsize": "480", 102 | "numvcpus": "1", 103 | "cpuid.coresPerSocket": "1" 104 | } 105 | }, 106 | { 107 | "name": "oel-6-cloud-vbox", 108 | "type": "virtualbox-iso", 109 | "boot_command": [ 110 | " text ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/ks_cloud_oel.cfg" 111 | ], 112 | "boot_wait": "10s", 113 | "disk_size": 10140, 114 | "guest_os_type": "RedHat_64", 115 | "http_directory": "http", 116 | "iso_checksum": "5738f10a506d3630edfd297ef179b553091c6a48", 117 | "iso_checksum_type": "sha1", 118 | "iso_url": "http://mirror.netcologne.de/oracle-linux/OL6/U6/x86_64/OracleLinux-R6-U6-Server-x86_64-dvd.iso", 119 | "output_directory": "img_oel_6_openstack", 120 | "headless": true, 121 | "ssh_username": "root", 122 | "ssh_password": "changeme", 123 | "ssh_port": 22, 124 | "ssh_wait_timeout": "10000s", 125 | "shutdown_command": "echo '/sbin/halt -h -p' > shutdown.sh; echo 'packer'|sudo -S sh 'shutdown.sh'", 126 | "vboxmanage": [ 127 | [ 128 | "modifyvm", 129 | "{{.Name}}", 130 | "--memory", 131 | "480" 132 | ], 133 | [ 134 | "modifyvm", 135 | "{{.Name}}", 136 | "--cpus", 137 | "1" 138 | ] 139 | ] 140 | }, { 141 | "name": "oel-6-cloud-kvm", 142 | "type": "qemu", 143 | "iso_checksum": "5738f10a506d3630edfd297ef179b553091c6a48", 144 | "iso_checksum_type": "sha1", 145 | "iso_url": "http://mirror.netcologne.de/oracle-linux/OL6/U6/x86_64/OracleLinux-R6-U6-Server-x86_64-dvd.iso", 146 | "output_directory": "img_oel_6_openstack", 147 | "ssh_wait_timeout": "30s", 148 | "shutdown_command": "shutdown -P now", 149 | "disk_size": 2500, 150 | "format": "raw", 151 | "qemuargs": [ 152 | [ "-m", "1024m" ], 153 | ["-machine", "type=pc,accel=kvm"], 154 | ["-device", "virtio-net-pci,netdev=user.0"] 155 | ], 156 | "headless": true, 157 | "accelerator": "kvm", 158 | "http_directory": "http", 159 | "http_port_min": 10082, 160 | "http_port_max": 10089, 161 | "ssh_host_port_min": 2222, 162 | "ssh_host_port_max": 2229, 163 | "ssh_username": "root", 164 | "ssh_password": "changeme", 165 | "ssh_port": 22, 166 | "ssh_wait_timeout": "90m", 167 | "vm_name": "oel6_openstack", 168 | "net_device": "virtio-net", 169 | "disk_interface": "virtio", 170 | "boot_command": [ 171 | " text ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/ks_cloud_oel.cfg" 172 | ] 173 | }], 174 | "post-processors": [{ 175 | "type": "vagrant", 176 | "compression_level": 1, 177 | "keep_input_artifact": true, 178 | "only": ["oel-6-vbox", "oel-6-vmware"] 179 | }] 180 | } 181 | -------------------------------------------------------------------------------- /packer-rhel-6.json: -------------------------------------------------------------------------------- 1 | { 2 | "provisioners": [{ 3 | "type": "shell", 4 | "scripts": [ 5 | "scripts/rhn_reg.sh", 6 | "scripts/base.sh", 7 | "scripts/epel.sh", 8 | "scripts/cloud.sh", 9 | "scripts/rhn_unreg.sh", 10 | "scripts/cleanup.sh", 11 | "scripts/zerodisk.sh" 12 | ], 13 | "override": { 14 | "rhel-6-cloud-kvm": { 15 | "execute_command": "sh '{{.Path}}'" 16 | } 17 | }, 18 | "only": ["rhel-6-cloud-kvm"] 19 | }], 20 | "builders": [{ 21 | "name": "rhel-6-cloud-kvm", 22 | "type": "qemu", 23 | "iso_checksum": "a51b90f3dd4585781293ea08adde60eeb9cfa94670943bd99e9c07f13a259539", 24 | "iso_checksum_type": "sha256", 25 | "iso_url": "http://yourrheldownloadurl.com/rhel-server-6.5-x86_64-dvd.iso", 26 | "output_directory": "img_rhel_6_openstack", 27 | "ssh_wait_timeout": "30s", 28 | "shutdown_command": "shutdown -P now", 29 | "disk_size": 5000, 30 | "format": "qcow2", 31 | "headless": true, 32 | "accelerator": "kvm", 33 | "http_directory": "http", 34 | "http_port_min": 10082, 35 | "http_port_max": 10089, 36 | "ssh_host_port_min": 2222, 37 | "ssh_host_port_max": 2229, 38 | "ssh_username": "root", 39 | "ssh_password": "changeme", 40 | "ssh_port": 22, 41 | "ssh_wait_timeout": "90m", 42 | "vm_name": "rhel6_openstack", 43 | "net_device": "virtio-net", 44 | "disk_interface": "virtio", 45 | "boot_command": [ 46 | " text ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/ks_cloud.cfg" 47 | ] 48 | }], 49 | "post-processors": [{ 50 | "type": "vagrant", 51 | "compression_level": 1, 52 | "keep_input_artifact": true 53 | }] 54 | } 55 | -------------------------------------------------------------------------------- /scripts/base.sh: -------------------------------------------------------------------------------- 1 | yum -y update 2 | yum -y install wget curl openssh-server 3 | 4 | # Install root certificates 5 | yum -y install ca-certificates 6 | 7 | # Make ssh faster by not waiting on DNS 8 | echo "UseDNS no" >> /etc/ssh/sshd_config 9 | -------------------------------------------------------------------------------- /scripts/chef.sh: -------------------------------------------------------------------------------- 1 | # Install Chef 2 | curl -L https://www.opscode.com/chef/install.sh | bash 3 | -------------------------------------------------------------------------------- /scripts/cleanup.sh: -------------------------------------------------------------------------------- 1 | yum -y erase gtk2 libX11 hicolor-icon-theme avahi freetype bitstream-vera-fonts 2 | yum -y clean all 3 | rm -rf /etc/yum.repos.d/{puppetlabs,epel}.repo 4 | rm -rf VBoxGuestAdditions_*.iso 5 | 6 | # Remove traces of mac address from network configuration 7 | sed -i /HWADDR/d /etc/sysconfig/network-scripts/ifcfg-eth0 8 | rm /etc/udev/rules.d/70-persistent-net.rules 9 | -------------------------------------------------------------------------------- /scripts/cloud.sh: -------------------------------------------------------------------------------- 1 | # to install the following packages, epel is required 2 | yum -y update 3 | 4 | # Installs cloudinit, cloud-utils for disk grow 5 | yum -y install cloud-utils cloud-init parted git 6 | 7 | # configure cloud init 'cloud-user' as sudo 8 | # this is not configured via default cloudinit config 9 | cat > /etc/cloud/cloud.cfg.d/02_user.cfg <> /boot/grub/grub.conf 38 | # echo "terminal --timeout=10 console serial" >> /boot/grub/grub.conf 39 | 40 | # Edit the kernel line to add the console entries 41 | # echo "kernel ... console=tty0 console=ttyS0,115200n8" >> /boot/grub/menu.lst 42 | sed -i '/kernel/s|$| console=tty0 console=ttyS0,115200n8 |' /boot/grub/grub.conf 43 | 44 | # Disable the zeroconf route 45 | echo "NOZEROCONF=yes" >> /etc/sysconfig/network 46 | echo "PERSISTENT_DHCLIENT=yes" >> /etc/sysconfig/network 47 | 48 | # Configure network cards and remove device specific configuration 49 | rm -f /etc/udev/rules.d/70-persistent-net.rules 50 | touch /etc/udev/rules.d/70-persistent-net.rules 51 | 52 | # remove uuid 53 | sed -i '/UUID/d' /etc/sysconfig/network-scripts/ifcfg-eth0 54 | sed -i '/HWADDR/d' /etc/sysconfig/network-scripts/ifcfg-eth0 55 | 56 | # support second network card 57 | cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth1 58 | sed -i 's/eth0/eth1/' /etc/sysconfig/network-scripts/ifcfg-eth1 59 | 60 | # remove password from root 61 | passwd -d root 62 | passwd -l root 63 | 64 | 65 | -------------------------------------------------------------------------------- /scripts/cloud_oel.sh: -------------------------------------------------------------------------------- 1 | # OEL 6.6 uses a 3.8 kernel and does not require a change of the initramfs 2 | # We need to ensure the growpart module is loaded instead before we run resizefs 3 | # Since we use a single root, we need to activate resize_rootfs as well 4 | # 5 | # resize_rootfs: True 6 | # 7 | # cloud_init_modules: 8 | # - growpart 9 | # - resizefs 10 | # 11 | 12 | cat > /etc/cloud/cloud.cfg < /etc/yum.repos.d/puppetlabs.repo << EOM 4 | [puppetlabs-dependencies] 5 | name=puppetlabdsdependencies 6 | baseurl=http://yum.puppetlabs.com/el/6/dependencies/\$basearch 7 | enabled=1 8 | gpgcheck=0 9 | 10 | [puppetlabs] 11 | name=puppetlabs 12 | baseurl=http://yum.puppetlabs.com/el/6/products/\$basearch 13 | enabled=1 14 | gpgcheck=0 15 | EOM 16 | 17 | yum -y install puppet facter ruby-shadow 18 | 19 | -------------------------------------------------------------------------------- /scripts/rhn_reg.sh: -------------------------------------------------------------------------------- 1 | rhnreg_ks --username= --password= --force 2 | -------------------------------------------------------------------------------- /scripts/rhn_unreg.sh: -------------------------------------------------------------------------------- 1 | # you still need to remove the system from your classic subscription management 2 | rm -f /etc/sysconfig/rhn/systemid -------------------------------------------------------------------------------- /scripts/vagrant.sh: -------------------------------------------------------------------------------- 1 | # Vagrant specific 2 | date > /etc/vagrant_box_build_time 3 | 4 | # Add vagrant user 5 | /usr/sbin/groupadd vagrant 6 | /usr/sbin/useradd vagrant -g vagrant -G wheel 7 | echo "vagrant"|passwd --stdin vagrant 8 | echo "vagrant ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers.d/vagrant 9 | chmod 0440 /etc/sudoers.d/vagrant 10 | 11 | # Installing vagrant keys 12 | mkdir -pm 700 /home/vagrant/.ssh 13 | wget --no-check-certificate 'https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub' -O /home/vagrant/.ssh/authorized_keys 14 | chmod 0600 /home/vagrant/.ssh/authorized_keys 15 | chown -R vagrant /home/vagrant/.ssh -------------------------------------------------------------------------------- /scripts/virtualbox.sh: -------------------------------------------------------------------------------- 1 | # Installing the virtualbox guest additions 2 | VBOX_VERSION=$(cat /home/veewee/.vbox_version) 3 | cd /tmp 4 | mount -o loop /home/packer/VBoxGuestAdditions_$VBOX_VERSION.iso /mnt 5 | sh /mnt/VBoxLinuxAdditions.run 6 | umount /mnt 7 | rm -rf /home/packer/VBoxGuestAdditions_*.iso 8 | 9 | -------------------------------------------------------------------------------- /scripts/zerodisk.sh: -------------------------------------------------------------------------------- 1 | # Zero out the free space to save space in the final image: 2 | dd if=/dev/zero of=/EMPTY bs=1M 3 | rm -f /EMPTY 4 | --------------------------------------------------------------------------------