├── .gitattributes ├── .gitignore ├── AUTHORS ├── CHANGELOG.md ├── LICENSE ├── Makefile ├── README.md ├── VERSION ├── bin ├── Makefile.local.winry ├── box ├── build-box ├── bump.sh ├── register_atlas.sh ├── ssh-box ├── test-box └── test-vagrantcloud-box ├── centos.json ├── centos6-desktop.json ├── centos6.json ├── centos7-desktop.json ├── centos7.json ├── centos8-desktop.json ├── centos8.json ├── custom-script.sh ├── eol ├── .gitignore ├── centos5-desktop.json ├── centos5.json ├── custom-script.sh ├── kickstart │ ├── centos5-desktop │ │ └── ks.cfg │ └── centos5 │ │ ├── ks.cfg │ │ └── yum.repos.d │ │ ├── CentOS-Base.repo │ │ ├── CentOS-Sources.repo │ │ ├── CentOS-Vault.repo │ │ └── CentOS-fasttrack.repo ├── script │ ├── cleanup.sh │ ├── desktop.sh │ ├── fix-slow-dns.sh │ ├── motd.sh │ ├── parallels.sh │ ├── sshd.sh │ ├── update.sh │ ├── vagrant.sh │ ├── virtualbox.sh │ └── vmware.sh └── tpl │ └── vagrantfile-centos511-desktop.tpl ├── kickstart ├── centos6-desktop │ └── ks.cfg ├── centos6 │ └── ks.cfg ├── centos7-desktop │ └── ks.cfg ├── centos7 │ └── ks.cfg ├── centos8-desktop │ └── ks.cfg └── centos8 │ └── ks.cfg ├── script ├── cleanup.sh ├── desktop.sh ├── fix-slow-dns.sh ├── motd.sh ├── parallels.sh ├── sshd.sh ├── update.sh ├── vagrant.sh ├── virtualbox.sh └── vmware.sh ├── test ├── centos_spec.rb └── spec_helper.rb └── tpl ├── vagrantfile-centos6-desktop.tpl ├── vagrantfile-centos7-desktop.tpl └── vagrantfile-centos8-desktop.tpl /.gitattributes: -------------------------------------------------------------------------------- 1 | # Detect text files automatically 2 | * text=auto 3 | 4 | # Force Unix-style line endings on these files 5 | *.sh eol=lf 6 | *.cfg eol=lf 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | packer_cache/ 2 | output-* 3 | *.box 4 | *.tar.gz 5 | iso 6 | crash.log 7 | tmp 8 | .vagrant/ 9 | *.swp 10 | Makefile.local 11 | box/ 12 | .tmpatlas/ 13 | iso/ 14 | 15 | .DS_Store 16 | .bundle 17 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | # This file lists all individuals having contributed content to the repository. 2 | # If you're submitting a patch, please add your name here in alphabetical order as part of the patch. 3 | # 4 | Bert Van Vreckem 5 | Christian Berendt 6 | Dominic 7 | Ethan Hall 8 | Fydon 9 | Hugues Malphettes 10 | Jd Daniel 11 | Joshua Timberman 12 | Jeremy Rosengren 13 | Justin Kolberg 14 | Lorenzo Villani 15 | Masahiro Ono 16 | Matt Willsher 17 | Mischa Taylor 18 | Rickard von Essen 19 | Ross Smith II 20 | Ryan Lee 21 | Trevor Dearham 22 | Victor Volle 23 | Drew Budwin 24 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | ## 17.0915.1 (2017-09-15) 4 | 5 | * Upgrade CentOS 7 to 7.4.1708 6 | 7 | ## 17.0909.1 (2017-09-09) 8 | 9 | * Revert back to BIOS naming on CentOS 7, does not work with Parallels 10 | 11 | ## 17.0904.1 (2017-09-04) 12 | 13 | * Upgrade CentOS 6 image to version 6.9 14 | * Added `cleanup_build_tools` variable to control removal of build tools 15 | * Use consistent device naming on CentOS 7 now that it is supported by vagrant 16 | * Drop minor version from box names 17 | * Remove CentOS 5.x - EOL 18 | 19 | ## 2.0.21 (2016-12-15) 20 | 21 | * Port private_network workaround from upstream CentOS box 22 | * Fix centos511-desktop build on paralllels 23 | 24 | ## 2.0.20 (2016-12-14) 25 | 26 | * Add CentOS 7.3 template 27 | * Remove network workaround that was needed for CentOS 7.x in older versions 28 | of vagrant to avoid race condition 29 | 30 | ## 2.0.19 (2016-12-11) 31 | 32 | * Use virtio for better network performance 33 | * Workaround for gurumediatation error w/CentOS 5.x on VirtualBox 5.1.x 34 | * Add CentOS 5.11 desktop template 35 | 36 | ## 2.0.18 (2016-12-03) 37 | 38 | * Machine-id is now emptied not removed 39 | * Upgrade VirtualBox Guest Additions to 5.1.10 40 | * Upgrade Parallels tools to 12.1.1 41 | 42 | ## 2.0.17 (2016-11-12) 43 | 44 | * Fix issue with Parallels tools install 45 | * Upgrade VMware tools to 10.0.10.3275 for VMware Fusion 8.5.1 46 | * Upgrade Parallels tools to 12.1.0 47 | * Upgrade VirtualBox Guest Additions to 5.1.8 48 | 49 | ## 2.0.15 (2016-09-26) 50 | 51 | * Upgrade to Parallels 12 52 | * Upgrade Parallels tools to 12.0.2 53 | * Upgrade VMware tools to 10.0.10 for VMware Fusion 8.5.0 54 | 55 | ## 2.0.14 (2016-08-27) 56 | 57 | * Upgrade VirtualBox Guest Additions to 5.0.26 58 | * Upgrade Parallels tools to 11.2.1 59 | 60 | ## 2.0.14 (2015-05-22) 61 | 62 | * Upgrade VirtualBox Guest Additions to 5.0.20 63 | * Upgrade Parallels tools to 11.2.0 64 | * Upgrade VMware Guest Additions to 10.0.6 65 | 66 | ## 2.0.13 (2015-03-16) 67 | 68 | * Upgrade VirtualBox Guest Additions to 5.0.16 69 | 70 | ## 2.0.12 (2015-02-22) 71 | 72 | * Upgrade Docker to 1.10.1 73 | * Upgrade VirtualBox Guest Additions to 5.0.14 74 | * Upgrade Parallels tools to 11.1.3 75 | 76 | ## 2.0.11 (2015-01-09) 77 | 78 | * Upgrade Parallels tools to 11.1.2 79 | 80 | ## 2.0.10 (2015-12-30) 81 | 82 | * Add SELinux dependencies for 5.x & 6.x 83 | 84 | ## 2.0.9 (2015-11-21) 85 | 86 | * Add CentOS 7.2 templates 87 | * Upgrade Docker to 1.9.1 88 | * Upgrade VMware tools to 10.0.5 for VMware Fusion 8.1.0 89 | * Upgrade Parallels tools to 11.1.1 90 | 91 | ## 2.0.8 (2015-11-19) 92 | 93 | * Upgrade Parallels tools to 11.1.0 94 | * Upgrade Docker to 1.9.0 95 | 96 | ## 2.0.7 (2015-11-12) 97 | 98 | * Upgrade VirtualBox guest additions to version 5.0.10 99 | 100 | ## 2.0.6 (2015-11-01) 101 | 102 | * Upgrade VMware tools to 10.0.1 for VMware Fusion 8.0.2 103 | * Upgrade VirtualBox guest additions to version 5.0.8 104 | * Port improvements in structure/build parallelism from Ubuntu templates 105 | 106 | ## 2.0.5 (2015-10-07) 107 | 108 | * Upgrade VirtualBox guest additions to version 5.0.6 109 | * Add an motd banner 110 | 111 | ## 2.0.4 (2015-09-30) 112 | 113 | * Upgrade VirtualBox guest additions to 5.0.4 114 | * Install Docker from the official get.docker.com package repo 115 | * Remove Parallels provider 116 | 117 | ## 2.0.3 (2015-08-27) 118 | 119 | * Upgrade VMware tools to 10.0.0 for VMware Fusion 8 120 | * Upgrae Parallels tools to 11.0.0 121 | 122 | ## 2.0.2 (2015-08-15) 123 | 124 | * Add CentOS 6.7 templates 125 | * Upgrade VirtualBox guest additions to 5.0.2 126 | 127 | ## 2.0.1 (2015-07-30) 128 | 129 | * Upgrade Parallels tools to 10.2.2 130 | 131 | ## 2.0.0 (2015-07-22) 132 | 133 | * Upgrade VirtualBox guest additions to 5.0.0 134 | 135 | ## 1.0.17 (2015-06-20) 136 | 137 | * Make selinux permissive by default 138 | * Upgrade VMware tools to 9.9.3 for VMware Fusion 7.1.2 139 | * Increase lazy-allocated disk size for server images to 64GB 140 | * Increase lazy-allocated disk size for desktop images to 127GB 141 | 142 | ## 1.0.16 (2015-06-04) 143 | 144 | * Upgrade VirtualBox guest additions to 4.3.28 145 | * Upgrade Parallels tools to 10.2.1 146 | 147 | ## 1.0.15 (2015-04-09) 148 | 149 | * Add CentOS 7.1 templates 150 | * Upgrade Parallels tools to 10.2.0 151 | 152 | ## 1.0.14 (2015-03-22) 153 | 154 | * Upgrade VirtualBox Guest Additions to 4.3.26 155 | 156 | ## 1.0.13 (2015-03-09) 157 | 158 | * Upgrade VirtualBox Guest Additions to 4.3.24 159 | * Fix issues with SELinux not always being disabled 160 | 161 | ## 1.0.12 (2015-02-26) 162 | 163 | * Use the SATA HDD controller for faster disk IO speeds on VirtualBox 164 | * Rely on the vendor-supplied ca-bundle.crt that comes with the openssl package 165 | 166 | ## 1.0.11 (2015-02-22) 167 | 168 | * Upgrade VirtualBox Guest Additions to 4.3.22 169 | * Upgrade VMware Tools to 9.9.2 for VMware Fusion 7.1.1 170 | * Upgrade Parallels Tools to 10.1.4 171 | 172 | ## 1.0.9 (2014-12-29) 173 | 174 | * Upgrade Parallels Tools to 10.1.2 175 | * Upgrade Docker to 1.3.2 176 | * Default timezone now UTC 177 | 178 | ## 1.0.8 (2014-12-06) 179 | 180 | * Upgrade VMware Tools to 9.9.0 for VMware Fusion 7.1.0 181 | * Remove unnecessary iwl-firmware packages on CentOS 7 182 | 183 | ## 1.0.7 (2014-11-28) 184 | 185 | * Upgrade VirtualBox Guest Additions to 4.3.20 186 | * Upgrade Docker to 1.3.1 on CentOS 6 187 | * Upgrade Docker to 1.2.0 on CentOS 7 188 | 189 | ## 1.0.6 (2014-11-02) 190 | 191 | * Corrected commenting out of requiretty 192 | * Upgrade VMware Tools to 9.8.4 for VMware Fusion 7.0.1 193 | * Added Parallels 10.1.1 boxes to build 194 | 195 | ## 1.0.5 (2014-10-17) 196 | 197 | * Upgrade VirtualBox Guest Additions to 4.3.18 198 | 199 | ## 1.0.4 (2014-09-29) 200 | 201 | * Added templates for CentOS 5.11 202 | 203 | ## 1.0.3 (2014-09-21) 204 | 205 | * Upgraded VirtualBox Guest Additions to 4.3.16 206 | * Version information now appended to box file name 207 | 208 | ## 1.0.2 (2014-09-04) 209 | 210 | * Upgraded VMware Tools to 9.8.3 for VMware Fusion 7 211 | * Added Docker images 212 | * Added 3D acceleration to Desktop images 213 | 214 | ## 1.0.1 (2014-07-31) 215 | 216 | * Added CentOS 7.0 support 217 | * Made templates more proxy friendly 218 | * Added headless option 219 | * Added option to run "yum -y update" 220 | 221 | ## 1.0.0 (2014-05-09) 222 | 223 | * Initial commit 224 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright 2014 Box-Cutter Authors (see AUTHORS file). 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | BOX_VERSION ?= $(shell cat VERSION) 2 | BOX_SUFFIX := -$(BOX_VERSION).box 3 | BUILDER_TYPES ?= vmware virtualbox parallels 4 | TEMPLATE_FILENAMES := $(filter-out centos.json,$(wildcard *.json)) 5 | BOX_NAMES := $(basename $(TEMPLATE_FILENAMES)) 6 | BOX_FILENAMES := $(TEMPLATE_FILENAMES:.json=$(BOX_SUFFIX)) 7 | VMWARE_BOX_DIR ?= box/vmware 8 | VMWARE_TEMPLATE_FILENAMES = $(TEMPLATE_FILENAMES) 9 | VMWARE_BOX_FILENAMES := $(VMWARE_TEMPLATE_FILENAMES:.json=$(BOX_SUFFIX)) 10 | VMWARE_BOX_FILES := $(foreach box_filename, $(VMWARE_BOX_FILENAMES), $(VMWARE_BOX_DIR)/$(box_filename)) 11 | VIRTUALBOX_BOX_DIR ?= box/virtualbox 12 | VIRTUALBOX_TEMPLATE_FILENAMES = $(TEMPLATE_FILENAMES) 13 | VIRTUALBOX_BOX_FILENAMES := $(VIRTUALBOX_TEMPLATE_FILENAMES:.json=$(BOX_SUFFIX)) 14 | VIRTUALBOX_BOX_FILES := $(foreach box_filename, $(VIRTUALBOX_BOX_FILENAMES), $(VIRTUALBOX_BOX_DIR)/$(box_filename)) 15 | PARALLELS_BOX_DIR ?= box/parallels 16 | PARALLELS_TEMPLATE_FILENAMES = $(TEMPLATE_FILENAMES) 17 | PARALLELS_BOX_FILENAMES := $(PARALLELS_TEMPLATE_FILENAMES:.json=$(BOX_SUFFIX)) 18 | PARALLELS_BOX_FILES := $(foreach box_filename, $(PARALLELS_BOX_FILENAMES), $(PARALLELS_BOX_DIR)/$(box_filename)) 19 | BOX_FILES := $(VMWARE_BOX_FILES) $(VIRTUALBOX_BOX_FILES) $(PARALLELS_BOX_FILES) 20 | 21 | box/vmware/%$(BOX_SUFFIX) box/virtualbox/%$(BOX_SUFFIX) box/parallels/%$(BOX_SUFFIX): %.json 22 | bin/box build $< 23 | 24 | .PHONY: all clean assure deliver 25 | 26 | all: build assure deliver assure_atlas assure_atlas_vmware assure_atlas_virtualbox assure_atlas_parallels 27 | 28 | build: $(BOX_FILES) 29 | 30 | assure: assure_vmware assure_virtualbox assure_parallels 31 | 32 | assure_vmware: $(VMWARE_BOX_FILES) 33 | @for vmware_box_file in $(VMWARE_BOX_FILES) ; do \ 34 | echo Checking $$vmware_box_file ; \ 35 | bin/box test $$vmware_box_file vmware ; \ 36 | done 37 | 38 | assure_virtualbox: $(VIRTUALBOX_BOX_FILES) 39 | @for virtualbox_box_file in $(VIRTUALBOX_BOX_FILES) ; do \ 40 | echo Checking $$virtualbox_box_file ; \ 41 | bin/box test $$virtualbox_box_file virtualbox ; \ 42 | done 43 | 44 | assure_parallels: $(PARALLELS_BOX_FILES) 45 | @for parallels_box_file in $(PARALLELS_BOX_FILES) ; do \ 46 | echo Checking $$parallels_box_file ; \ 47 | bin/box test $$parallels_box_file parallels ; \ 48 | done 49 | 50 | assure_atlas: assure_atlas_vmware assure_atlas_virtualbox assure_atlas_parallels 51 | 52 | assure_atlas_vmware: 53 | @for box_name in $(BOX_NAMES) ; do \ 54 | echo Checking $$box_name ; \ 55 | bin/test-vagrantcloud-box box-cutter/$$box_name vmware ; \ 56 | bin/test-vagrantcloud-box boxcutter/$$box_name vmware ; \ 57 | done 58 | 59 | assure_atlas_virtualbox: 60 | @for box_name in $(BOX_NAMES) ; do \ 61 | echo Checking $$box_name ; \ 62 | bin/test-vagrantcloud-box box-cutter/$$box_name virtualbox ; \ 63 | bin/test-vagrantcloud-box boxcutter/$$box_name virtualbox ; \ 64 | done 65 | 66 | assure_atlas_parallels: 67 | @for box_name in $(BOX_NAMES) ; do \ 68 | echo Checking $$box_name ; \ 69 | bin/test-vagrantcloud-box box-cutter/$$box_name parallels ; \ 70 | bin/test-vagrantcloud-box boxcutter/$$box_name parallels ; \ 71 | done 72 | 73 | deliver: 74 | @for box_name in $(BOX_NAMES) ; do \ 75 | echo Uploading $$box_name to Atlas ; \ 76 | bin/register_atlas.sh $$box_name $(BOX_SUFFIX) $(BOX_VERSION) ; \ 77 | done 78 | 79 | clean: 80 | @for builder in $(BUILDER_TYPES) ; do \ 81 | echo Deleting output-*-$$builder-iso ; \ 82 | echo rm -rf output-*-$$builder-iso ; \ 83 | done 84 | @for builder in $(BUILDER_TYPES) ; do \ 85 | if test -d box/$$builder ; then \ 86 | echo Deleting box/$$builder/*.box ; \ 87 | find box/$$builder -maxdepth 1 -type f -name "*.box" ! -name .gitignore -exec rm '{}' \; ; \ 88 | fi ; \ 89 | done 90 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Packer templates for CentOS written in legacy JSON 2 | 3 | ### Overview 4 | 5 | This repository contains Packer templates for creating CentOS Vagrant boxes written in legacy JSON. 6 | 7 | ## Current Boxes 8 | 9 | We no longer provide pre-built binaries for these templates. 10 | 11 | ## Building the Vagrant boxes with Packer 12 | 13 | To build all the boxes, you will need [VirtualBox](https://www.virtualbox.org/wiki/Downloads), 14 | [VMware Fusion](https://www.vmware.com/products/fusion)/[VMware Workstation](https://www.vmware.com/products/workstation) and 15 | [Parallels](http://www.parallels.com/products/desktop/whats-new/) installed. 16 | 17 | Parallels requires that the 18 | [Parallels Virtualization SDK for Mac](http://www.parallels.com/downloads/desktop) 19 | be installed as an additional prerequisite. 20 | 21 | We make use of JSON files containing user variables to build specific versions of CentOS. 22 | You tell `packer` to use a specific user variable file via the `-var-file=` command line 23 | option. This will override the default options on the core `centos.json` packer template, 24 | which builds CentOS 7 by default. 25 | 26 | For example, to build CentOS 7, use the following: 27 | 28 | $ packer build -var-file=centos7.json centos.json 29 | 30 | If you want to make boxes for a specific desktop virtualization platform, use the `-only` 31 | parameter. For example, to build CentOS 7 for VirtualBox: 32 | 33 | $ packer build -only=virtualbox-iso -var-file=centos7.json centos.json 34 | 35 | The boxcutter templates currently support the following desktop virtualization strings: 36 | 37 | * `parallels-iso` - [Parallels](http://www.parallels.com/products/desktop/whats-new/) desktop virtualization (Requires the Pro Edition - Desktop edition won't work) 38 | * `virtualbox-iso` - [VirtualBox](https://www.virtualbox.org/wiki/Downloads) desktop virtualization 39 | * `vmware-iso` - [VMware Fusion](https://www.vmware.com/products/fusion) or [VMware Workstation](https://www.vmware.com/products/workstation) desktop virtualization 40 | 41 | ## Building the Vagrant boxes with the box script 42 | 43 | We've also provided a wrapper script `bin/box` for ease of use, so alternatively, you can use 44 | the following to build CentOS 7 for all providers: 45 | 46 | $ bin/box build centos7 47 | 48 | Or if you just want to build CentOS 7 for VirtualBox: 49 | 50 | $ bin/box build centos7 virtualbox 51 | 52 | ## Building the Vagrant boxes with the Makefile 53 | 54 | A GNU Make `Makefile` drives a complete basebox creation pipeline with the following stages: 55 | 56 | * `build` - Create basebox `*.box` files 57 | * `assure` - Verify that the basebox `*.box` files produced function correctly 58 | * `deliver` - Upload `*.box` files to [Artifactory](https://www.jfrog.com/confluence/display/RTF/Vagrant+Repositories), [Atlas](https://atlas.hashicorp.com/) or an [S3 bucket](https://aws.amazon.com/s3/) 59 | 60 | The pipeline is driven via the following targets, making it easy for you to include them 61 | in your favourite CI tool: 62 | 63 | make build # Build all available box types 64 | make assure # Run tests against all the boxes 65 | make deliver # Upload box artifacts to a repository 66 | make clean # Clean up build detritus 67 | 68 | ### Proxy Settings 69 | 70 | The templates respect the following network proxy environment variables 71 | and forward them on to the virtual machine environment during the box creation 72 | process, should you be using a proxy: 73 | 74 | * http_proxy 75 | * https_proxy 76 | * ftp_proxy 77 | * rsync_proxy 78 | * no_proxy 79 | 80 | ### Tests 81 | 82 | The tests are written in [Serverspec](http://serverspec.org) and require the 83 | `vagrant-serverspec` plugin to be installed with: 84 | 85 | vagrant plugin install vagrant-serverspec 86 | 87 | The `Makefile` has individual targets for each box type with the prefix 88 | `test-*` should you wish to run tests individually for each box. For example: 89 | 90 | make test-virtualbox/centos66-nocm.box 91 | 92 | Similarly there are targets with the prefix `ssh-*` for registering a 93 | newly-built box with vagrant and for logging in using just one command to 94 | do exploratory testing. For example, to do exploratory testing 95 | on the VirtualBox training environmnet, run the following command: 96 | 97 | make ssh-virtualbox/centos66-nocm.box 98 | 99 | Upon logout `make ssh-*` will automatically de-register the box as well. 100 | 101 | ## Contributing 102 | 103 | 104 | 1. Fork and clone the repo. 105 | 2. Create a new branch, please don't work in your `master` branch directly. 106 | 3. Add new [Serverspec](http://serverspec.org/) or [Bats](https://blog.engineyard.com/2014/bats-test-command-line-tools) tests in the `test/` subtree for the change you want to make. Run `make test` on a relevant template to see the tests fail (like `make test-virtualbox/centos65`). 107 | 4. Fix stuff. Use `make ssh` to interactively test your box (like `make ssh-virtualbox/centos65`). 108 | 5. Run `make test` on a relevant template (like `make test-virtualbox/centos65`) to see if the tests pass. Repeat steps 3-5 until done. 109 | 6. Update `README.md` and `AUTHORS` to reflect any changes. 110 | 7. If you have a large change in mind, it is still preferred that you split them into small commits. Good commit messages are important. The git documentation project has some nice guidelines on [writing descriptive commit messages](http://git-scm.com/book/ch5-2.html#Commit-Guidelines). 111 | 8. Push to your fork and submit a pull request. 112 | 9. Once submitted, a full `make test` run will be performed against your change in the build farm. You will be notified if the test suite fails. 113 | 114 | ### Would you like to help out more? 115 | 116 | Contact moujan@annawake.com 117 | 118 | ### Acknowledgments 119 | 120 | [Parallels](http://www.parallels.com/) provided a Business Edition license of 121 | their software to run on the basebox build farm. 122 | 123 | 124 | 125 | [SmartyStreets](http://www.smartystreets.com) provided basebox hosting for the boxcutter project since 2015 - thank you for your support! 126 | 127 | 128 | -------------------------------------------------------------------------------- /VERSION: -------------------------------------------------------------------------------- 1 | 17.0915.1 2 | -------------------------------------------------------------------------------- /bin/Makefile.local.winry: -------------------------------------------------------------------------------- 1 | ISO_PATH := file:///Volumes/Thunder/software/centos 2 | 3 | VIRTUALBOX_VERSION := $(shell virtualbox --help | head -n 1 | awk '{print $$NF}') 4 | VMWARE_VERSION := 9.9.3 5 | VMWARE_BOX_FILES := $(wildcard box/vmware/*.box) 6 | VIRTUALBOX_BOX_FILES := $(wildcard box/virtualbox/*.box) 7 | VMWARE_S3_BUCKET := s3://smartystreets-boxcutter/centos/vmware$(VMWARE_VERSION)/ 8 | VIRTUALBOX_S3_BUCKET := s3://smartystreets-boxcutter/centos/virtualbox$(VIRTUALBOX_VERSION)/ 9 | S3_GRANT_ID := id=120985f7542bdcc1f07bb3e2fc74f0e53a03f9a05e4267a3c8d38d27933c7a94 10 | AWS_PROFILE = smartystreets 11 | -------------------------------------------------------------------------------- /bin/box: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -o errexit -o nounset -o pipefail 3 | 4 | if [ "${DEBUG:=false}" = "true" ]; then 5 | set -o xtrace 6 | fi 7 | 8 | usage() { 9 | echo "usage: $(basename $0) [-h/--help] command [arguments...]" 10 | echo 11 | echo "Available commands are:" 12 | echo " build Generate a box image file" 13 | echo " ssh Run vagrant ssh against a box image name" 14 | echo " test Run serverspec tests against a box image name" 15 | } 16 | 17 | args() { 18 | if [ $# -lt 1 ]; then 19 | usage 20 | exit 0 21 | fi 22 | 23 | if [[ ! $1 =~ ^(build|ssh|test)$ ]]; then 24 | echo "$(basename $0): illegal option $1" 25 | usage 26 | exit 1 27 | fi 28 | 29 | command=$1 30 | case $command in 31 | "" | "-h" | "--help") 32 | usage 33 | ;; 34 | *) 35 | shift 36 | ;; 37 | esac 38 | $command "$@" 39 | } 40 | 41 | ssh() { 42 | bin/ssh-box "$@" 43 | } 44 | 45 | test() { 46 | bin/test-box "$@" 47 | } 48 | 49 | build() { 50 | bin/build-box "$@" 51 | } 52 | 53 | # main 54 | args "$@" 55 | -------------------------------------------------------------------------------- /bin/build-box: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -o errexit -o nounset -o pipefail 3 | 4 | if [ "${DEBUG:=false}" = "true" ]; then 5 | set -o xtrace 6 | fi 7 | 8 | usage() { 9 | echo "usage: $(basename $0) VAR_LIST_FILE [vmware|virtualbox|parallels] [PACKER_TEMPLATE]" 10 | echo 11 | echo "Build a box" 12 | } 13 | 14 | args() { 15 | if [ $# -lt 1 ]; then 16 | usage 17 | exit 0 18 | fi 19 | 20 | var_file=$1 21 | if [ ! -f ${var_file} ]; then 22 | var_file="${var_file}.json" 23 | if [ ! -f ${var_file} ]; then 24 | echo "$(basename $0): Invalid template file ${var_list_template}" 25 | exit 127 26 | fi 27 | fi 28 | only=${2:-} 29 | if [[ -n ${only} ]]; then 30 | if [[ ! $only =~ ^(vmware|virtualbox|parallels)$ ]]; then 31 | echo "$(basename $0): illegal platform $2" 32 | echo "Valid platforms: vmware|virtualbox|parallels" 33 | usage 34 | exit 1 35 | fi 36 | fi 37 | if [[ "${only}" = "vmware" ]]; then 38 | only=vmware-iso 39 | elif [[ "${only}" = "virtualbox" ]]; then 40 | only=virtualbox-iso 41 | elif [[ "${only}" = "parallels" ]]; then 42 | only=parallels-iso 43 | fi 44 | if [ -n "${only}" ]; then 45 | only="-only=${only}" 46 | fi 47 | packer_template=${3:-centos.json} 48 | } 49 | 50 | # main 51 | args "$@" 52 | 53 | version=$(cat VERSION) 54 | packer build ${only} -var-file=${var_file} -var "version=${version}" ${packer_template} 55 | -------------------------------------------------------------------------------- /bin/bump.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -eu 2 | 3 | if [ "${DEBUG:=false}" = "true" ]; then 4 | set -x 5 | fi 6 | 7 | usage() { 8 | echo "usage: $(basename $0) " 9 | echo 10 | echo "Available subcommands are:" 11 | echo " current Print current version" 12 | echo " major Bump major version (ex: 1.2.1 -> 2.0.0)" 13 | echo " minor Bump minor version (ex: 1.2.1 -> 1.3.0)" 14 | echo " patch Bump patch version (ex: 1.2.1 -> 1.2.2)" 15 | echo " tag Tag in Git using current version" 16 | } 17 | 18 | args() { 19 | if [ $# -lt 1 ]; then 20 | usage 21 | exit 0 22 | fi 23 | 24 | if [[ ! $1 =~ ^(current|major|minor|patch|tag)$ ]]; then 25 | usage 26 | exit 1 27 | fi 28 | 29 | subcommand=$1 30 | case $subcommand in 31 | "" | "-h" | "--help") 32 | usage 33 | ;; 34 | *) 35 | shift 36 | ;; 37 | esac 38 | $subcommand 39 | } 40 | 41 | current() { 42 | echo "Current version: ${CURRENT_VERSION}" 43 | } 44 | 45 | tag() { 46 | echo "tagged: ${CURRENT_VERSION}" 47 | git fetch --all > /dev/null 48 | git add CHANGELOG.md 49 | git commit -m "Version ${CURRENT_VERSION} pushed to Atlas" 50 | git tag -a -m "Version ${CURRENT_VERSION} pushed to Atlas" ${CURRENT_VERSION} 51 | git push --tags || true 52 | } 53 | 54 | write_version() { 55 | NEXT_VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION} 56 | echo "Writing files: VERSION" 57 | echo ${NEXT_VERSION} > VERSION 58 | git fetch --all > /dev/null 59 | git add VERSION 60 | git commit -m "Bump VERSION to ${NEXT_VERSION}" 61 | } 62 | 63 | major() { 64 | MAJOR_VERSION=$((${MAJOR_VERSION}+1)) 65 | MINOR_VERSION=0 66 | PATCH_VERSION=0 67 | write_version 68 | } 69 | 70 | minor() { 71 | MAJOR_VERSION=${MAJOR_VERSION} 72 | MINOR_VERSION=$((${MINOR_VERSION}+1)) 73 | PATCH_VERSION=0 74 | write_version 75 | } 76 | 77 | patch() { 78 | MAJOR_VERSION=${MAJOR_VERSION} 79 | MINOR_VERSION=${MINOR_VERSION} 80 | PATCH_VERSION=$((${PATCH_VERSION}+1)) 81 | write_version 82 | } 83 | 84 | main() { 85 | CURRENT_VERSION=$(cat VERSION) 86 | VERSION_LIST=($(echo ${CURRENT_VERSION} | tr '.' ' ')) 87 | MAJOR_VERSION=${VERSION_LIST[0]} 88 | MINOR_VERSION=${VERSION_LIST[1]} 89 | PATCH_VERSION=${VERSION_LIST[2]} 90 | args "$@" 91 | } 92 | 93 | main "$@" 94 | 95 | -------------------------------------------------------------------------------- /bin/register_atlas.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -o nounset # Treat unset variables as an error and immediately exit 3 | set -o errexit # If a command fails exit the whole script 4 | 5 | if [ "${DEBUG:-false}" = "true" ]; then 6 | set -x # Run the entire script in debug mode 7 | fi 8 | 9 | usage() { 10 | echo "usage: $(basename $0) " 11 | echo 12 | echo "Requires the following environment variables to be set:" 13 | echo " ATLAS_USERNAME" 14 | echo " ATLAS_ACCESS_TOKEN" 15 | } 16 | 17 | args() { 18 | if [ $# -lt 3 ]; then 19 | usage 20 | exit 1 21 | fi 22 | 23 | if [ -z ${ATLAS_USERNAME+x} ]; then 24 | echo "ATLAS_USERNAME environment variable not set!" 25 | usage 26 | exit 1 27 | elif [ -z ${ATLAS_ACCESS_TOKEN+x} ]; then 28 | echo "ATLAS_ACCESS_TOKEN environment variable not set!" 29 | usage 30 | exit 1 31 | fi 32 | 33 | BOX_NAME=$1 34 | BOX_SUFFIX=$2 35 | VERSION=$3 36 | } 37 | 38 | get_short_description() { 39 | if [[ "${BOX_NAME}" =~ i386 ]]; then 40 | BIT_STRING="32-bit" 41 | else 42 | BIT_STRING="64-bit" 43 | fi 44 | DOCKER_STRING= 45 | if [[ "${BOX_NAME}" =~ docker ]]; then 46 | DOCKER_STRING=" with Docker preinstalled" 47 | fi 48 | DESKTOP_STRING= 49 | if [[ "${BOX_NAME}" =~ desktop ]]; then 50 | DESKTOP_STRING=" Desktop" 51 | fi 52 | RAW_VERSION=${BOX_NAME#centos} 53 | RAW_VERSION=${RAW_VERSION%-i386} 54 | RAW_VERSION=${RAW_VERSION%-docker} 55 | RAW_VERSION=${RAW_VERSION%-desktop} 56 | PRETTY_VERSION=${RAW_VERSION:0:1}.${RAW_VERSION:1} 57 | 58 | VIRTUALBOX_VERSION=$(virtualbox --help | head -n 1 | awk '{print $NF}') 59 | PARALLELS_VERSION=$(prlctl --version | awk '{print $3}') 60 | VMWARE_VERSION=10.1.6 61 | SHORT_DESCRIPTION="CentOS ${PRETTY_VERSION}${DESKTOP_STRING} (${BIT_STRING})${DOCKER_STRING}" 62 | } 63 | 64 | create_description() { 65 | if [[ "${BOX_NAME}" =~ i386 ]]; then 66 | BIT_STRING="32-bit" 67 | else 68 | BIT_STRING="64-bit" 69 | fi 70 | DOCKER_STRING= 71 | if [[ "${BOX_NAME}" =~ docker ]]; then 72 | DOCKER_STRING=" with Docker preinstalled" 73 | fi 74 | DESKTOP_STRING= 75 | if [[ "${BOX_NAME}" =~ desktop ]]; then 76 | DESKTOP_STRING=" Desktop" 77 | fi 78 | RAW_VERSION=${BOX_NAME#centos} 79 | RAW_VERSION=${RAW_VERSION%-i386} 80 | RAW_VERSION=${RAW_VERSION%-docker} 81 | RAW_VERSION=${RAW_VERSION%-desktop} 82 | PRETTY_VERSION=${RAW_VERSION:0:1}.${RAW_VERSION:1} 83 | 84 | VIRTUALBOX_VERSION=$(virtualbox --help | head -n 1 | awk '{print $NF}') 85 | PARALLELS_VERSION=$(prlctl --version | awk '{print $3}') 86 | VMWARE_VERSION=10.1.6 87 | 88 | VMWARE_BOX_FILE=box/vmware/${BOX_NAME}${BOX_SUFFIX} 89 | VIRTUALBOX_BOX_FILE=box/virtualbox/${BOX_NAME}${BOX_SUFFIX} 90 | PARALLELS_BOX_FILE=box/parallels/${BOX_NAME}${BOX_SUFFIX} 91 | DESCRIPTION="CentOS ${PRETTY_VERSION}${DESKTOP_STRING} (${BIT_STRING})${DOCKER_STRING} 92 | 93 | " 94 | if [[ -e ${VMWARE_BOX_FILE} ]]; then 95 | FILESIZE=$(du -k -h "${VMWARE_BOX_FILE}" | cut -f1) 96 | DESCRIPTION=${DESCRIPTION}"VMWare ${FILESIZE}B/" 97 | fi 98 | if [[ -e ${VIRTUALBOX_BOX_FILE} ]]; then 99 | FILESIZE=$(du -k -h "${VIRTUALBOX_BOX_FILE}" | cut -f1) 100 | DESCRIPTION=${DESCRIPTION}"VirtualBox ${FILESIZE}B/" 101 | fi 102 | if [[ -e ${PARALLELS_BOX_FILE} ]]; then 103 | FILESIZE=$(du -k -h "${PARALLELS_BOX_FILE}" | cut -f1) 104 | DESCRIPTION=${DESCRIPTION}"Parallels ${FILESIZE}B/" 105 | fi 106 | DESCRIPTION=${DESCRIPTION%?} 107 | 108 | if [[ -e ${VMWARE_BOX_FILE} ]]; then 109 | DESCRIPTION="${DESCRIPTION} 110 | 111 | VMware Tools ${VMWARE_VERSION}" 112 | fi 113 | if [[ -e ${VIRTUALBOX_BOX_FILE} ]]; then 114 | DESCRIPTION="${DESCRIPTION} 115 | 116 | VirtualBox Guest Additions ${VIRTUALBOX_VERSION}" 117 | fi 118 | if [[ -e ${PARALLELS_BOX_FILE} ]]; then 119 | DESCRIPTION="${DESCRIPTION} 120 | 121 | Parallels Tools ${PARALLELS_VERSION}" 122 | fi 123 | 124 | VERSION_JSON=$( 125 | jq -n "{ 126 | version: { 127 | version: \"${VERSION}\", 128 | description: \"${DESCRIPTION}\" 129 | } 130 | }" 131 | ) 132 | } 133 | 134 | publish_provider() { 135 | atlas_username=$1 136 | atlas_access_token=$2 137 | 138 | echo "==> Checking to see if ${PROVIDER} provider exists" 139 | HTTP_STATUS=$(curl -s -f -o /dev/nul -w "%{http_code}" -i "${ATLAS_API_URL}/box/${atlas_username}/${BOX_NAME}/version/${VERSION}/provider/${PROVIDER}"?access_token="${atlas_access_token}" || true) 140 | echo ${HTTP_STATUS} 141 | if [ 200 -eq ${HTTP_STATUS} ]; then 142 | echo "==> Updating ${PROVIDER} provider" 143 | curl -X PUT "${ATLAS_API_URL}/box/${atlas_username}/${BOX_NAME}/version/${VERSION}/provider/${PROVIDER}" -d "access_token=${atlas_access_token}" -d provider[name]="${PROVIDER}" -d provider[url]="${PROVIDER_URL}" 144 | else 145 | echo "==> Creating ${PROVIDER} provider" 146 | curl -X POST "${ATLAS_API_URL}/box/${atlas_username}/${BOX_NAME}/version/${VERSION}/providers" -d "access_token=${atlas_access_token}" -d provider[name]="${PROVIDER}" -d provider[url]="${PROVIDER_URL}" 147 | fi 148 | } 149 | 150 | atlas_publish() { 151 | atlas_username=$1 152 | atlas_access_token=$2 153 | 154 | ATLAS_API_URL=https://app.vagrantup.com/api/v1 155 | 156 | echo "==> Checking for existing box ${BOX_NAME} on ${atlas_username}" 157 | # Retrieve box 158 | HTTP_STATUS=$(curl -s -f -o /dev/nul -w "%{http_code}" -i "${ATLAS_API_URL}/box/${atlas_username}/${BOX_NAME}"?access_token="${atlas_access_token}" || true) 159 | if [ 404 -eq ${HTTP_STATUS} ]; then 160 | echo "${BOX_NAME} does not exist, creating" 161 | get_short_description 162 | 163 | curl -X POST "${ATLAS_API_URL}/boxes" -d box[name]="${BOX_NAME}" -d box[short_description]="${SHORT_DESCRIPTION}" -d box[is_private]=false -d "access_token=${atlas_access_token}" 164 | elif [ 200 -ne ${HTTP_STATUS} ]; then 165 | echo "Unknown status ${HTTP_STATUS} from box/get" && exit 1 166 | fi 167 | 168 | echo "==> Checking for existing version ${VERSION} on ${atlas_username}" 169 | # Retrieve version 170 | HTTP_STATUS=$(curl -s -f -o /dev/nul -w "%{http_code}" -i "${ATLAS_API_URL}/box/${atlas_username}/${BOX_NAME}/version/${VERSION}" || true) 171 | if [ 404 -ne ${HTTP_STATUS} ] && [ 200 -ne ${HTTP_STATUS} ]; then 172 | echo "Unknown HTTP status ${HTTP_STATUS} from version/get" && exit 1 173 | fi 174 | 175 | create_description 176 | #echo "${VERSION_JSON}" 177 | if [ 404 -eq ${HTTP_STATUS} ]; then 178 | echo "==> none found; creating" 179 | JSON_RESULT=$(curl -s -f -X POST -H "Content-Type: application/json" "${ATLAS_API_URL}/box/${atlas_username}/${BOX_NAME}/versions?access_token=${atlas_access_token}" -d "${VERSION_JSON}" || true) 180 | else 181 | echo "==> version found; updating" 182 | JSON_RESULT=$(curl -s -f -X PUT "${ATLAS_API_URL}/box/${atlas_username}/${BOX_NAME}/version/${VERSION}" -d "access_token=${atlas_access_token}" -d "version[description]=${DESCRIPTION}" || true) 183 | fi 184 | 185 | BOXCUTTER_BASE_URL=http://cdn.boxcutter.io/centos 186 | if [[ -e ${VMWARE_BOX_FILE} ]]; then 187 | PROVIDER=vmware_desktop 188 | PROVIDER_URL=${BOXCUTTER_BASE_URL}/vmware${VMWARE_VERSION}/${BOX_NAME}${BOX_SUFFIX} 189 | publish_provider ${atlas_username} ${atlas_access_token} 190 | fi 191 | if [[ -e ${VIRTUALBOX_BOX_FILE} ]]; then 192 | PROVIDER=virtualbox 193 | PROVIDER_URL=${BOXCUTTER_BASE_URL}/virtualbox${VIRTUALBOX_VERSION}/${BOX_NAME}${BOX_SUFFIX} 194 | publish_provider ${atlas_username} ${atlas_access_token} 195 | fi 196 | if [[ -e ${PARALLELS_BOX_FILE} ]]; then 197 | PROVIDER=parallels 198 | PROVIDER_URL=${BOXCUTTER_BASE_URL}/parallels${PARALLELS_VERSION}/${BOX_NAME}${BOX_SUFFIX} 199 | publish_provider ${atlas_username} ${atlas_access_token} 200 | fi 201 | 202 | echo 203 | STATUS=$(echo ${JSON_RESULT} | jq -r .status) 204 | case $STATUS in 205 | unreleased) 206 | curl -X PUT "${ATLAS_API_URL}/box/${atlas_username}/${BOX_NAME}/version/${VERSION}/release" -d "access_token=${atlas_access_token}" 207 | echo 'released!' 208 | ;; 209 | active) 210 | echo 'already released' 211 | ;; 212 | *) 213 | abort "cannot publish version with status '$STATUS'" 214 | esac 215 | } 216 | 217 | main() { 218 | args "$@" 219 | 220 | ATLAS_API_URL=https://app.vagrantup.com/api/v1 221 | atlas_publish ${ATLAS_USERNAME} ${ATLAS_ACCESS_TOKEN} 222 | } 223 | 224 | main "$@" 225 | -------------------------------------------------------------------------------- /bin/ssh-box: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -o errexit -o nounset -o pipefail 3 | 4 | if [ "${DEBUG:=false}" = "true" ]; then 5 | set -o xtrace 6 | fi 7 | 8 | usage() { 9 | echo "usage: $(basename $0) BOX_PATH [vmware|virtualbox|parallels]" 10 | echo 11 | echo "Temporarily register a vagrant box to login to it" 12 | } 13 | 14 | args() { 15 | if [ $# -lt 2 ]; then 16 | usage 17 | exit 0 18 | fi 19 | 20 | if [[ ! $2 =~ ^(vmware|virtualbox|parallels)$ ]]; then 21 | echo "$(basename $0): illegal platform $2" 22 | echo "Valid platforms: vmware|virtualbox|parallels" 23 | usage 24 | exit 1 25 | fi 26 | 27 | box_path=$1 28 | box_provider=$2 29 | vagrant_provider=${3:-${box_provider}} 30 | if [ "$box_provider" = "vmware" ]; then 31 | box_provider=vmware_desktop 32 | if [[ $OSTYPE =~ darwin ]]; then 33 | vagrant_provider=vmware_fusion 34 | else 35 | vagrant_provider=vmware_workstation 36 | fi 37 | fi 38 | } 39 | 40 | # main 41 | args "$@" 42 | 43 | box_filename=$(basename "${box_path}") 44 | box_name=${box_filename%.*} 45 | tmp_path=/tmp/boxtest 46 | 47 | rm -rf ${tmp_path} 48 | 49 | vagrant box remove ${box_name} --provider ${box_provider} || true 50 | vagrant box add ${box_name} ${box_path} 51 | mkdir -p ${tmp_path} 52 | 53 | pushd ${tmp_path} 54 | vagrant init ${box_name} 55 | VAGRANT_LOG=warn vagrant up --provider ${vagrant_provider} 56 | vagrant ssh 57 | # vagrant won't actually tear down the VM 58 | sleep 10 59 | vagrant destroy -f 60 | popd 61 | 62 | vagrant box remove ${box_name} --provider ${box_provider} 63 | -------------------------------------------------------------------------------- /bin/test-box: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -o errexit -o nounset -o pipefail 3 | 4 | if [ "${DEBUG:=false}" = "true" ]; then 5 | set -o xtrace 6 | fi 7 | 8 | usage() { 9 | echo "usage: $(basename $0) BOX_PATH [vmware|virtualbox|parallels]" 10 | echo 11 | echo "Run automated tests against a local *.box file" 12 | } 13 | 14 | args() { 15 | if [ $# -lt 2 ]; then 16 | usage 17 | exit 0 18 | fi 19 | 20 | if [[ ! $2 =~ ^(vmware|virtualbox|parallels)$ ]]; then 21 | echo "$(basename $0): illegal platform $2" 22 | echo "Valid platforms: vmware|virtualbox|parallels" 23 | usage 24 | exit 1 25 | fi 26 | 27 | box_path=$1 28 | box_provider=$2 29 | vagrant_provider=${3:-${box_provider}} 30 | if [ "$box_provider" = "vmware" ]; then 31 | box_provider=vmware_desktop 32 | if [[ $OSTYPE =~ darwin ]]; then 33 | vagrant_provider=vmware_fusion 34 | else 35 | vagrant_provider=vmware_workstation 36 | fi 37 | fi 38 | SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 39 | test_src_path=${SCRIPT_DIR}/../test/*_spec.rb 40 | } 41 | 42 | create_vagrantfile_linux() { 43 | vagrant plugin list | grep vagrant-serverspec && echo "vagrant-serverspec installed" || vagrant plugin install vagrant-serverspec 44 | cat << EOF > ${tmp_path}/Vagrantfile 45 | Vagrant.configure('2') do |config| 46 | config.vm.box = '$box_name' 47 | 48 | config.vm.provision :serverspec do |spec| 49 | spec.pattern = '${test_src_path}' 50 | end 51 | end 52 | EOF 53 | } 54 | 55 | # main 56 | 57 | args "$@" 58 | 59 | box_filename=$(basename "${box_path}") 60 | box_name=${box_filename%.*} 61 | tmp_path=/tmp/boxtest 62 | 63 | rm -rf ${tmp_path} 64 | 65 | vagrant box remove ${box_name} --provider ${box_provider} 2>/dev/null || true 66 | vagrant box add ${box_name} ${box_path} 67 | mkdir -p ${tmp_path} 68 | 69 | ret=0 70 | 71 | pushd ${tmp_path} 72 | create_vagrantfile_linux 73 | VAGRANT_LOG=warn vagrant up --provider ${vagrant_provider} || ret=1 74 | vagrant destroy -f 75 | popd 76 | 77 | vagrant box remove ${box_name} --provider ${box_provider} 78 | 79 | exit $ret 80 | -------------------------------------------------------------------------------- /bin/test-vagrantcloud-box: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -o errexit -o nounset -o pipefail 3 | 4 | if [ "${DEBUG:=false}" = "true" ]; then 5 | set -o xtrace 6 | fi 7 | 8 | usage() { 9 | echo "usage: $(basename $0) BOX_NAME [vmware|virtualbox|parallels]" 10 | echo 11 | echo "Download BOX_NAME from Atlas and run automated tests against it" 12 | } 13 | 14 | args() { 15 | if [ $# -lt 2 ]; then 16 | usage 17 | exit 0 18 | fi 19 | 20 | if [[ ! $2 =~ ^(vmware|virtualbox|parallels)$ ]]; then 21 | echo "$(basename $0): illegal platform $2" 22 | echo "Valid platforms: vmware|virtualbox|parallels" 23 | usage 24 | exit 1 25 | fi 26 | 27 | box_path=$1 28 | box_provider=$2 29 | vagrant_provider=${3:-${box_provider}} 30 | if [ "$box_provider" = "vmware" ]; then 31 | box_provider=vmware_desktop 32 | if [[ $OSTYPE =~ darwin ]]; then 33 | vagrant_provider=vmware_fusion 34 | else 35 | vagrant_provider=vmware_workstation 36 | fi 37 | fi 38 | SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 39 | test_src_path=${SCRIPT_DIR}/../test/*_spec.rb 40 | } 41 | 42 | create_vagrantfile_linux() { 43 | vagrant plugin list | grep vagrant-serverspec && echo "vagrant-serverspec installed" || vagrant plugin install vagrant-serverspec 44 | cat << EOF > $tmp_path/Vagrantfile 45 | Vagrant.configure('2') do |config| 46 | config.vm.box = '$box_path' 47 | 48 | config.vm.provision :serverspec do |spec| 49 | spec.pattern = '$test_src_path' 50 | end 51 | end 52 | EOF 53 | } 54 | 55 | # main 56 | 57 | args "$@" 58 | 59 | box_filename=$(basename "${box_path}") 60 | box_name=${box_filename%.*} 61 | tmp_path=/tmp/vagrantcloudtest 62 | 63 | rm -rf ${tmp_path} 64 | rm -f ~/.ssh/known_hosts 65 | 66 | vagrant box remove ${box_path} --provider ${box_provider} 2>/dev/null || true 67 | vagrant box add ${box_path} --provider=${box_provider} 68 | mkdir -p ${tmp_path} 69 | 70 | pushd ${tmp_path} 71 | create_vagrantfile_linux 72 | VAGRANT_LOG=warn vagrant up --provider=${vagrant_provider} 73 | sleep 10 74 | vagrant destroy -f 75 | popd 76 | 77 | vagrant box remove ${box_path} --provider=${box_provider} 78 | -------------------------------------------------------------------------------- /centos.json: -------------------------------------------------------------------------------- 1 | { 2 | "_comment": "Build with `packer build centos.json`", 3 | "builders": [ 4 | { 5 | "boot_command": [ 6 | " text ks=http://{{ .HTTPIP }}:{{ .HTTPPort}}/{{ user `kickstart` }}" 7 | ], 8 | "disk_size": "{{ user `disk_size` }}", 9 | "guest_os_type": "{{ user `vmware_guest_os_type` }}", 10 | "headless": "{{ user `headless` }}", 11 | "http_directory": "{{ user `http_directory` }}", 12 | "iso_checksum": "{{ user `iso_checksum` }}", 13 | "iso_checksum_type": "{{ user `iso_checksum_type` }}", 14 | "iso_urls": [ 15 | "{{ user `iso_path` }}/{{ user `iso_name` }}", 16 | "{{ user `iso_url` }}" 17 | ], 18 | "output_directory": "output-{{ user `vm_name` }}-vmware-iso", 19 | "shutdown_command": "{{ user `shutdown_command` }}", 20 | "ssh_password": "{{ user `ssh_password` }}", 21 | "ssh_username": "{{ user `ssh_username` }}", 22 | "ssh_timeout": "10000s", 23 | "tools_upload_flavor": "linux", 24 | "type": "vmware-iso", 25 | "vm_name": "{{ user `vm_name` }}", 26 | "vmx_data": { 27 | "cpuid.coresPerSocket": "1", 28 | "memsize": "{{ user `memory` }}", 29 | "numvcpus": "{{ user `cpus` }}" 30 | }, 31 | "vmx_remove_ethernet_interfaces": true 32 | }, 33 | { 34 | "boot_command": [ 35 | " text ks=http://{{ .HTTPIP }}:{{ .HTTPPort}}/{{ user `kickstart` }}" 36 | ], 37 | "disk_size": "{{ user `disk_size` }}", 38 | "guest_additions_path": "VBoxGuestAdditions_{{.Version}}.iso", 39 | "guest_os_type": "{{ user `virtualbox_guest_os_type` }}", 40 | "hard_drive_interface": "sata", 41 | "headless": "{{ user `headless` }}", 42 | "http_directory": "{{ user `http_directory` }}", 43 | "iso_checksum": "{{ user `iso_checksum` }}", 44 | "iso_checksum_type": "{{ user `iso_checksum_type` }}", 45 | "iso_urls": [ 46 | "{{ user `iso_path` }}/{{ user `iso_name` }}", 47 | "{{ user `iso_url` }}" 48 | ], 49 | "output_directory": "output-{{ user `vm_name` }}-virtualbox-iso", 50 | "shutdown_command": "{{ user `shutdown_command` }}", 51 | "ssh_password": "{{ user `ssh_password` }}", 52 | "ssh_username": "{{ user `ssh_username` }}", 53 | "ssh_timeout": "10000s", 54 | "type": "virtualbox-iso", 55 | "vboxmanage": [ 56 | [ 57 | "modifyvm", "{{.Name}}", "--memory", "{{ user `memory` }}" 58 | ], 59 | [ 60 | "modifyvm", "{{.Name}}", "--cpus", "{{ user `cpus` }}" 61 | ], 62 | [ 63 | "modifyvm", "{{.Name}}", "--paravirtprovider", "{{ user `virtualbox_paravirtprovider` }}" 64 | ], 65 | [ 66 | "modifyvm", "{{.Name}}", "--nictype1", "{{ user `virtualbox_nictype` }}" 67 | ] 68 | ], 69 | "virtualbox_version_file": ".vbox_version", 70 | "vm_name": "{{ user `vm_name` }}" 71 | }, 72 | { 73 | "boot_command": [ 74 | " text ks=http://{{ .HTTPIP }}:{{ .HTTPPort}}/{{ user `kickstart` }}" 75 | ], 76 | "disk_size": "{{ user `disk_size` }}", 77 | "guest_os_type": "{{ user `parallels_guest_os_type` }}", 78 | "http_directory": "{{ user `http_directory` }}", 79 | "iso_checksum": "{{ user `iso_checksum` }}", 80 | "iso_checksum_type": "{{ user `iso_checksum_type` }}", 81 | "iso_urls": [ 82 | "{{ user `iso_path` }}/{{ user `iso_name` }}", 83 | "{{ user `iso_url` }}" 84 | ], 85 | "output_directory": "output-{{ user `vm_name` }}-parallels-iso", 86 | "parallels_tools_flavor": "lin", 87 | "prlctl": [ 88 | [ 89 | "set", "{{.Name}}", "--memsize", "{{ user `memory` }}" 90 | ], 91 | [ 92 | "set", "{{.Name}}", "--cpus", "{{ user `cpus` }}" 93 | ] 94 | ], 95 | "shutdown_command": "{{ user `shutdown_command` }}", 96 | "ssh_password": "{{ user `ssh_password` }}", 97 | "ssh_username": "{{ user `ssh_username` }}", 98 | "ssh_timeout": "10000s", 99 | "type": "parallels-iso", 100 | "vm_name": "{{ user `vm_name` }}" 101 | } 102 | ], 103 | "post-processors": [ 104 | { 105 | "keep_input_artifact": false, 106 | "output": "box/{{.Provider}}/{{user `vm_name`}}-{{user `version`}}.box", 107 | "type": "vagrant", 108 | "vagrantfile_template": "{{ user `vagrantfile_template` }}" 109 | } 110 | ], 111 | "provisioners": [ 112 | { 113 | "environment_vars": [ 114 | "CLEANUP_BUILD_TOOLS={{user `cleanup_build_tools`}}", 115 | "DESKTOP={{user `desktop`}}", 116 | "UPDATE={{user `update`}}", 117 | "INSTALL_VAGRANT_KEY={{user `install_vagrant_key`}}", 118 | "SSH_USERNAME={{user `ssh_username`}}", 119 | "SSH_PASSWORD={{user `ssh_password`}}", 120 | "http_proxy={{user `http_proxy`}}", 121 | "https_proxy={{user `https_proxy`}}", 122 | "ftp_proxy={{user `ftp_proxy`}}", 123 | "rsync_proxy={{user `rsync_proxy`}}", 124 | "no_proxy={{user `no_proxy`}}" 125 | ], 126 | "execute_command": "echo 'vagrant' | {{.Vars}} sudo -E -S bash '{{.Path}}'", 127 | "scripts": [ 128 | "script/update.sh" 129 | ], 130 | "type": "shell", 131 | "expect_disconnect": "true" 132 | }, 133 | { 134 | "environment_vars": [ 135 | "CLEANUP_BUILD_TOOLS={{user `cleanup_build_tools`}}", 136 | "DESKTOP={{user `desktop`}}", 137 | "UPDATE={{user `update`}}", 138 | "INSTALL_VAGRANT_KEY={{user `install_vagrant_key`}}", 139 | "SSH_USERNAME={{user `ssh_username`}}", 140 | "SSH_PASSWORD={{user `ssh_password`}}", 141 | "http_proxy={{user `http_proxy`}}", 142 | "https_proxy={{user `https_proxy`}}", 143 | "ftp_proxy={{user `ftp_proxy`}}", 144 | "rsync_proxy={{user `rsync_proxy`}}", 145 | "no_proxy={{user `no_proxy`}}" 146 | ], 147 | "execute_command": "echo 'vagrant' | {{.Vars}} sudo -E -S bash '{{.Path}}'", 148 | "scripts": [ 149 | "script/fix-slow-dns.sh", 150 | "script/sshd.sh", 151 | "script/vagrant.sh", 152 | "script/desktop.sh", 153 | "script/vmware.sh", 154 | "script/virtualbox.sh", 155 | "script/parallels.sh", 156 | "script/motd.sh", 157 | "custom-script.sh", 158 | "script/cleanup.sh" 159 | ], 160 | "type": "shell", 161 | "pause_before": "10s" 162 | } 163 | ], 164 | "variables": { 165 | "cleanup_build_tools": "false", 166 | "cpus": "1", 167 | "desktop": "false", 168 | "disk_size": "65536", 169 | "ftp_proxy": "{{env `ftp_proxy`}}", 170 | "headless": "", 171 | "http_directory": "kickstart/centos7", 172 | "http_proxy": "{{env `http_proxy`}}", 173 | "https_proxy": "{{env `https_proxy`}}", 174 | "install_vagrant_key": "true", 175 | "iso_checksum": "ec7500d4b006702af6af023b1f8f1b890b6c7ee54400bb98cef968b883cd6546", 176 | "iso_checksum_type": "sha256", 177 | "iso_name": "CentOS-7-x86_64-DVD-1708.iso", 178 | "iso_path": "iso", 179 | "iso_url": "http://mirrors.kernel.org/centos/7.4.1708/isos/x86_64/CentOS-7-x86_64-DVD-1708.iso", 180 | "kickstart": "ks.cfg", 181 | "memory": "512", 182 | "no_proxy": "{{env `no_proxy`}}", 183 | "parallels_guest_os_type": "centos", 184 | "rsync_proxy": "{{env `rsync_proxy`}}", 185 | "shutdown_command": "echo 'vagrant'|sudo -S shutdown -P now", 186 | "ssh_password": "vagrant", 187 | "ssh_username": "vagrant", 188 | "update": "false", 189 | "vagrantfile_template": "", 190 | "version": "0.0.99", 191 | "virtualbox_guest_os_type": "RedHat_64", 192 | "virtualbox_paravirtprovider": "default", 193 | "virtualbox_nictype": "virtio", 194 | "vm_name": "centos7", 195 | "vmware_guest_os_type": "centos-64" 196 | } 197 | } 198 | -------------------------------------------------------------------------------- /centos6-desktop.json: -------------------------------------------------------------------------------- 1 | { 2 | "_comment": "Build with `packer build -var-file=centos6-desktop.json centos.json`", 3 | "vm_name": "centos6-desktop", 4 | "cpus": "1", 5 | "disk_size": "65536", 6 | "http_directory": "kickstart/centos6-desktop", 7 | "iso_checksum": "a68e46970678d4d297d46086ae2efdd3e994322d6d862ff51dcce25a0759e41c", 8 | "iso_checksum_type": "sha256", 9 | "iso_name": "CentOS-6.10-x86_64-bin-DVD1.iso", 10 | "iso_url": "https://mirrors.edge.kernel.org/centos/6.10/isos/x86_64/CentOS-6.10-x86_64-bin-DVD1.iso", 11 | "memory": "1024", 12 | "vagrantfile_template": "tpl/vagrantfile-centos6-desktop.tpl" 13 | } 14 | -------------------------------------------------------------------------------- /centos6.json: -------------------------------------------------------------------------------- 1 | { 2 | "_comment": "Build with `packer build -var-file=centos6.json centos.json`", 3 | "vm_name": "centos6", 4 | "cpus": "1", 5 | "disk_size": "65536", 6 | "http_directory": "kickstart/centos6", 7 | "iso_checksum": "a68e46970678d4d297d46086ae2efdd3e994322d6d862ff51dcce25a0759e41c", 8 | "iso_checksum_type": "sha256", 9 | "iso_name": "CentOS-6.10-x86_64-bin-DVD1.iso", 10 | "iso_url": "https://mirrors.edge.kernel.org/centos/6.10/isos/x86_64/CentOS-6.10-x86_64-bin-DVD1.iso", 11 | "memory": "512" 12 | } 13 | -------------------------------------------------------------------------------- /centos7-desktop.json: -------------------------------------------------------------------------------- 1 | { 2 | "_comment": "Build with `packer build -var-file=centos7-desktop.json centos.json`", 3 | "vm_name": "centos7-desktop", 4 | "cpus": "1", 5 | "desktop": "true", 6 | "disk_size": "130048", 7 | "http_directory": "kickstart/centos7-desktop", 8 | "iso_checksum": "6d44331cc4f6c506c7bbe9feb8468fad6c51a88ca1393ca6b8b486ea04bec3c1", 9 | "iso_checksum_type": "sha256", 10 | "iso_name": "CentOS-7-x86_64-DVD-1810.iso", 11 | "iso_url": "https://mirrors.edge.kernel.org/centos/7.6.1810/isos/x86_64/CentOS-7-x86_64-DVD-1810.iso", 12 | "memory": "1024", 13 | "paralles_guest_os_type": "centos7", 14 | "vagrantfile_template": "tpl/vagrantfile-centos7-desktop.tpl" 15 | } 16 | -------------------------------------------------------------------------------- /centos7.json: -------------------------------------------------------------------------------- 1 | { 2 | "_comment": "Build with `packer build -var-file=centos7.json centos.json`", 3 | "vm_name": "centos7", 4 | "cpus": "1", 5 | "disk_size": "65536", 6 | "http_directory": "kickstart/centos7", 7 | "iso_checksum": "6d44331cc4f6c506c7bbe9feb8468fad6c51a88ca1393ca6b8b486ea04bec3c1", 8 | "iso_checksum_type": "sha256", 9 | "iso_name": "CentOS-7-x86_64-DVD-1810.iso", 10 | "iso_url": "https://mirrors.edge.kernel.org/centos/7.6.1810/isos/x86_64/CentOS-7-x86_64-DVD-1810.iso", 11 | "memory": "512", 12 | "parallels_guest_os_type": "centos7" 13 | } 14 | -------------------------------------------------------------------------------- /centos8-desktop.json: -------------------------------------------------------------------------------- 1 | { 2 | "_comment": "Build with `packer build -var-file=centos8-desktop.json centos.json`", 3 | "vm_name": "centos8-desktop", 4 | "cpus": "1", 5 | "desktop": "true", 6 | "disk_size": "130048", 7 | "http_directory": "kickstart/centos8-desktop", 8 | "iso_checksum": "aaf9d4b3071c16dbbda01dfe06085e5d0fdac76df323e3bbe87cce4318052247", 9 | "iso_checksum_type": "sha256", 10 | "iso_name": "CentOS-8.3.2011-x86_64-dvd1.iso", 11 | "iso_url": "https://mirrors.edge.kernel.org/centos/8.3.2011/isos/x86_64/CentOS-8.3.2011-x86_64-dvd1.iso", 12 | "memory": "1024", 13 | "paralles_guest_os_type": "centos8", 14 | "vagrantfile_template": "tpl/vagrantfile-centos8-desktop.tpl" 15 | } 16 | -------------------------------------------------------------------------------- /centos8.json: -------------------------------------------------------------------------------- 1 | { 2 | "_comment": "Build with `packer build -var-file=centos8.json centos.json`", 3 | "vm_name": "centos8", 4 | "cpus": "1", 5 | "disk_size": "65536", 6 | "http_directory": "kickstart/centos8", 7 | "iso_checksum": "aaf9d4b3071c16dbbda01dfe06085e5d0fdac76df323e3bbe87cce4318052247", 8 | "iso_checksum_type": "sha256", 9 | "iso_name": "CentOS-8.3.2011-x86_64-dvd1.iso", 10 | "iso_url": "https://mirrors.edge.kernel.org/centos/8.3.2011/isos/x86_64/CentOS-8.3.2011-x86_64-dvd1.iso", 11 | "memory": "1024", 12 | "parallels_guest_os_type": "centos8" 13 | } 14 | -------------------------------------------------------------------------------- /custom-script.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -eux 4 | 5 | # Sample custom configuration script - add your own commands here 6 | # to add some additional commands for your environment 7 | # 8 | # For example: 9 | # yum install -y curl wget git tmux firefox xvfb 10 | -------------------------------------------------------------------------------- /eol/.gitignore: -------------------------------------------------------------------------------- 1 | packer_cache/ 2 | output-* 3 | *.box 4 | *.tar.gz 5 | iso 6 | crash.log 7 | tmp 8 | .vagrant/ 9 | *.swp 10 | Makefile.local 11 | box/ 12 | .tmpatlas/ 13 | iso/ 14 | 15 | .DS_Store 16 | .bundle 17 | -------------------------------------------------------------------------------- /eol/centos5-desktop.json: -------------------------------------------------------------------------------- 1 | { 2 | "_comment": "Build with `packer build centos5-desktop.json`", 3 | "builders": [ 4 | { 5 | "boot_command": [ 6 | " text ks=http://{{ .HTTPIP }}:{{ .HTTPPort}}/{{ user `kickstart` }}" 7 | ], 8 | "disk_size": "{{ user `disk_size` }}", 9 | "guest_os_type": "{{ user `vmware_guest_os_type` }}", 10 | "headless": "{{ user `headless` }}", 11 | "http_directory": "{{ user `http_directory` }}", 12 | "iso_checksum": "{{ user `iso_checksum` }}", 13 | "iso_checksum_type": "{{ user `iso_checksum_type` }}", 14 | "iso_urls": [ 15 | "{{ user `iso_path` }}/{{ user `iso_name` }}", 16 | "{{ user `iso_url` }}" 17 | ], 18 | "output_directory": "output-{{ user `vm_name` }}-vmware-iso", 19 | "shutdown_command": "{{ user `shutdown_command` }}", 20 | "ssh_password": "{{ user `ssh_password` }}", 21 | "ssh_username": "{{ user `ssh_username` }}", 22 | "ssh_timeout": "10000s", 23 | "tools_upload_flavor": "linux", 24 | "type": "vmware-iso", 25 | "vm_name": "{{ user `vm_name` }}", 26 | "vmx_data": { 27 | "cpuid.coresPerSocket": "1", 28 | "memsize": "{{ user `memory` }}", 29 | "numvcpus": "{{ user `cpus` }}" 30 | }, 31 | "vmx_remove_ethernet_interfaces": true 32 | }, 33 | { 34 | "boot_command": [ 35 | " text ks=http://{{ .HTTPIP }}:{{ .HTTPPort}}/{{ user `kickstart` }}" 36 | ], 37 | "disk_size": "{{ user `disk_size` }}", 38 | "guest_additions_path": "VBoxGuestAdditions_{{.Version}}.iso", 39 | "guest_os_type": "{{ user `virtualbox_guest_os_type` }}", 40 | "hard_drive_interface": "sata", 41 | "headless": "{{ user `headless` }}", 42 | "http_directory": "{{ user `http_directory` }}", 43 | "iso_checksum": "{{ user `iso_checksum` }}", 44 | "iso_checksum_type": "{{ user `iso_checksum_type` }}", 45 | "iso_urls": [ 46 | "{{ user `iso_path` }}/{{ user `iso_name` }}", 47 | "{{ user `iso_url` }}" 48 | ], 49 | "output_directory": "output-{{ user `vm_name` }}-virtualbox-iso", 50 | "shutdown_command": "{{ user `shutdown_command` }}", 51 | "ssh_password": "{{ user `ssh_password` }}", 52 | "ssh_username": "{{ user `ssh_username` }}", 53 | "ssh_timeout": "10000s", 54 | "type": "virtualbox-iso", 55 | "vboxmanage": [ 56 | [ 57 | "modifyvm", "{{.Name}}", "--memory", "{{ user `memory` }}" 58 | ], 59 | [ 60 | "modifyvm", "{{.Name}}", "--cpus", "{{ user `cpus` }}" 61 | ], 62 | [ 63 | "modifyvm", "{{.Name}}", "--paravirtprovider", "{{ user `virtualbox_paravirtprovider` }}" 64 | ], 65 | [ 66 | "modifyvm", "{{.Name}}", "--nictype1", "{{ user `virtualbox_nictype` }}" 67 | ] 68 | ], 69 | "virtualbox_version_file": ".vbox_version", 70 | "vm_name": "{{ user `vm_name` }}" 71 | }, 72 | { 73 | "boot_command": [ 74 | " text ks=http://{{ .HTTPIP }}:{{ .HTTPPort}}/{{ user `kickstart` }}" 75 | ], 76 | "disk_size": "{{ user `disk_size` }}", 77 | "guest_os_type": "{{ user `parallels_guest_os_type` }}", 78 | "http_directory": "{{ user `http_directory` }}", 79 | "iso_checksum": "{{ user `iso_checksum` }}", 80 | "iso_checksum_type": "{{ user `iso_checksum_type` }}", 81 | "iso_urls": [ 82 | "{{ user `iso_path` }}/{{ user `iso_name` }}", 83 | "{{ user `iso_url` }}" 84 | ], 85 | "output_directory": "output-{{ user `vm_name` }}-parallels-iso", 86 | "parallels_tools_flavor": "lin", 87 | "prlctl": [ 88 | [ 89 | "set", "{{.Name}}", "--memsize", "{{ user `memory` }}" 90 | ], 91 | [ 92 | "set", "{{.Name}}", "--cpus", "{{ user `cpus` }}" 93 | ] 94 | ], 95 | "shutdown_command": "{{ user `shutdown_command` }}", 96 | "ssh_password": "{{ user `ssh_password` }}", 97 | "ssh_username": "{{ user `ssh_username` }}", 98 | "ssh_timeout": "10000s", 99 | "type": "parallels-iso", 100 | "vm_name": "{{ user `vm_name` }}" 101 | } 102 | ], 103 | "post-processors": [ 104 | { 105 | "keep_input_artifact": false, 106 | "output": "box/{{.Provider}}/{{user `vm_name`}}-{{user `version`}}.box", 107 | "type": "vagrant", 108 | "vagrantfile_template": "{{ user `vagrantfile_template` }}" 109 | } 110 | ], 111 | "provisioners": [ 112 | { 113 | "destination": "/tmp", 114 | "source": "kickstart/centos5/yum.repos.d/", 115 | "type": "file" 116 | }, 117 | { 118 | "execute_command": "echo 'vagrant' | {{.Vars}} sudo -E -S bash '{{.Path}}'", 119 | "inline": [ 120 | "mv -f /tmp/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo", 121 | "mv -f /tmp/CentOS-fasttrack.repo /etc/yum.repos.d/CentOS-fasttrack.repo", 122 | "mv -f /tmp/CentOS-Sources.repo /etc/yum.repos.d/CentOS-Sources.repo", 123 | "mv -f /tmp/CentOS-Vault.repo /etc/yum.repos.d/CentOS-Vault.repo" 124 | ], 125 | "type": "shell" 126 | }, 127 | { 128 | "environment_vars": [ 129 | "CLEANUP_BUILD_TOOLS={{user `cleanup_build_tools`}}", 130 | "DESKTOP={{user `desktop`}}", 131 | "UPDATE={{user `update`}}", 132 | "INSTALL_VAGRANT_KEY={{user `install_vagrant_key`}}", 133 | "SSH_USERNAME={{user `ssh_username`}}", 134 | "SSH_PASSWORD={{user `ssh_password`}}", 135 | "http_proxy={{user `http_proxy`}}", 136 | "https_proxy={{user `https_proxy`}}", 137 | "ftp_proxy={{user `ftp_proxy`}}", 138 | "rsync_proxy={{user `rsync_proxy`}}", 139 | "no_proxy={{user `no_proxy`}}" 140 | ], 141 | "execute_command": "echo 'vagrant' | {{.Vars}} sudo -E -S bash '{{.Path}}'", 142 | "scripts": [ 143 | "script/fix-slow-dns.sh", 144 | "script/sshd.sh", 145 | "script/update.sh", 146 | "script/vagrant.sh", 147 | "script/desktop.sh", 148 | "script/vmware.sh", 149 | "script/virtualbox.sh", 150 | "script/parallels.sh", 151 | "script/motd.sh", 152 | "custom-script.sh", 153 | "script/cleanup.sh" 154 | ], 155 | "type": "shell" 156 | } 157 | ], 158 | "variables": { 159 | "cleanup_build_tools": "false", 160 | "cpus": "1", 161 | "desktop": "true", 162 | "disk_size": "65536", 163 | "ftp_proxy": "{{env `ftp_proxy`}}", 164 | "headless": "", 165 | "http_directory": "kickstart/centos5-desktop", 166 | "http_proxy": "{{env `http_proxy`}}", 167 | "https_proxy": "{{env `https_proxy`}}", 168 | "install_vagrant_key": "true", 169 | "iso_checksum": "b6eb0565b636513b90663ff01c6ec4da5058baff0d7d4007d187be997dd985f8", 170 | "iso_checksum_type": "sha256", 171 | "iso_name": "CentOS-5.11-x86_64-bin-DVD-1of2.iso", 172 | "iso_path": "iso", 173 | "iso_url": "http://archive.kernel.org/centos-vault/5.11/isos/x86_64/CentOS-5.11-x86_64-bin-DVD-1of2.iso", 174 | "kickstart": "ks.cfg", 175 | "memory": "512", 176 | "no_proxy": "{{env `no_proxy`}}", 177 | "parallels_guest_os_type": "centos", 178 | "rsync_proxy": "{{env `rsync_proxy`}}", 179 | "shutdown_command": "echo 'vagrant' | sudo -S /sbin/halt -h -p", 180 | "ssh_password": "vagrant", 181 | "ssh_username": "vagrant", 182 | "update": "false", 183 | "vagrantfile_template": "tpl/vagrantfile-centos511-desktop.tpl", 184 | "version": "0.0.99", 185 | "virtualbox_guest_os_type": "RedHat_64", 186 | "virtualbox_paravirtprovider": "none", 187 | "virtualbox_nictype": "Am79C973", 188 | "vm_name": "centos5-desktop", 189 | "vmware_guest_os_type": "centos-64" 190 | } 191 | } 192 | -------------------------------------------------------------------------------- /eol/centos5.json: -------------------------------------------------------------------------------- 1 | { 2 | "_comment": "Build with `packer build centos5.json`", 3 | "builders": [ 4 | { 5 | "boot_command": [ 6 | " text ks=http://{{ .HTTPIP }}:{{ .HTTPPort}}/{{ user `kickstart` }}" 7 | ], 8 | "disk_size": "{{ user `disk_size` }}", 9 | "guest_os_type": "{{ user `vmware_guest_os_type` }}", 10 | "headless": "{{ user `headless` }}", 11 | "http_directory": "{{ user `http_directory` }}", 12 | "iso_checksum": "{{ user `iso_checksum` }}", 13 | "iso_checksum_type": "{{ user `iso_checksum_type` }}", 14 | "iso_urls": [ 15 | "{{ user `iso_path` }}/{{ user `iso_name` }}", 16 | "{{ user `iso_url` }}" 17 | ], 18 | "output_directory": "output-{{ user `vm_name` }}-vmware-iso", 19 | "shutdown_command": "{{ user `shutdown_command` }}", 20 | "ssh_password": "{{ user `ssh_password` }}", 21 | "ssh_username": "{{ user `ssh_username` }}", 22 | "ssh_timeout": "10000s", 23 | "tools_upload_flavor": "linux", 24 | "type": "vmware-iso", 25 | "vm_name": "{{ user `vm_name` }}", 26 | "vmx_data": { 27 | "cpuid.coresPerSocket": "1", 28 | "memsize": "{{ user `memory` }}", 29 | "numvcpus": "{{ user `cpus` }}" 30 | }, 31 | "vmx_remove_ethernet_interfaces": true 32 | }, 33 | { 34 | "boot_command": [ 35 | " text ks=http://{{ .HTTPIP }}:{{ .HTTPPort}}/{{ user `kickstart` }}" 36 | ], 37 | "disk_size": "{{ user `disk_size` }}", 38 | "guest_additions_path": "VBoxGuestAdditions_{{.Version}}.iso", 39 | "guest_os_type": "{{ user `virtualbox_guest_os_type` }}", 40 | "hard_drive_interface": "sata", 41 | "headless": "{{ user `headless` }}", 42 | "http_directory": "{{ user `http_directory` }}", 43 | "iso_checksum": "{{ user `iso_checksum` }}", 44 | "iso_checksum_type": "{{ user `iso_checksum_type` }}", 45 | "iso_urls": [ 46 | "{{ user `iso_path` }}/{{ user `iso_name` }}", 47 | "{{ user `iso_url` }}" 48 | ], 49 | "output_directory": "output-{{ user `vm_name` }}-virtualbox-iso", 50 | "shutdown_command": "{{ user `shutdown_command` }}", 51 | "ssh_password": "{{ user `ssh_password` }}", 52 | "ssh_username": "{{ user `ssh_username` }}", 53 | "ssh_timeout": "10000s", 54 | "type": "virtualbox-iso", 55 | "vboxmanage": [ 56 | [ 57 | "modifyvm", "{{.Name}}", "--memory", "{{ user `memory` }}" 58 | ], 59 | [ 60 | "modifyvm", "{{.Name}}", "--cpus", "{{ user `cpus` }}" 61 | ], 62 | [ 63 | "modifyvm", "{{.Name}}", "--paravirtprovider", "{{ user `virtualbox_paravirtprovider` }}" 64 | ], 65 | [ 66 | "modifyvm", "{{.Name}}", "--nictype1", "{{ user `virtualbox_nictype` }}" 67 | ] 68 | ], 69 | "virtualbox_version_file": ".vbox_version", 70 | "vm_name": "{{ user `vm_name` }}" 71 | }, 72 | { 73 | "boot_command": [ 74 | " text ks=http://{{ .HTTPIP }}:{{ .HTTPPort}}/{{ user `kickstart` }}" 75 | ], 76 | "disk_size": "{{ user `disk_size` }}", 77 | "guest_os_type": "{{ user `parallels_guest_os_type` }}", 78 | "http_directory": "{{ user `http_directory` }}", 79 | "iso_checksum": "{{ user `iso_checksum` }}", 80 | "iso_checksum_type": "{{ user `iso_checksum_type` }}", 81 | "iso_urls": [ 82 | "{{ user `iso_path` }}/{{ user `iso_name` }}", 83 | "{{ user `iso_url` }}" 84 | ], 85 | "output_directory": "output-{{ user `vm_name` }}-parallels-iso", 86 | "parallels_tools_flavor": "lin", 87 | "prlctl": [ 88 | [ 89 | "set", "{{.Name}}", "--memsize", "{{ user `memory` }}" 90 | ], 91 | [ 92 | "set", "{{.Name}}", "--cpus", "{{ user `cpus` }}" 93 | ] 94 | ], 95 | "shutdown_command": "{{ user `shutdown_command` }}", 96 | "ssh_password": "{{ user `ssh_password` }}", 97 | "ssh_username": "{{ user `ssh_username` }}", 98 | "ssh_timeout": "10000s", 99 | "type": "parallels-iso", 100 | "vm_name": "{{ user `vm_name` }}" 101 | } 102 | ], 103 | "post-processors": [ 104 | { 105 | "keep_input_artifact": false, 106 | "output": "box/{{.Provider}}/{{user `vm_name`}}-{{user `version`}}.box", 107 | "type": "vagrant", 108 | "vagrantfile_template": "{{ user `vagrantfile_template` }}" 109 | } 110 | ], 111 | "provisioners": [ 112 | { 113 | "destination": "/tmp", 114 | "source": "kickstart/centos5/yum.repos.d/", 115 | "type": "file" 116 | }, 117 | { 118 | "execute_command": "echo 'vagrant' | {{.Vars}} sudo -E -S bash '{{.Path}}'", 119 | "inline": [ 120 | "mv -f /tmp/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo", 121 | "mv -f /tmp/CentOS-fasttrack.repo /etc/yum.repos.d/CentOS-fasttrack.repo", 122 | "mv -f /tmp/CentOS-Sources.repo /etc/yum.repos.d/CentOS-Sources.repo", 123 | "mv -f /tmp/CentOS-Vault.repo /etc/yum.repos.d/CentOS-Vault.repo" 124 | ], 125 | "type": "shell" 126 | }, 127 | { 128 | "environment_vars": [ 129 | "CLEANUP_BUILD_TOOLS={{user `cleanup_build_tools`}}", 130 | "DESKTOP={{user `desktop`}}", 131 | "UPDATE={{user `update`}}", 132 | "INSTALL_VAGRANT_KEY={{user `install_vagrant_key`}}", 133 | "SSH_USERNAME={{user `ssh_username`}}", 134 | "SSH_PASSWORD={{user `ssh_password`}}", 135 | "http_proxy={{user `http_proxy`}}", 136 | "https_proxy={{user `https_proxy`}}", 137 | "ftp_proxy={{user `ftp_proxy`}}", 138 | "rsync_proxy={{user `rsync_proxy`}}", 139 | "no_proxy={{user `no_proxy`}}" 140 | ], 141 | "execute_command": "echo 'vagrant' | {{.Vars}} sudo -E -S bash '{{.Path}}'", 142 | "scripts": [ 143 | "script/fix-slow-dns.sh", 144 | "script/sshd.sh", 145 | "script/update.sh", 146 | "script/vagrant.sh", 147 | "script/desktop.sh", 148 | "script/vmware.sh", 149 | "script/virtualbox.sh", 150 | "script/parallels.sh", 151 | "script/motd.sh", 152 | "custom-script.sh", 153 | "script/cleanup.sh" 154 | ], 155 | "type": "shell" 156 | } 157 | ], 158 | "variables": { 159 | "cleanup_build_tools": "false", 160 | "cpus": "1", 161 | "desktop": "false", 162 | "disk_size": "65536", 163 | "ftp_proxy": "{{env `ftp_proxy`}}", 164 | "headless": "", 165 | "http_directory": "kickstart/centos5", 166 | "http_proxy": "{{env `http_proxy`}}", 167 | "https_proxy": "{{env `https_proxy`}}", 168 | "install_vagrant_key": "true", 169 | "iso_checksum": "b6eb0565b636513b90663ff01c6ec4da5058baff0d7d4007d187be997dd985f8", 170 | "iso_checksum_type": "sha256", 171 | "iso_name": "CentOS-5.11-x86_64-bin-DVD-1of2.iso", 172 | "iso_path": "iso", 173 | "iso_url": "http://archive.kernel.org/centos-vault/5.11/isos/x86_64/CentOS-5.11-x86_64-bin-DVD-1of2.iso", 174 | "kickstart": "ks.cfg", 175 | "memory": "512", 176 | "no_proxy": "{{env `no_proxy`}}", 177 | "parallels_guest_os_type": "centos", 178 | "rsync_proxy": "{{env `rsync_proxy`}}", 179 | "shutdown_command": "echo 'vagrant' | sudo -S /sbin/halt -h -p", 180 | "ssh_password": "vagrant", 181 | "ssh_username": "vagrant", 182 | "update": "false", 183 | "vagrantfile_template": "", 184 | "version": "0.0.99", 185 | "virtualbox_guest_os_type": "RedHat_64", 186 | "virtualbox_paravirtprovider": "default", 187 | "virtualbox_nictype": "virtio", 188 | "vm_name": "centos5", 189 | "vmware_guest_os_type": "centos-64" 190 | } 191 | } 192 | -------------------------------------------------------------------------------- /eol/custom-script.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -eux 4 | 5 | # Sample custom configuration script - add your own commands here 6 | # to add some additional commands for your environment 7 | # 8 | # For example: 9 | # yum install -y curl wget git tmux firefox xvfb 10 | -------------------------------------------------------------------------------- /eol/kickstart/centos5-desktop/ks.cfg: -------------------------------------------------------------------------------- 1 | # CentOS 5.x kickstart file - ks5-desktop.cfg 2 | # 3 | # For more information on kickstart syntax and commands, refer to the 4 | # CentOS Installation Guide: 5 | # http://www.centos.org/docs/5/html/Installation_Guide-en-US/ch-kickstart2.html 6 | # 7 | # For testing, you can fire up a local http server temporarily. 8 | # cd to the directory where this ks.cfg file resides and run the following: 9 | # $ python -m SimpleHTTPServer 10 | # You don't have to restart the server every time you make changes. Python 11 | # will reload the file from disk every time. As long as you save your changes 12 | # they will be reflected in the next HTTP download. Then to test with 13 | # a PXE boot server, enter the following on the PXE boot prompt: 14 | # > linux text ks=http://:8000/ks.cfg 15 | 16 | # Required settings 17 | lang en_US.UTF-8 18 | keyboard us 19 | rootpw vagrant 20 | authconfig --enableshadow --enablemd5 21 | timezone UTC 22 | 23 | # Optional settings 24 | install 25 | cdrom 26 | user --name=vagrant --password vagrant 27 | network --bootproto=dhcp 28 | firewall --disabled 29 | selinux --permissive 30 | bootloader --location=mbr 31 | text 32 | xconfig --startxonboot --resolution=1024x768 --depth=24 33 | zerombr 34 | clearpart --all --initlabel 35 | autopart 36 | firstboot --disabled 37 | reboot 38 | 39 | %packages --nobase --ignoremissing --excludedocs 40 | @Administration Tools 41 | @Dialup Networking Support 42 | @Editors 43 | @GNOME Desktop Environment 44 | @Games and Entertainment 45 | @Graphical Internet 46 | @Graphics 47 | @Mail Server 48 | @Network Servers 49 | @Office/Productivity 50 | @Printing Support 51 | @Server Configuration Tools 52 | @Sound and Video 53 | @System Tools 54 | @Text-based Internet 55 | @Web Server 56 | @X Window System 57 | @Yum Utilities 58 | 59 | # vagrant needs this to copy initial files via scp 60 | openssh-clients 61 | openssh-server 62 | # Prerequisites for installing VMware Tools or VirtualBox guest additions. 63 | # Put in kickstart to ensure first version installed is from install disk, 64 | # not latest from a mirror. 65 | kernel-headers 66 | kernel-devel 67 | gcc 68 | make 69 | perl 70 | curl 71 | wget 72 | bzip2 73 | # Selinux 74 | policycoreutils 75 | selinux-policy 76 | selinux-policy-targeted 77 | libselinux 78 | libselinux-utils 79 | libselinux-python 80 | # Other stuff 81 | dhclient 82 | sudo 83 | yum 84 | nfs-utils 85 | -fprintd-pam 86 | -intltool 87 | -avahi 88 | -bluez-utils 89 | -dogtail 90 | -kudzu 91 | 92 | # unnecessary firmware 93 | -aic94xx-firmware 94 | -atmel-firmware 95 | -b43-openfwwf 96 | -bfa-firmware 97 | -ipw*-firmware 98 | -irqbalance 99 | -ivtv-firmware 100 | -iwl*-firmware 101 | -libertas-usb8388-firmware 102 | -ql*-firmware 103 | -rt61pci-firmware 104 | -rt73usb-firmware 105 | -xorg-x11-drv-ati-firmware 106 | -zd1211-firmware 107 | 108 | %post 109 | # configure vagrant user in sudoers 110 | echo "vagrant ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers 111 | sed -i "s/^\(.*requiretty\)$/#\1/" /etc/sudoers 112 | # keep proxy settings through sudo 113 | echo 'Defaults env_keep += "HTTP_PROXY HTTPS_PROXY FTP_PROXY RSYNC_PROXY NO_PROXY"' >> /etc/sudoers 114 | -------------------------------------------------------------------------------- /eol/kickstart/centos5/ks.cfg: -------------------------------------------------------------------------------- 1 | # CentOS 5.x kickstart file - ks5.cfg 2 | # 3 | # For more information on kickstart syntax and commands, refer to the 4 | # CentOS Installation Guide: 5 | # http://www.centos.org/docs/5/html/Installation_Guide-en-US/ch-kickstart2.html 6 | # 7 | # For testing, you can fire up a local http server temporarily. 8 | # cd to the directory where this ks.cfg file resides and run the following: 9 | # $ python -m SimpleHTTPServer 10 | # You don't have to restart the server every time you make changes. Python 11 | # will reload the file from disk every time. As long as you save your changes 12 | # they will be reflected in the next HTTP download. Then to test with 13 | # a PXE boot server, enter the following on the PXE boot prompt: 14 | # > linux text ks=http://:8000/ks.cfg 15 | 16 | # Required settings 17 | lang en_US.UTF-8 18 | keyboard us 19 | rootpw vagrant 20 | authconfig --enableshadow --enablemd5 21 | timezone UTC 22 | 23 | # Optional settings 24 | install 25 | cdrom 26 | user --name=vagrant --password vagrant 27 | network --bootproto=dhcp 28 | firewall --disabled 29 | selinux --permissive 30 | bootloader --location=mbr 31 | text 32 | skipx 33 | zerombr 34 | clearpart --all --initlabel 35 | autopart 36 | firstboot --disabled 37 | reboot 38 | 39 | %packages --nobase --ignoremissing --excludedocs 40 | # vagrant needs this to copy initial files via scp 41 | openssh-clients 42 | openssh-server 43 | # Prerequisites for installing VMware Tools or VirtualBox guest additions. 44 | # Put in kickstart to ensure first version installed is from install disk, 45 | # not latest from a mirror. 46 | kernel-headers 47 | kernel-devel 48 | gcc 49 | make 50 | perl 51 | curl 52 | wget 53 | bzip2 54 | # Selinux 55 | policycoreutils 56 | selinux-policy 57 | selinux-policy-targeted 58 | libselinux 59 | libselinux-utils 60 | libselinux-python 61 | # Other stuff 62 | dhclient 63 | sudo 64 | yum 65 | nfs-utils 66 | -fprintd-pam 67 | -intltool 68 | -avahi 69 | -bluez-utils 70 | -dogtail 71 | -kudzu 72 | 73 | # unnecessary firmware 74 | -aic94xx-firmware 75 | -atmel-firmware 76 | -b43-openfwwf 77 | -bfa-firmware 78 | -ipw*-firmware 79 | -irqbalance 80 | -ivtv-firmware 81 | -iwl*-firmware 82 | -libertas-usb8388-firmware 83 | -ql*-firmware 84 | -rt61pci-firmware 85 | -rt73usb-firmware 86 | -xorg-x11-drv-ati-firmware 87 | -zd1211-firmware 88 | 89 | %post 90 | # configure vagrant user in sudoers 91 | echo "vagrant ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers 92 | sed -i "s/^\(.*requiretty\)$/#\1/" /etc/sudoers 93 | # keep proxy settings through sudo 94 | echo 'Defaults env_keep += "HTTP_PROXY HTTPS_PROXY FTP_PROXY RSYNC_PROXY NO_PROXY"' >> /etc/sudoers 95 | -------------------------------------------------------------------------------- /eol/kickstart/centos5/yum.repos.d/CentOS-Base.repo: -------------------------------------------------------------------------------- 1 | # CentOS-Base.repo 2 | # 3 | # 4 | 5 | [base] 6 | name=CentOS-$releasever - Base 7 | baseurl=http://archive.kernel.org/centos-vault/5.11/os/$basearch/ 8 | gpgcheck=1 9 | gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 10 | 11 | #released updates 12 | [updates] 13 | name=CentOS-$releasever - Updates 14 | baseurl=http://archive.kernel.org/centos-vault/5.11/updates/$basearch/ 15 | gpgcheck=1 16 | gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 17 | 18 | #additional packages that may be useful 19 | [extras] 20 | name=CentOS-$releasever - Extras 21 | baseurl=http://archive.kernel.org/centos-vault/5.11/extras/$basearch/ 22 | gpgcheck=1 23 | gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 24 | 25 | #additional packages that extend functionality of existing packages 26 | [centosplus] 27 | name=CentOS-$releasever - Plus 28 | baseurl=http://archive.kernel.org/centos-vault/5.11/centosplus/$basearch/ 29 | gpgcheck=1 30 | enabled=0 31 | gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 32 | 33 | #contrib - packages by Centos Users 34 | [contrib] 35 | name=CentOS-$releasever - Contrib 36 | baseurl=http://archive.kernel.org/centos-vault/5.11/contrib/$basearch/ 37 | gpgcheck=1 38 | enabled=0 39 | gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 40 | -------------------------------------------------------------------------------- /eol/kickstart/centos5/yum.repos.d/CentOS-Sources.repo: -------------------------------------------------------------------------------- 1 | # CentOS-Sources.repo 2 | # 3 | # 4 | 5 | [base-source] 6 | name=CentOS-$releasever - Base Sources 7 | baseurl=http://archive.kernel.org/centos-vault/5.11/os/Source/ 8 | gpgcheck=1 9 | enabled=0 10 | gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 11 | 12 | #released udpates 13 | [updates-source] 14 | name=CentOS-$releasever - Updates Sources 15 | baseurl=http://archive.kernel.org/centos-vault/5.11/updates/Source/ 16 | gpgcheck=1 17 | enabled=0 18 | gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 19 | 20 | #additional packages that may be useful 21 | [extras-source] 22 | name=CentOS-$releasever - Extras Sources 23 | baseurl=http://archive.kernel.org/centos-vault/5.11/extras/Source/ 24 | gpgcheck=1 25 | enabled=0 26 | gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 27 | 28 | #additional packages that extend functionality of existing packages 29 | [centosplus-source] 30 | name=CentOS-$releasever - Plus Sources 31 | baseurl=http://archive.kernel.org/centos-vault/5.11/centosplus/Source/ 32 | gpgcheck=1 33 | enabled=0 34 | gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 35 | -------------------------------------------------------------------------------- /eol/kickstart/centos5/yum.repos.d/CentOS-Vault.repo: -------------------------------------------------------------------------------- 1 | # CentOS-Vault.repo 2 | # 3 | # 4 | 5 | #---- Packages previously released as 5.10, and its updates 6 | [C5.10-base] 7 | name=CentOS-5.10 - Base 8 | baseurl=http://archive.kernel.org/centos-vault/5.10/os/$basearch/ 9 | gpgcheck=1 10 | gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 11 | enabled=0 12 | 13 | [C5.10-updates] 14 | name=CentOS-5.10 - Updates 15 | baseurl=http://archive.kernel.org/centos-vault/5.10/updates/$basearch/ 16 | gpgcheck=1 17 | gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 18 | enabled=0 19 | 20 | [C5.10-extras] 21 | name=CentOS-5.10 - Extras 22 | baseurl=http://archive.kernel.org/centos-vault/5.10/extras/$basearch/ 23 | gpgcheck=1 24 | gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 25 | enabled=0 26 | 27 | [C5.10-centosplus] 28 | name=CentOS-5.10 - Plus 29 | baseurl=http://archive.kernel.org/centos-vault/5.10/centosplus/$basearch/ 30 | gpgcheck=1 31 | gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 32 | enabled=0 33 | 34 | #---- Packages previously released as 5.9, and its updates 35 | [C5.9-base] 36 | name=CentOS-5.9 - Base 37 | baseurl=http://archive.kernel.org/centos-vault/5.9/os/$basearch/ 38 | gpgcheck=1 39 | gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 40 | enabled=0 41 | 42 | [C5.9-updates] 43 | name=CentOS-5.9 - Updates 44 | baseurl=http://archive.kernel.org/centos-vault/5.9/updates/$basearch/ 45 | gpgcheck=1 46 | gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 47 | enabled=0 48 | 49 | [C5.9-extras] 50 | name=CentOS-5.9 - Extras 51 | baseurl=http://archive.kernel.org/centos-vault/5.9/extras/$basearch/ 52 | gpgcheck=1 53 | gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 54 | enabled=0 55 | 56 | [C5.9-centosplus] 57 | name=CentOS-5.9 - Plus 58 | baseurl=http://archive.kernel.org/centos-vault/5.9/centosplus/$basearch/ 59 | gpgcheck=1 60 | gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 61 | enabled=0 62 | 63 | #---- Packages previously released as 5.8, and its updates 64 | [C5.8-base] 65 | name=CentOS-5.8 - Base 66 | baseurl=http://archive.kernel.org/centos-vault/5.8/os/$basearch/ 67 | gpgcheck=1 68 | gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 69 | enabled=0 70 | 71 | [C5.8-updates] 72 | name=CentOS-5.8 - Updates 73 | baseurl=http://archive.kernel.org/centos-vault/5.8/updates/$basearch/ 74 | gpgcheck=1 75 | gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 76 | enabled=0 77 | 78 | [C5.8-extras] 79 | name=CentOS-5.8 - Extras 80 | baseurl=http://archive.kernel.org/centos-vault/5.8/extras/$basearch/ 81 | gpgcheck=1 82 | gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 83 | enabled=0 84 | 85 | [C5.8-centosplus] 86 | name=CentOS-5.8 - Plus 87 | baseurl=http://archive.kernel.org/centos-vault/5.8/centosplus/$basearch/ 88 | gpgcheck=1 89 | gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 90 | enabled=0 91 | 92 | #---- Packages previously released as 5.7, and its updates 93 | [C5.7-base] 94 | name=CentOS-5.7 - Base 95 | baseurl=http://archive.kernel.org/centos-vault/5.7/os/$basearch/ 96 | gpgcheck=1 97 | gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 98 | enabled=0 99 | 100 | [C5.7-updates] 101 | name=CentOS-5.7 - Updates 102 | baseurl=http://archive.kernel.org/centos-vault/5.7/updates/$basearch/ 103 | gpgcheck=1 104 | gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 105 | enabled=0 106 | 107 | [C5.7-extras] 108 | name=CentOS-5.7 - Extras 109 | baseurl=http://archive.kernel.org/centos-vault/5.7/extras/$basearch/ 110 | gpgcheck=1 111 | gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 112 | enabled=0 113 | 114 | [C5.7-centosplus] 115 | name=CentOS-5.7 - Plus 116 | baseurl=http://archive.kernel.org/centos-vault/5.7/centosplus/$basearch/ 117 | gpgcheck=1 118 | gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 119 | enabled=0 120 | 121 | #---- Packages previously released as 5.6, and its updates 122 | [C5.6-base] 123 | name=CentOS-5.6 - Base 124 | baseurl=http://archive.kernel.org/centos-vault/5.6/os/$basearch/ 125 | gpgcheck=1 126 | gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 127 | enabled=0 128 | 129 | [C5.6-updates] 130 | name=CentOS-5.6 - Updates 131 | baseurl=http://archive.kernel.org/centos-vault/5.6/updates/$basearch/ 132 | gpgcheck=1 133 | gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 134 | enabled=0 135 | 136 | [C5.6-extras] 137 | name=CentOS-5.6 - Extras 138 | baseurl=http://archive.kernel.org/centos-vault/5.6/extras/$basearch/ 139 | gpgcheck=1 140 | gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 141 | enabled=0 142 | 143 | [C5.6-centosplus] 144 | name=CentOS-5.6 - Plus 145 | baseurl=http://archive.kernel.org/centos-vault/5.6/centosplus/$basearch/ 146 | gpgcheck=1 147 | gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 148 | enabled=0 149 | 150 | #---- Packages previously released as 5.5, and its updates 151 | [C5.5-base] 152 | name=CentOS-5.5 - Base 153 | baseurl=http://archive.kernel.org/centos-vault/5.5/os/$basearch/ 154 | gpgcheck=1 155 | gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 156 | enabled=0 157 | 158 | [C5.5-updates] 159 | name=CentOS-5.5 - Updates 160 | baseurl=http://archive.kernel.org/centos-vault/5.5/updates/$basearch/ 161 | gpgcheck=1 162 | gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 163 | enabled=0 164 | 165 | [C5.5-extras] 166 | name=CentOS-5.5 - Extras 167 | baseurl=http://archive.kernel.org/centos-vault/5.5/extras/$basearch/ 168 | gpgcheck=1 169 | gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 170 | enabled=0 171 | 172 | [C5.5-centosplus] 173 | name=CentOS-5.5 - Plus 174 | baseurl=http://archive.kernel.org/centos-vault/5.5/centosplus/$basearch/ 175 | gpgcheck=1 176 | gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 177 | enabled=0 178 | 179 | #---- Packages previously released as 5.4, and its updates 180 | [C5.4-base] 181 | name=CentOS-5.4 - Base 182 | baseurl=http://archive.kernel.org/centos-vault/5.4/os/$basearch/ 183 | gpgcheck=1 184 | gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 185 | enabled=0 186 | 187 | [C5.4-updates] 188 | name=CentOS-5.4 - Updates 189 | baseurl=http://archive.kernel.org/centos-vault/5.4/updates/$basearch/ 190 | gpgcheck=1 191 | gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 192 | enabled=0 193 | 194 | [C5.4-extras] 195 | name=CentOS-5.4 - Extras 196 | baseurl=http://archive.kernel.org/centos-vault/5.4/extras/$basearch/ 197 | gpgcheck=1 198 | gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 199 | enabled=0 200 | 201 | [C5.4-centosplus] 202 | name=CentOS-5.4 - Plus 203 | baseurl=http://archive.kernel.org/centos-vault/5.4/centosplus/$basearch/ 204 | gpgcheck=1 205 | gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 206 | enabled=0 207 | 208 | #---- Packages previously released as 5.3, and its updates 209 | [C5.3-base] 210 | name=CentOS-5.3 - Base 211 | baseurl=http://archive.kernel.org/centos-vault/5.3/os/$basearch/ 212 | gpgcheck=1 213 | gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 214 | enabled=0 215 | 216 | [C5.3-updates] 217 | name=CentOS-5.3 - Updates 218 | baseurl=http://archive.kernel.org/centos-vault/5.3/updates/$basearch/ 219 | gpgcheck=1 220 | gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 221 | enabled=0 222 | 223 | [C5.3-extras] 224 | name=CentOS-5.3 - Extras 225 | baseurl=http://archive.kernel.org/centos-vault/5.3/extras/$basearch/ 226 | gpgcheck=1 227 | gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 228 | enabled=0 229 | 230 | [C5.3-centosplus] 231 | name=CentOS-5.3 - Plus 232 | baseurl=http://archive.kernel.org/centos-vault/5.3/centosplus/$basearch/ 233 | gpgcheck=1 234 | gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 235 | enabled=0 236 | 237 | #---- Packages previously released as 5.2, and its updates 238 | [C5.2-base] 239 | name=CentOS-5.2 - Base 240 | baseurl=http://archive.kernel.org/centos-vault/5.2/os/$basearch/ 241 | gpgcheck=1 242 | gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 243 | enabled=0 244 | 245 | [C5.2-updates] 246 | name=CentOS-5.2 - Updates 247 | baseurl=http://archive.kernel.org/centos-vault/5.2/updates/$basearch/ 248 | gpgcheck=1 249 | gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 250 | enabled=0 251 | 252 | [C5.2-extras] 253 | name=CentOS-5.2 - Extras 254 | baseurl=http://archive.kernel.org/centos-vault/5.2/extras/$basearch/ 255 | gpgcheck=1 256 | gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 257 | enabled=0 258 | 259 | [C5.2-centosplus] 260 | name=CentOS-5.2 - Plus 261 | baseurl=http://archive.kernel.org/centos-vault/5.2/centosplus/$basearch/ 262 | gpgcheck=1 263 | gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 264 | enabled=0 265 | 266 | #---- Packages previously released as 5.1, and its updates 267 | [C5.1-base] 268 | name=CentOS-5.1 - Base 269 | baseurl=http://archive.kernel.org/centos-vault/5.1/os/$basearch/ 270 | gpgcheck=1 271 | gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 272 | enabled=0 273 | 274 | [C5.1-updates] 275 | name=CentOS-5.1 - Updates 276 | baseurl=http://archive.kernel.org/centos-vault/5.1/updates/$basearch/ 277 | gpgcheck=1 278 | gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 279 | enabled=0 280 | 281 | [C5.1-extras] 282 | name=CentOS-5.1 - Extras 283 | baseurl=http://archive.kernel.org/centos-vault/5.1/extras/$basearch/ 284 | gpgcheck=1 285 | gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 286 | enabled=0 287 | 288 | [C5.1-centosplus] 289 | name=CentOS-5.1 - Plus 290 | baseurl=http://archive.kernel.org/centos-vault/5.1/centosplus/$basearch/ 291 | gpgcheck=1 292 | gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 293 | enabled=0 294 | 295 | #---- Packages previously released as 5.0, and its updates 296 | [C5.0-base] 297 | name=CentOS-5.0 - Base 298 | baseurl=http://archive.kernel.org/centos-vault/5.0/os/$basearch/ 299 | gpgcheck=1 300 | gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 301 | enabled=0 302 | 303 | [C5.0-updates] 304 | name=CentOS-5.0 - Updates 305 | baseurl=http://archive.kernel.org/centos-vault/5.0/updates/$basearch/ 306 | gpgcheck=1 307 | gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 308 | enabled=0 309 | 310 | [C5.0-extras] 311 | name=CentOS-5.0 - Extras 312 | baseurl=http://archive.kernel.org/centos-vault/5.0/extras/$basearch/ 313 | gpgcheck=1 314 | gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 315 | enabled=0 316 | 317 | [C5.0-centosplus] 318 | name=CentOS-5.0 - Plus 319 | baseurl=http://archive.kernel.org/centos-vault/5.0/centosplus/$basearch/ 320 | gpgcheck=1 321 | gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 322 | enabled=0 323 | -------------------------------------------------------------------------------- /eol/kickstart/centos5/yum.repos.d/CentOS-fasttrack.repo: -------------------------------------------------------------------------------- 1 | [fasttrack] 2 | name=CentOS-5 - fasttrack 3 | baseurl=http://archive.kernel.org/centos-vault/$releasever/fasttrack/$basearch/ 4 | gpgcheck=1 5 | enabled=0 6 | gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 7 | -------------------------------------------------------------------------------- /eol/script/cleanup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -eux 2 | echo "==> Clear out machine id" 3 | rm -f /etc/machine-id 4 | touch /etc/machine-id 5 | 6 | echo "==> Cleaning up temporary network addresses" 7 | # Make sure udev doesn't block our network 8 | if grep -q -i "release 6" /etc/redhat-release ; then 9 | rm -f /etc/udev/rules.d/70-persistent-net.rules 10 | mkdir /etc/udev/rules.d/70-persistent-net.rules 11 | rm /lib/udev/rules.d/75-persistent-net-generator.rules 12 | 13 | for ndev in `ls -1 /etc/sysconfig/network-scripts/ifcfg-*`; do 14 | if [ "`basename $ndev`" != "ifcfg-lo" ]; then 15 | sed -i '/^HWADDR/d' "$ndev"; 16 | sed -i '/^UUID/d' "$ndev"; 17 | fi 18 | done 19 | fi 20 | rm -rf /dev/.udev/ 21 | 22 | DISK_USAGE_BEFORE_CLEANUP=$(df -h) 23 | 24 | if [[ $CLEANUP_BUILD_TOOLS =~ true || $CLEANUP_BUILD_TOOLS =~ 1 || $CLEANUP_BUILD_TOOLS =~ yes ]]; then 25 | echo "==> Removing tools used to build virtual machine drivers" 26 | yum -y remove gcc libmpc mpfr cpp kernel-devel kernel-headers 27 | fi 28 | 29 | echo "==> Clean up yum cache of metadata and packages to save space" 30 | yum -y --enablerepo='*' clean all 31 | 32 | echo "==> Removing temporary files used to build box" 33 | rm -rf /tmp/* 34 | 35 | echo "==> Rebuild RPM DB" 36 | rpmdb --rebuilddb 37 | rm -f /var/lib/rpm/__db* 38 | 39 | # delete any logs that have built up during the install 40 | find /var/log/ -name *.log -exec rm -f {} \; 41 | 42 | echo '==> Clear out swap and disable until reboot' 43 | set +e 44 | swapuuid=$(/sbin/blkid -o value -l -s UUID -t TYPE=swap) 45 | case "$?" in 46 | 2|0) ;; 47 | *) exit 1 ;; 48 | esac 49 | set -e 50 | if [ "x${swapuuid}" != "x" ]; then 51 | # Whiteout the swap partition to reduce box size 52 | # Swap is disabled till reboot 53 | swappart=$(readlink -f /dev/disk/by-uuid/$swapuuid) 54 | /sbin/swapoff "${swappart}" 55 | dd if=/dev/zero of="${swappart}" bs=1M || echo "dd exit code $? is suppressed" 56 | /sbin/mkswap -U "${swapuuid}" "${swappart}" 57 | fi 58 | 59 | echo '==> Zeroing out empty area to save space in the final image' 60 | # Zero out the free space to save space in the final image. Contiguous 61 | # zeroed space compresses down to nothing. 62 | dd if=/dev/zero of=/EMPTY bs=1M || echo "dd exit code $? is suppressed" 63 | rm -f /EMPTY 64 | 65 | # Block until the empty file has been removed, otherwise, Packer 66 | # will try to kill the box while the disk is still full and that's bad 67 | sync 68 | 69 | echo "==> Disk usage before cleanup" 70 | echo "${DISK_USAGE_BEFORE_CLEANUP}" 71 | 72 | echo "==> Disk usage after cleanup" 73 | df -h 74 | -------------------------------------------------------------------------------- /eol/script/desktop.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [[ ! "$DESKTOP" =~ ^(true|yes|on|1|TRUE|YES|ON])$ ]]; then 4 | exit 5 | fi 6 | 7 | USERNAME=vagrant 8 | 9 | cat /etc/redhat-release 10 | if grep -q -i "release 7" /etc/redhat-release ; then 11 | # set the graphical.target for systemd so it will run startx on boot 12 | ln -sf /lib/systemd/system/graphical.target /etc/systemd/system/default.target 13 | fi 14 | 15 | GDM_CONFIG=/etc/gdm/custom.conf 16 | 17 | # Configure gdm autologin. 18 | 19 | if [ -f $GDM_CONFIG ]; then 20 | sed -i s/"daemon]$"/"daemon]\nAutomaticLoginEnable=true\nAutomaticLogin=vagrant"/ /etc/gdm/custom.conf 21 | fi 22 | -------------------------------------------------------------------------------- /eol/script/fix-slow-dns.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -eux 2 | 3 | echo '==> Applying slow DNS fix' 4 | if [[ "${PACKER_BUILDER_TYPE}" =~ "virtualbox" ]]; then 5 | ## https://access.redhat.com/site/solutions/58625 (subscription required) 6 | # http://www.linuxquestions.org/questions/showthread.php?p=4399340#post4399340 7 | # add 'single-request-reopen' so it is included when /etc/resolv.conf is generated 8 | echo 'RES_OPTIONS="single-request-reopen"' >> /etc/sysconfig/network 9 | service network restart 10 | echo '==> Slow DNS fix applied (single-request-reopen)' 11 | else 12 | echo '==> Slow DNS fix not required for this platform, skipping' 13 | fi 14 | -------------------------------------------------------------------------------- /eol/script/motd.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -eux 2 | 3 | echo "==> Recording box generation date" 4 | date > /etc/vagrant_box_build_date 5 | 6 | echo "==> Customizing message of the day" 7 | MOTD_FILE=/etc/motd 8 | BANNER_WIDTH=64 9 | PLATFORM_RELEASE=$(sed 's/^.\+ release \([.0-9]\+\).*/\1/' /etc/redhat-release) 10 | PLATFORM_MSG=$(printf 'CentOS %s' "$PLATFORM_RELEASE") 11 | BUILT_MSG=$(printf 'built %s' $(date +%Y-%m-%d)) 12 | printf '%0.1s' "-"{1..64} > ${MOTD_FILE} 13 | printf '\n' >> ${MOTD_FILE} 14 | printf '%2s%-30s%30s\n' " " "${PLATFORM_MSG}" "${BUILT_MSG}" >> ${MOTD_FILE} 15 | printf '%0.1s' "-"{1..64} >> ${MOTD_FILE} 16 | printf '\n' >> ${MOTD_FILE} 17 | -------------------------------------------------------------------------------- /eol/script/parallels.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -eux 2 | 3 | SSH_USER=${SSH_USERNAME:-vagrant} 4 | SSH_USER_HOME=${SSH_USER_HOME:-/home/${SSH_USER}} 5 | 6 | if [[ $PACKER_BUILDER_TYPE =~ parallels ]]; then 7 | echo "==> Installing Parallels tools" 8 | mount -o loop $SSH_USER_HOME/prl-tools-lin.iso /mnt 9 | bash /mnt/install --install-unattended-with-deps 10 | umount /mnt 11 | rm -rf $SSH_USER_HOME/prl-tools-lin.iso 12 | rm -f $SSH_USER_HOME/.prlctl_version 13 | fi 14 | -------------------------------------------------------------------------------- /eol/script/sshd.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -eux 2 | 3 | echo '==> Configuring sshd_config options' 4 | 5 | echo '==> Turning off sshd DNS lookup to prevent timeout delay' 6 | echo "UseDNS no" >> /etc/ssh/sshd_config 7 | echo '==> Disablng GSSAPI authentication to prevent timeout delay' 8 | echo "GSSAPIAuthentication no" >> /etc/ssh/sshd_config 9 | -------------------------------------------------------------------------------- /eol/script/update.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -eux 2 | 3 | if [[ $UPDATE =~ true || $UPDATE =~ 1 || $UPDATE =~ yes ]]; then 4 | echo "==> Applying updates" 5 | yum -y update 6 | 7 | # reboot 8 | echo "Rebooting the machine..." 9 | reboot 10 | sleep 60 11 | fi 12 | -------------------------------------------------------------------------------- /eol/script/vagrant.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -eux 2 | 3 | echo '==> Configuring settings for vagrant' 4 | 5 | SSH_USER=${SSH_USERNAME:-vagrant} 6 | SSH_USER_HOME=${SSH_USER_HOME:-/home/${SSH_USER}} 7 | VAGRANT_INSECURE_KEY="ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key" 8 | 9 | # Packer passes boolean user variables through as '1', but this might change in 10 | # the future, so also check for 'true'. 11 | if [ "$INSTALL_VAGRANT_KEY" = "true" ] || [ "$INSTALL_VAGRANT_KEY" = "1" ]; then 12 | # Add vagrant user (if it doesn't already exist) 13 | if ! id -u $SSH_USER >/dev/null 2>&1; then 14 | echo '==> Creating ${SSH_USER}' 15 | /usr/sbin/groupadd $SSH_USER 16 | /usr/sbin/useradd $SSH_USER -g $SSH_USER -G wheel 17 | echo '==> Giving ${SSH_USER} sudo powers' 18 | echo "${SSH_USER}"|passwd --stdin $SSH_USER 19 | echo "${SSH_USER} ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers 20 | fi 21 | 22 | echo '==> Installing Vagrant SSH key' 23 | mkdir -pm 700 ${SSH_USER_HOME}/.ssh 24 | # https://raw.githubusercontent.com/mitchellh/vagrant/master/keys/vagrant.pub 25 | echo "${VAGRANT_INSECURE_KEY}" > $SSH_USER_HOME/.ssh/authorized_keys 26 | chmod 0600 ${SSH_USER_HOME}/.ssh/authorized_keys 27 | chown -R ${SSH_USER}:${SSH_USER} ${SSH_USER_HOME}/.ssh 28 | fi 29 | -------------------------------------------------------------------------------- /eol/script/virtualbox.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -eux 2 | 3 | SSH_USER=${SSH_USERNAME:-vagrant} 4 | SSH_USER_HOME=${SSH_USER_HOME:-/home/${SSH_USER}} 5 | 6 | if [[ $PACKER_BUILDER_TYPE =~ virtualbox ]]; then 7 | echo "==> Installing VirtualBox guest additions" 8 | # Assume that we've installed all the prerequisites: 9 | # kernel-headers-$(uname -r) kernel-devel-$(uname -r) gcc make perl 10 | # from the install media via ks.cfg 11 | 12 | VBOX_VERSION=$(cat $SSH_USER_HOME/.vbox_version) 13 | mount -o loop $SSH_USER_HOME/VBoxGuestAdditions_$VBOX_VERSION.iso /mnt 14 | sh /mnt/VBoxLinuxAdditions.run --nox11 15 | umount /mnt 16 | rm -rf $SSH_USER_HOME/VBoxGuestAdditions_$VBOX_VERSION.iso 17 | rm -f $SSH_USER_HOME/.vbox_version 18 | fi 19 | -------------------------------------------------------------------------------- /eol/script/vmware.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -eux 2 | 3 | SSH_USER=${SSH_USERNAME:-vagrant} 4 | SSH_USER_HOME=${SSH_USER_HOME:-/home/${SSH_USER}} 5 | 6 | function install_open_vm_tools { 7 | echo "==> Installing Open VM Tools" 8 | # Install open-vm-tools so we can mount shared folders 9 | yum install -y open-vm-tools 10 | # Add /mnt/hgfs so the mount works automatically with Vagrant 11 | mkdir /mnt/hgfs 12 | } 13 | 14 | function install_vmware_tools { 15 | echo "==> Installing VMware Tools" 16 | # Assuming the following packages are installed 17 | # apt-get install -y linux-headers-$(uname -r) build-essential perl 18 | 19 | cd /tmp 20 | mkdir -p /mnt/cdrom 21 | mount -o loop /home/${SSH_USERNAME}/linux.iso /mnt/cdrom 22 | 23 | VMWARE_TOOLS_PATH=$(ls /mnt/cdrom/VMwareTools-*.tar.gz) 24 | VMWARE_TOOLS_VERSION=$(echo "${VMWARE_TOOLS_PATH}" | cut -f2 -d'-') 25 | VMWARE_TOOLS_BUILD=$(echo "${VMWARE_TOOLS_PATH}" | cut -f3 -d'-') 26 | VMWARE_TOOLS_BUILD=$(basename ${VMWARE_TOOLS_BUILD} .tar.gz) 27 | echo "==> VMware Tools Path: ${VMWARE_TOOLS_PATH}" 28 | echo "==> VMWare Tools Version: ${VMWARE_TOOLS_VERSION}" 29 | echo "==> VMware Tools Build: ${VMWARE_TOOLS_BUILD}" 30 | 31 | tar zxf /mnt/cdrom/VMwareTools-*.tar.gz -C /tmp/ 32 | VMWARE_TOOLS_MAJOR_VERSION=$(echo ${VMWARE_TOOLS_VERSION} | cut -d '.' -f 1) 33 | if [ "${VMWARE_TOOLS_MAJOR_VERSION}" -lt "10" ]; then 34 | /tmp/vmware-tools-distrib/vmware-install.pl -d 35 | else 36 | /tmp/vmware-tools-distrib/vmware-install.pl -f 37 | fi 38 | 39 | rm /home/${SSH_USERNAME}/linux.iso 40 | umount /mnt/cdrom 41 | rmdir /mnt/cdrom 42 | rm -rf /tmp/VMwareTools-* 43 | 44 | VMWARE_TOOLBOX_CMD_VERSION=$(vmware-toolbox-cmd -v) 45 | echo "==> Installed VMware Tools ${VMWARE_TOOLBOX_CMD_VERSION}" 46 | } 47 | 48 | if [[ $PACKER_BUILDER_TYPE =~ vmware ]]; then 49 | echo "==> Installing VMware Tools" 50 | cat /etc/redhat-release 51 | if grep -q -i "release 6" /etc/redhat-release ; then 52 | # Uninstall fuse to fake out the vmware install so it won't try to 53 | # enable the VMware blocking filesystem 54 | yum erase -y fuse 55 | fi 56 | # Assume that we've installed all the prerequisites: 57 | # kernel-headers-$(uname -r) kernel-devel-$(uname -r) gcc make perl 58 | # from the install media via ks.cfg 59 | 60 | # On RHEL 5, add /sbin to PATH because vagrant does a probe for 61 | # vmhgfs with lsmod sans PATH 62 | if grep -q -i "release 5" /etc/redhat-release ; then 63 | echo "export PATH=$PATH:/usr/sbin:/sbin" >> $SSH_USER_HOME/.bashrc 64 | fi 65 | 66 | KERNEL_VERSION="$(uname -r)" 67 | KERNEL_MAJOR_VERSION="${KERNEL_VERSION%%.*}" 68 | KERNEL_MINOR_VERSION_START="${KERNEL_VERSION#*.}" 69 | KERNEL_MINOR_VERSION="${KERNEL_MINOR_VERSION_START%%.*}" 70 | echo "Kernel version ${KERNEL_MAJOR_VERSION}.${KERNEL_MINOR_VERSION}" 71 | if [ "${KERNEL_MAJOR_VERSION}" -ge "4" ] && [ "${KERNEL_MINOR_VERSION}" -ge "1" ]; then 72 | install_open_vm_tools 73 | else 74 | install_vmware_tools 75 | fi 76 | fi 77 | -------------------------------------------------------------------------------- /eol/tpl/vagrantfile-centos511-desktop.tpl: -------------------------------------------------------------------------------- 1 | # -*- mode: ruby -*- 2 | # vi: set ft=ruby : 3 | 4 | Vagrant.configure("2") do |config| 5 | config.vm.define "vagrant-centos511-desktop" 6 | config.vm.box = "centos511-desktop" 7 | 8 | config.vm.provider :virtualbox do |v, override| 9 | v.gui = true 10 | v.customize ["modifyvm", :id, "--memory", 1024] 11 | v.customize ["modifyvm", :id, "--cpus", 1] 12 | v.customize ["modifyvm", :id, "--vram", "256"] 13 | v.customize ["setextradata", "global", "GUI/MaxGuestResolution", "any"] 14 | v.customize ["setextradata", :id, "CustomVideoMode1", "1024x768x32"] 15 | v.customize ["modifyvm", :id, "--ioapic", "on"] 16 | v.customize ["modifyvm", :id, "--rtcuseutc", "on"] 17 | v.customize ["modifyvm", :id, "--accelerate3d", "on"] 18 | v.customize ["modifyvm", :id, "--clipboard", "bidirectional"] 19 | end 20 | 21 | ["vmware_fusion", "vmware_workstation"].each do |provider| 22 | config.vm.provider provider do |v, override| 23 | v.gui = true 24 | v.vmx["memsize"] = "1024" 25 | v.vmx["numvcpus"] = "1" 26 | v.vmx["cpuid.coresPerSocket"] = "1" 27 | v.vmx["ethernet0.virtualDev"] = "vmxnet3" 28 | v.vmx["RemoteDisplay.vnc.enabled"] = "false" 29 | v.vmx["RemoteDisplay.vnc.port"] = "5900" 30 | v.vmx["scsi0.virtualDev"] = "lsilogic" 31 | end 32 | end 33 | end 34 | -------------------------------------------------------------------------------- /kickstart/centos6-desktop/ks.cfg: -------------------------------------------------------------------------------- 1 | # CentOS 6.x kickstart file - ks6-desktop.cfg 2 | # 3 | # For more information on kickstart syntax and commands, refer to the 4 | # CentOS Installation Guide: 5 | # https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Installation_Guide/s1-kickstart2-options.html 6 | # 7 | # For testing, you can fire up a local http server temporarily. 8 | # cd to the directory where this ks.cfg file resides and run the following: 9 | # $ python -m SimpleHTTPServer 10 | # You don't have to restart the server every time you make changes. Python 11 | # will reload the file from disk every time. As long as you save your changes 12 | # they will be reflected in the next HTTP download. Then to test with 13 | # a PXE boot server, enter the following on the PXE boot prompt: 14 | # > linux text ks=http://:8000/ks.cfg 15 | 16 | # Required settings 17 | lang en_US.UTF-8 18 | keyboard us 19 | rootpw vagrant 20 | authconfig --enableshadow --enablemd5 21 | timezone UTC 22 | 23 | # Optional settings 24 | install 25 | cdrom 26 | user --name=vagrant --plaintext --password vagrant 27 | unsupported_hardware 28 | network --device eth0 --bootproto=dhcp 29 | firewall --disabled 30 | selinux --permissive 31 | # The biosdevname and ifnames options ensure we get "eth0" as our interface 32 | # even in environments like virtualbox that emulate a real NW card 33 | bootloader --location=mbr --append="no_timer_check console=tty0 console=ttyS0,115200 net.ifnames=0 biosdevname=0" 34 | text 35 | xconfig --startxonboot --resolution=1024x76 --depth=24 36 | zerombr 37 | clearpart --all --initlabel 38 | autopart 39 | firstboot --disabled 40 | reboot --eject 41 | 42 | %packages --ignoremissing --excludedocs 43 | # yum -v grouplist - get groupids 44 | @base 45 | @debugging 46 | @directory-client 47 | @java-platform 48 | @network-file-system-client 49 | @print-client 50 | @basic-desktop 51 | @desktop-debugging 52 | @desktop-platform 53 | @fonts 54 | @general-desktop 55 | @graphical-admin-tools 56 | @input-methods 57 | @legacy-x 58 | @remote-desktop-clients 59 | @x11 60 | @server-platform 61 | @internet-applications 62 | @internet-browser 63 | @office-suite 64 | # Prerequisites for installing VMware Tools or VirtualBox guest additions. 65 | # Put in kickstart to ensure first version installed is from install disk, 66 | # not latest from a mirror. 67 | kernel-headers 68 | kernel-devel 69 | gcc 70 | make 71 | perl 72 | curl 73 | wget 74 | # Selinux 75 | policycoreutils 76 | selinux-policy 77 | selinux-policy-targeted 78 | libselinux 79 | libselinux-utils 80 | libselinux-python 81 | 82 | %post 83 | # configure vagrant user in sudoers 84 | echo "%vagrant ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers.d/vagrant 85 | chmod 0440 /etc/sudoers.d/vagrant 86 | sed -i "s/^\(.*requiretty\)$/#\1/" /etc/sudoers 87 | # keep proxy settings through sudo 88 | echo 'Defaults env_keep += "HTTP_PROXY HTTPS_PROXY FTP_PROXY RSYNC_PROXY NO_PROXY"' >> /etc/sudoers 89 | -------------------------------------------------------------------------------- /kickstart/centos6/ks.cfg: -------------------------------------------------------------------------------- 1 | # CentOS 6.x kickstart file - ks.cfg 2 | # 3 | # For more information on kickstart syntax and commands, refer to the 4 | # CentOS Installation Guide: 5 | # https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Installation_Guide/s1-kickstart2-options.html 6 | # 7 | # For testing, you can fire up a local http server temporarily. 8 | # cd to the directory where this ks.cfg file resides and run the following: 9 | # $ python -m SimpleHTTPServer 10 | # You don't have to restart the server every time you make changes. Python 11 | # will reload the file from disk every time. As long as you save your changes 12 | # they will be reflected in the next HTTP download. Then to test with 13 | # a PXE boot server, enter the following on the PXE boot prompt: 14 | # > linux text ks=http://:8000/ks.cfg 15 | 16 | # Required settings 17 | lang en_US.UTF-8 18 | keyboard us 19 | rootpw vagrant 20 | authconfig --enableshadow --enablemd5 21 | timezone UTC 22 | 23 | # Optional settings 24 | install 25 | cdrom 26 | user --name=vagrant --plaintext --password vagrant 27 | unsupported_hardware 28 | network --bootproto=dhcp 29 | firewall --disabled 30 | selinux --permissive 31 | bootloader --location=mbr --append="no_timer_check console=tty0 console=ttyS0,115200" 32 | text 33 | skipx 34 | zerombr 35 | clearpart --all --initlabel 36 | autopart 37 | firstboot --disabled 38 | reboot 39 | 40 | %packages --nobase --ignoremissing --excludedocs 41 | # vagrant needs this to copy initial files via scp 42 | openssh-clients 43 | # Prerequisites for installing VMware Tools or VirtualBox guest additions. 44 | # Put in kickstart to ensure first version installed is from install disk, 45 | # not latest from a mirror. 46 | kernel-headers 47 | kernel-devel 48 | gcc 49 | make 50 | perl 51 | curl 52 | wget 53 | # Other stuff 54 | sudo 55 | nfs-utils 56 | -fprintd-pam 57 | -intltool 58 | # Selinux 59 | policycoreutils 60 | selinux-policy 61 | selinux-policy-targeted 62 | libselinux 63 | libselinux-utils 64 | libselinux-python 65 | # Workaround for selinux 66 | -system-config-firewall-tui 67 | system-config-firewall-base 68 | 69 | # Microcode updates cannot work in a VM 70 | -microcode_ctl 71 | # unnecessary firmware 72 | -aic94xx-firmware 73 | -atmel-firmware 74 | -b43-openfwwf 75 | -bfa-firmware 76 | -ipw*-firmware 77 | -irqbalance 78 | -ivtv-firmware 79 | -iwl*-firmware 80 | -libertas-usb8388-firmware 81 | -ql*-firmware 82 | -rt61pci-firmware 83 | -rt73usb-firmware 84 | -xorg-x11-drv-ati-firmware 85 | -zd1211-firmware 86 | %end 87 | 88 | %post 89 | # configure vagrant user in sudoers 90 | echo "%vagrant ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers.d/vagrant 91 | chmod 0440 /etc/sudoers.d/vagrant 92 | cp /etc/sudoers /etc/sudoers.orig 93 | sed -i "s/^\(.*requiretty\)$/#\1/" /etc/sudoers 94 | # keep proxy settings through sudo 95 | echo 'Defaults env_keep += "HTTP_PROXY HTTPS_PROXY FTP_PROXY RSYNC_PROXY NO_PROXY"' >> /etc/sudoers 96 | %end 97 | -------------------------------------------------------------------------------- /kickstart/centos7-desktop/ks.cfg: -------------------------------------------------------------------------------- 1 | # CentOS 7.x kickstart file - ks7.cfg 2 | # 3 | # For more information on kickstart syntax and commands, refer to the 4 | # CentOS Installation Guide: 5 | # https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Installation_Guide/sect-kickstart-syntax.html 6 | # 7 | # For testing, you can fire up a local http server temporarily. 8 | # cd to the directory where this ks.cfg file resides and run the following: 9 | # $ python -m SimpleHTTPServer 10 | # You don't have to restart the server every time you make changes. Python 11 | # will reload the file from disk every time. As long as you save your changes 12 | # they will be reflected in the next HTTP download. Then to test with 13 | # a PXE boot server, enter the following on the PXE boot prompt: 14 | # > linux text ks=http://:8000/ks.cfg 15 | 16 | # Required settings 17 | lang en_US.UTF-8 18 | keyboard us 19 | rootpw vagrant 20 | authconfig --enableshadow --enablemd5 21 | timezone UTC 22 | 23 | # Optional settings 24 | install 25 | cdrom 26 | user --name=vagrant --plaintext --password vagrant 27 | unsupported_hardware 28 | network --device eth0 --bootproto=dhcp 29 | network --bootproto=dhcp 30 | firewall --disabled 31 | selinux --permissive 32 | # The biosdevname and ifnames options ensure we get "eth0" as our interface 33 | # even in environments like virtualbox that emulate a real NW card 34 | bootloader --location=mbr --append="no_timer_check console=tty0 console=ttyS0,115200 net.ifnames=0 biosdevname=0" 35 | text 36 | xconfig --startxonboot --defaultdesktop=gnome 37 | eula --agreed 38 | zerombr 39 | clearpart --all --initlabel 40 | autopart 41 | firstboot --disabled 42 | reboot --eject 43 | 44 | %packages --ignoremissing --excludedocs 45 | @core 46 | @fonts 47 | @x11 48 | @gnome-desktop 49 | @input-methods 50 | anaconda 51 | isomd5sum 52 | kernel 53 | memtest86+ 54 | grub2-efi 55 | grub2 56 | shim 57 | syslinux 58 | -dracut-config-rescue 59 | # vagrant needs this to copy initial files via scp 60 | openssh-clients 61 | # Prerequisites for installing VMware Tools or VirtualBox guest additions. 62 | # Put in kickstart to ensure first version installed is from install disk, 63 | # not latest from a mirror. 64 | kernel-headers 65 | kernel-devel 66 | gcc 67 | make 68 | perl 69 | curl 70 | wget 71 | bzip2 72 | dkms 73 | patch 74 | net-tools 75 | git 76 | # Core selinux dependencies installed on 7.x, no need to specify 77 | # Other stuff 78 | sudo 79 | nfs-utils 80 | %end 81 | 82 | %post 83 | # configure vagrant user in sudoers 84 | echo "%vagrant ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers.d/vagrant 85 | chmod 0440 /etc/sudoers.d/vagrant 86 | cp /etc/sudoers /etc/sudoers.orig 87 | sed -i "s/^\(.*requiretty\)$/#\1/" /etc/sudoers 88 | # keep proxy settings through sudo 89 | echo 'Defaults env_keep += "HTTP_PROXY HTTPS_PROXY FTP_PROXY RSYNC_PROXY NO_PROXY"' >> /etc/sudoers 90 | %end 91 | -------------------------------------------------------------------------------- /kickstart/centos7/ks.cfg: -------------------------------------------------------------------------------- 1 | # CentOS 7.x kickstart file - centos7.ks 2 | # 3 | # For more information on kickstart syntax and commands, refer to the 4 | # CentOS Installation Guide: 5 | # https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Installation_Guide/sect-kickstart-syntax.html 6 | # 7 | # For testing, you can fire up a local http server temporarily. 8 | # cd to the directory where this ks.cfg file resides and run the following: 9 | # $ python -m SimpleHTTPServer 10 | # You don't have to restart the server every time you make changes. Python 11 | # will reload the file from disk every time. As long as you save your changes 12 | # they will be reflected in the next HTTP download. Then to test with 13 | # a PXE boot server, enter the following on the PXE boot prompt: 14 | # > linux text ks=http://:8000/ks.cfg 15 | 16 | # Required settings 17 | lang en_US.UTF-8 18 | keyboard us 19 | rootpw vagrant 20 | authconfig --enableshadow --enablemd5 21 | timezone UTC 22 | 23 | # Optional settings 24 | install 25 | cdrom 26 | user --name=vagrant --plaintext --password vagrant 27 | unsupported_hardware 28 | network --device eth0 --bootproto=dhcp 29 | firewall --disabled 30 | selinux --permissive 31 | # The biosdevname and ifnames options ensure we get "eth0" as our interface 32 | # even in environments like virtualbox that emulate a real NW card 33 | bootloader --location=mbr --append="no_timer_check console=tty0 console=ttyS0,115200 net.ifnames=0 biosdevname=0" 34 | text 35 | skipx 36 | zerombr 37 | clearpart --all --initlabel 38 | autopart 39 | firstboot --disabled 40 | reboot 41 | 42 | %packages --nobase --ignoremissing --excludedocs 43 | # vagrant needs this to copy initial files via scp 44 | openssh-clients 45 | # Prerequisites for installing VMware Tools or VirtualBox guest additions. 46 | # Put in kickstart to ensure first version installed is from install disk, 47 | # not latest from a mirror. 48 | kernel-headers 49 | kernel-devel 50 | gcc 51 | make 52 | perl 53 | curl 54 | wget 55 | bzip2 56 | dkms 57 | patch 58 | net-tools 59 | selinux-policy-devel 60 | # Core selinux dependencies installed on 7.x, no need to specify 61 | # Other stuff 62 | sudo 63 | nfs-utils 64 | -fprintd-pam 65 | -intltool 66 | 67 | # Microcode updates cannot work in a VM 68 | -microcode_ctl 69 | # unnecessary firmware 70 | -aic94xx-firmware 71 | -alsa-firmware 72 | -alsa-tools-firmware 73 | -atmel-firmware 74 | -b43-openfwwf 75 | -bfa-firmware 76 | -ipw*-firmware 77 | -irqbalance 78 | -ivtv-firmware 79 | -iwl*-firmware 80 | -kernel-firmware 81 | -libertas-usb8388-firmware 82 | -ql*-firmware 83 | -rt61pci-firmware 84 | -rt73usb-firmware 85 | -xorg-x11-drv-ati-firmware 86 | -zd1211-firmware 87 | # Don't build rescue initramfs 88 | -dracut-config-rescue 89 | %end 90 | 91 | %post 92 | # configure vagrant user in sudoers 93 | echo "%vagrant ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers.d/vagrant 94 | chmod 0440 /etc/sudoers.d/vagrant 95 | cp /etc/sudoers /etc/sudoers.orig 96 | sed -i "s/^\(.*requiretty\)$/#\1/" /etc/sudoers 97 | # keep proxy settings through sudo 98 | echo 'Defaults env_keep += "HTTP_PROXY HTTPS_PROXY FTP_PROXY RSYNC_PROXY NO_PROXY"' >> /etc/sudoers 99 | %end 100 | -------------------------------------------------------------------------------- /kickstart/centos8-desktop/ks.cfg: -------------------------------------------------------------------------------- 1 | # CentOS 7.x kickstart file - ks7.cfg 2 | # 3 | # For more information on kickstart syntax and commands, refer to the 4 | # CentOS Installation Guide: 5 | # https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Installation_Guide/sect-kickstart-syntax.html 6 | # 7 | # For testing, you can fire up a local http server temporarily. 8 | # cd to the directory where this ks.cfg file resides and run the following: 9 | # $ python -m SimpleHTTPServer 10 | # You don't have to restart the server every time you make changes. Python 11 | # will reload the file from disk every time. As long as you save your changes 12 | # they will be reflected in the next HTTP download. Then to test with 13 | # a PXE boot server, enter the following on the PXE boot prompt: 14 | # > linux text ks=http://:8000/ks.cfg 15 | 16 | # Required settings 17 | lang en_US.UTF-8 18 | keyboard us 19 | rootpw vagrant 20 | authconfig --enableshadow --enablemd5 21 | timezone UTC 22 | 23 | # Optional settings 24 | install 25 | cdrom 26 | user --name=vagrant --plaintext --password vagrant 27 | network --device eth0 --bootproto=dhcp 28 | network --bootproto=dhcp 29 | firewall --disabled 30 | selinux --permissive 31 | # The biosdevname and ifnames options ensure we get "eth0" as our interface 32 | # even in environments like virtualbox that emulate a real NW card 33 | bootloader --location=mbr --append="no_timer_check console=tty0 console=ttyS0,115200 net.ifnames=0 biosdevname=0" 34 | text 35 | xconfig --startxonboot --defaultdesktop=gnome 36 | eula --agreed 37 | zerombr 38 | clearpart --all --initlabel 39 | autopart 40 | firstboot --disabled 41 | reboot --eject 42 | 43 | %packages --ignoremissing --excludedocs 44 | @core 45 | @fonts 46 | @x11 47 | @gnome-desktop 48 | @input-methods 49 | anaconda 50 | isomd5sum 51 | kernel 52 | memtest86+ 53 | grub2-efi 54 | grub2 55 | shim 56 | syslinux 57 | -dracut-config-rescue 58 | # vagrant needs this to copy initial files via scp 59 | openssh-clients 60 | # Prerequisites for installing VMware Tools or VirtualBox guest additions. 61 | # Put in kickstart to ensure first version installed is from install disk, 62 | # not latest from a mirror. 63 | kernel-headers 64 | kernel-devel 65 | gcc 66 | make 67 | perl 68 | curl 69 | wget 70 | bzip2 71 | dkms 72 | patch 73 | net-tools 74 | git 75 | # Core selinux dependencies installed on 7.x, no need to specify 76 | # Other stuff 77 | sudo 78 | nfs-utils 79 | %end 80 | 81 | %post 82 | # configure vagrant user in sudoers 83 | echo "%vagrant ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers.d/vagrant 84 | chmod 0440 /etc/sudoers.d/vagrant 85 | cp /etc/sudoers /etc/sudoers.orig 86 | sed -i "s/^\(.*requiretty\)$/#\1/" /etc/sudoers 87 | # keep proxy settings through sudo 88 | echo 'Defaults env_keep += "HTTP_PROXY HTTPS_PROXY FTP_PROXY RSYNC_PROXY NO_PROXY"' >> /etc/sudoers 89 | %end 90 | -------------------------------------------------------------------------------- /kickstart/centos8/ks.cfg: -------------------------------------------------------------------------------- 1 | # CentOS 7.x kickstart file - centos7.ks 2 | # 3 | # For more information on kickstart syntax and commands, refer to the 4 | # CentOS Installation Guide: 5 | # https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Installation_Guide/sect-kickstart-syntax.html 6 | # 7 | # For testing, you can fire up a local http server temporarily. 8 | # cd to the directory where this ks.cfg file resides and run the following: 9 | # $ python -m SimpleHTTPServer 10 | # You don't have to restart the server every time you make changes. Python 11 | # will reload the file from disk every time. As long as you save your changes 12 | # they will be reflected in the next HTTP download. Then to test with 13 | # a PXE boot server, enter the following on the PXE boot prompt: 14 | # > linux text ks=http://:8000/ks.cfg 15 | 16 | # Required settings 17 | lang en_US.UTF-8 18 | keyboard us 19 | rootpw vagrant 20 | authconfig --enableshadow --enablemd5 21 | timezone UTC 22 | 23 | # Optional settings 24 | install 25 | cdrom 26 | user --name=vagrant --plaintext --password vagrant 27 | # unsupported_hardware 28 | network --device eth0 --bootproto=dhcp 29 | firewall --disabled 30 | selinux --permissive 31 | # The biosdevname and ifnames options ensure we get "eth0" as our interface 32 | # even in environments like virtualbox that emulate a real NW card 33 | bootloader --location=mbr --append="no_timer_check console=tty0 console=ttyS0,115200 net.ifnames=0 biosdevname=0" 34 | text 35 | skipx 36 | zerombr 37 | clearpart --all --initlabel 38 | autopart 39 | firstboot --disabled 40 | reboot 41 | 42 | %packages --ignoremissing --excludedocs 43 | # vagrant needs this to copy initial files via scp 44 | openssh-clients 45 | # Prerequisites for installing VMware Tools or VirtualBox guest additions. 46 | # Put in kickstart to ensure first version installed is from install disk, 47 | # not latest from a mirror. 48 | kernel-headers 49 | kernel-devel 50 | gcc 51 | make 52 | perl 53 | curl 54 | wget 55 | bzip2 56 | dkms 57 | patch 58 | net-tools 59 | selinux-policy-devel 60 | # Core selinux dependencies installed on 7.x, no need to specify 61 | # Other stuff 62 | sudo 63 | nfs-utils 64 | -fprintd-pam 65 | -intltool 66 | 67 | # Microcode updates cannot work in a VM 68 | -microcode_ctl 69 | # unnecessary firmware 70 | -aic94xx-firmware 71 | -alsa-firmware 72 | -alsa-tools-firmware 73 | -atmel-firmware 74 | -b43-openfwwf 75 | -bfa-firmware 76 | -ipw*-firmware 77 | -irqbalance 78 | -ivtv-firmware 79 | -iwl*-firmware 80 | -kernel-firmware 81 | -libertas-usb8388-firmware 82 | -ql*-firmware 83 | -rt61pci-firmware 84 | -rt73usb-firmware 85 | -xorg-x11-drv-ati-firmware 86 | -zd1211-firmware 87 | # Don't build rescue initramfs 88 | -dracut-config-rescue 89 | %end 90 | 91 | %post 92 | # configure vagrant user in sudoers 93 | echo "%vagrant ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers.d/vagrant 94 | chmod 0440 /etc/sudoers.d/vagrant 95 | cp /etc/sudoers /etc/sudoers.orig 96 | sed -i "s/^\(.*requiretty\)$/#\1/" /etc/sudoers 97 | # keep proxy settings through sudo 98 | echo 'Defaults env_keep += "HTTP_PROXY HTTPS_PROXY FTP_PROXY RSYNC_PROXY NO_PROXY"' >> /etc/sudoers 99 | %end 100 | -------------------------------------------------------------------------------- /script/cleanup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -eux 2 | echo "==> Clear out machine id" 3 | rm -f /etc/machine-id 4 | touch /etc/machine-id 5 | 6 | echo "==> Cleaning up temporary network addresses" 7 | # Make sure udev doesn't block our network 8 | # http://6.ptmc.org/?p=1649 9 | if grep -q -i "release 6" /etc/redhat-release ; then 10 | rm -f /etc/udev/rules.d/70-persistent-net.rules 11 | mkdir /etc/udev/rules.d/70-persistent-net.rules 12 | 13 | for ndev in `ls -1 /etc/sysconfig/network-scripts/ifcfg-*`; do 14 | if [ "`basename $ndev`" != "ifcfg-lo" ]; then 15 | sed -i '/^HWADDR/d' "$ndev"; 16 | sed -i '/^UUID/d' "$ndev"; 17 | fi 18 | done 19 | fi 20 | # Better fix that persists package updates: http://serverfault.com/a/485689 21 | touch /etc/udev/rules.d/75-persistent-net-generator.rules 22 | for ndev in `ls -1 /etc/sysconfig/network-scripts/ifcfg-*`; do 23 | if [ "`basename $ndev`" != "ifcfg-lo" ]; then 24 | sed -i '/^HWADDR/d' "$ndev"; 25 | sed -i '/^UUID/d' "$ndev"; 26 | fi 27 | done 28 | rm -rf /dev/.udev/ 29 | 30 | DISK_USAGE_BEFORE_CLEANUP=$(df -h) 31 | 32 | if [[ $CLEANUP_BUILD_TOOLS =~ true || $CLEANUP_BUILD_TOOLS =~ 1 || $CLEANUP_BUILD_TOOLS =~ yes ]]; then 33 | echo "==> Removing tools used to build virtual machine drivers" 34 | yum -y remove gcc libmpc mpfr cpp kernel-devel kernel-headers 35 | fi 36 | 37 | echo "==> Clean up yum cache of metadata and packages to save space" 38 | yum -y --enablerepo='*' clean all 39 | 40 | echo "==> Removing temporary files used to build box" 41 | rm -rf /tmp/* 42 | 43 | echo "==> Rebuild RPM DB" 44 | rpmdb --rebuilddb 45 | rm -f /var/lib/rpm/__db* 46 | 47 | # delete any logs that have built up during the install 48 | find /var/log/ -name *.log -exec rm -f {} \; 49 | 50 | echo '==> Clear out swap and disable until reboot' 51 | set +e 52 | swapuuid=$(/sbin/blkid -o value -l -s UUID -t TYPE=swap) 53 | case "$?" in 54 | 2|0) ;; 55 | *) exit 1 ;; 56 | esac 57 | set -e 58 | if [ "x${swapuuid}" != "x" ]; then 59 | # Whiteout the swap partition to reduce box size 60 | # Swap is disabled till reboot 61 | swappart=$(readlink -f /dev/disk/by-uuid/$swapuuid) 62 | /sbin/swapoff "${swappart}" 63 | dd if=/dev/zero of="${swappart}" bs=1M || echo "dd exit code $? is suppressed" 64 | /sbin/mkswap -U "${swapuuid}" "${swappart}" 65 | fi 66 | 67 | echo '==> Zeroing out empty area to save space in the final image' 68 | # Zero out the free space to save space in the final image. Contiguous 69 | # zeroed space compresses down to nothing. 70 | dd if=/dev/zero of=/EMPTY bs=1M || echo "dd exit code $? is suppressed" 71 | rm -f /EMPTY 72 | 73 | # Block until the empty file has been removed, otherwise, Packer 74 | # will try to kill the box while the disk is still full and that's bad 75 | sync 76 | 77 | echo "==> Disk usage before cleanup" 78 | echo "${DISK_USAGE_BEFORE_CLEANUP}" 79 | 80 | echo "==> Disk usage after cleanup" 81 | df -h 82 | -------------------------------------------------------------------------------- /script/desktop.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [[ ! "$DESKTOP" =~ ^(true|yes|on|1|TRUE|YES|ON])$ ]]; then 4 | exit 5 | fi 6 | 7 | USERNAME=vagrant 8 | 9 | cat /etc/redhat-release 10 | if grep -q -i "release 7" /etc/redhat-release ; then 11 | # set the graphical.target for systemd so it will run startx on boot 12 | ln -sf /lib/systemd/system/graphical.target /etc/systemd/system/default.target 13 | fi 14 | 15 | GDM_CONFIG=/etc/gdm/custom.conf 16 | 17 | # Configure gdm autologin. 18 | 19 | if [ -f $GDM_CONFIG ]; then 20 | sed -i s/"daemon]$"/"daemon]\nAutomaticLoginEnable=true\nAutomaticLogin=vagrant"/ /etc/gdm/custom.conf 21 | fi 22 | -------------------------------------------------------------------------------- /script/fix-slow-dns.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -eux 2 | 3 | echo '==> Applying slow DNS fix' 4 | if [[ "${PACKER_BUILDER_TYPE}" =~ "virtualbox" ]]; then 5 | ## https://access.redhat.com/site/solutions/58625 (subscription required) 6 | # http://www.linuxquestions.org/questions/showthread.php?p=4399340#post4399340 7 | # add 'single-request-reopen' so it is included when /etc/resolv.conf is generated 8 | echo 'RES_OPTIONS="single-request-reopen"' >> /etc/sysconfig/network 9 | service network restart 10 | echo '==> Slow DNS fix applied (single-request-reopen)' 11 | else 12 | echo '==> Slow DNS fix not required for this platform, skipping' 13 | fi 14 | -------------------------------------------------------------------------------- /script/motd.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -eux 2 | 3 | echo "==> Recording box generation date" 4 | date > /etc/vagrant_box_build_date 5 | 6 | echo "==> Customizing message of the day" 7 | MOTD_FILE=/etc/motd 8 | BANNER_WIDTH=64 9 | PLATFORM_RELEASE=$(sed 's/^.\+ release \([.0-9]\+\).*/\1/' /etc/redhat-release) 10 | PLATFORM_MSG=$(printf 'CentOS %s' "$PLATFORM_RELEASE") 11 | BUILT_MSG=$(printf 'built %s' $(date +%Y-%m-%d)) 12 | printf '%0.1s' "-"{1..64} > ${MOTD_FILE} 13 | printf '\n' >> ${MOTD_FILE} 14 | printf '%2s%-30s%30s\n' " " "${PLATFORM_MSG}" "${BUILT_MSG}" >> ${MOTD_FILE} 15 | printf '%0.1s' "-"{1..64} >> ${MOTD_FILE} 16 | printf '\n' >> ${MOTD_FILE} 17 | -------------------------------------------------------------------------------- /script/parallels.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -eux 2 | 3 | SSH_USER=${SSH_USERNAME:-vagrant} 4 | SSH_USER_HOME=${SSH_USER_HOME:-/home/${SSH_USER}} 5 | 6 | if [[ $PACKER_BUILDER_TYPE =~ parallels ]]; then 7 | echo "==> Installing Parallels tools" 8 | mount -o loop $SSH_USER_HOME/prl-tools-lin.iso /mnt 9 | bash /mnt/install --install-unattended-with-deps 10 | umount /mnt 11 | rm -rf $SSH_USER_HOME/prl-tools-lin.iso 12 | rm -f $SSH_USER_HOME/.prlctl_version 13 | fi 14 | -------------------------------------------------------------------------------- /script/sshd.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -eux 2 | 3 | echo '==> Configuring sshd_config options' 4 | 5 | echo '==> Turning off sshd DNS lookup to prevent timeout delay' 6 | echo "UseDNS no" >> /etc/ssh/sshd_config 7 | echo '==> Disablng GSSAPI authentication to prevent timeout delay' 8 | echo "GSSAPIAuthentication no" >> /etc/ssh/sshd_config 9 | -------------------------------------------------------------------------------- /script/update.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -eux 2 | 3 | if [[ $UPDATE =~ true || $UPDATE =~ 1 || $UPDATE =~ yes ]]; then 4 | echo "==> Applying updates" 5 | yum -y update 6 | 7 | # reboot 8 | echo "Rebooting the machine..." 9 | reboot 10 | sleep 60 11 | fi 12 | -------------------------------------------------------------------------------- /script/vagrant.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -eux 2 | 3 | echo '==> Configuring settings for vagrant' 4 | 5 | SSH_USER=${SSH_USERNAME:-vagrant} 6 | SSH_USER_HOME=${SSH_USER_HOME:-/home/${SSH_USER}} 7 | VAGRANT_INSECURE_KEY="ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key" 8 | 9 | # Packer passes boolean user variables through as '1', but this might change in 10 | # the future, so also check for 'true'. 11 | if [ "$INSTALL_VAGRANT_KEY" = "true" ] || [ "$INSTALL_VAGRANT_KEY" = "1" ]; then 12 | # Add vagrant user (if it doesn't already exist) 13 | if ! id -u $SSH_USER >/dev/null 2>&1; then 14 | echo '==> Creating ${SSH_USER}' 15 | /usr/sbin/groupadd $SSH_USER 16 | /usr/sbin/useradd $SSH_USER -g $SSH_USER -G wheel 17 | echo '==> Giving ${SSH_USER} sudo powers' 18 | echo "${SSH_USER}"|passwd --stdin $SSH_USER 19 | echo "${SSH_USER} ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers 20 | fi 21 | 22 | echo '==> Installing Vagrant SSH key' 23 | mkdir -pm 700 ${SSH_USER_HOME}/.ssh 24 | # https://raw.githubusercontent.com/mitchellh/vagrant/master/keys/vagrant.pub 25 | echo "${VAGRANT_INSECURE_KEY}" > $SSH_USER_HOME/.ssh/authorized_keys 26 | chmod 0600 ${SSH_USER_HOME}/.ssh/authorized_keys 27 | chown -R ${SSH_USER}:${SSH_USER} ${SSH_USER_HOME}/.ssh 28 | fi 29 | -------------------------------------------------------------------------------- /script/virtualbox.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -eux 2 | 3 | SSH_USER=${SSH_USERNAME:-vagrant} 4 | SSH_USER_HOME=${SSH_USER_HOME:-/home/${SSH_USER}} 5 | 6 | if [[ $PACKER_BUILDER_TYPE =~ virtualbox ]]; then 7 | echo "==> Installing VirtualBox guest additions" 8 | # Assume that we've installed all the prerequisites: 9 | # kernel-headers-$(uname -r) kernel-devel-$(uname -r) gcc make perl 10 | # from the install media via ks.cfg 11 | 12 | VBOX_VERSION=$(cat $SSH_USER_HOME/.vbox_version) 13 | mount -o loop $SSH_USER_HOME/VBoxGuestAdditions_$VBOX_VERSION.iso /mnt 14 | sh /mnt/VBoxLinuxAdditions.run --nox11 15 | umount /mnt 16 | rm -rf $SSH_USER_HOME/VBoxGuestAdditions_$VBOX_VERSION.iso 17 | rm -f $SSH_USER_HOME/.vbox_version 18 | fi 19 | -------------------------------------------------------------------------------- /script/vmware.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -eux 2 | 3 | SSH_USER=${SSH_USERNAME:-vagrant} 4 | SSH_USER_HOME=${SSH_USER_HOME:-/home/${SSH_USER}} 5 | 6 | function install_open_vm_tools { 7 | echo "==> Installing Open VM Tools" 8 | # Install open-vm-tools so we can mount shared folders 9 | yum install -y open-vm-tools 10 | # Add /mnt/hgfs so the mount works automatically with Vagrant 11 | mkdir -p /mnt/hgfs 12 | } 13 | 14 | function install_vmware_tools { 15 | echo "==> Installing VMware Tools" 16 | # Assuming the following packages are installed 17 | # apt-get install -y linux-headers-$(uname -r) build-essential perl 18 | 19 | cd /tmp 20 | mkdir -p /mnt/cdrom 21 | mount -o loop /home/${SSH_USERNAME}/linux.iso /mnt/cdrom 22 | 23 | VMWARE_TOOLS_PATH=$(ls /mnt/cdrom/VMwareTools-*.tar.gz) 24 | VMWARE_TOOLS_VERSION=$(echo "${VMWARE_TOOLS_PATH}" | cut -f2 -d'-') 25 | VMWARE_TOOLS_BUILD=$(echo "${VMWARE_TOOLS_PATH}" | cut -f3 -d'-') 26 | VMWARE_TOOLS_BUILD=$(basename ${VMWARE_TOOLS_BUILD} .tar.gz) 27 | echo "==> VMware Tools Path: ${VMWARE_TOOLS_PATH}" 28 | echo "==> VMWare Tools Version: ${VMWARE_TOOLS_VERSION}" 29 | echo "==> VMware Tools Build: ${VMWARE_TOOLS_BUILD}" 30 | 31 | tar zxf /mnt/cdrom/VMwareTools-*.tar.gz -C /tmp/ 32 | VMWARE_TOOLS_MAJOR_VERSION=$(echo ${VMWARE_TOOLS_VERSION} | cut -d '.' -f 1) 33 | if [ "${VMWARE_TOOLS_MAJOR_VERSION}" -lt "10" ]; then 34 | /tmp/vmware-tools-distrib/vmware-install.pl -d 35 | else 36 | /tmp/vmware-tools-distrib/vmware-install.pl -f 37 | fi 38 | 39 | rm /home/${SSH_USERNAME}/linux.iso 40 | umount /mnt/cdrom 41 | rmdir /mnt/cdrom 42 | rm -rf /tmp/VMwareTools-* 43 | 44 | VMWARE_TOOLBOX_CMD_VERSION=$(vmware-toolbox-cmd -v) 45 | echo "==> Installed VMware Tools ${VMWARE_TOOLBOX_CMD_VERSION}" 46 | } 47 | 48 | if [[ $PACKER_BUILDER_TYPE =~ vmware ]]; then 49 | echo "==> Installing VMware Tools" 50 | cat /etc/redhat-release 51 | if grep -q -i "release 6" /etc/redhat-release ; then 52 | # Uninstall fuse to fake out the vmware install so it won't try to 53 | # enable the VMware blocking filesystem 54 | yum erase -y fuse 55 | fi 56 | # Assume that we've installed all the prerequisites: 57 | # kernel-headers-$(uname -r) kernel-devel-$(uname -r) gcc make perl 58 | # from the install media via ks.cfg 59 | 60 | KERNEL_VERSION="$(uname -r)" 61 | KERNEL_MAJOR_VERSION="${KERNEL_VERSION%%.*}" 62 | KERNEL_MINOR_VERSION_START="${KERNEL_VERSION#*.}" 63 | KERNEL_MINOR_VERSION="${KERNEL_MINOR_VERSION_START%%.*}" 64 | echo "Kernel version ${KERNEL_MAJOR_VERSION}.${KERNEL_MINOR_VERSION}" 65 | if [ "${KERNEL_MAJOR_VERSION}" -ge "4" ] && [ "${KERNEL_MINOR_VERSION}" -ge "1" ]; then 66 | install_open_vm_tools 67 | else 68 | install_vmware_tools 69 | fi 70 | fi 71 | -------------------------------------------------------------------------------- /test/centos_spec.rb: -------------------------------------------------------------------------------- 1 | require_relative 'spec_helper' 2 | 3 | describe 'box' do 4 | it 'should have a root user' do 5 | expect(user 'root').to exist 6 | end 7 | 8 | it 'should have a vagrant user' do 9 | expect(user 'vagrant').to exist 10 | end 11 | 12 | it 'should not have a .vbox_version file' do 13 | expect(file '/home/vagrant/.vbox_version').to_not be_file 14 | end 15 | 16 | it 'should disable SELinux' do 17 | expect(selinux).to be_permissive 18 | end 19 | 20 | # https://www.chef.io/blog/2015/02/26/bento-box-update-for-centos-and-fedora/ 21 | describe 'test-cacert' do 22 | it 'uses the vendor-supplied openssl certificates' do 23 | expect(command('openssl s_client -CAfile /etc/pki/tls/certs/ca-bundle.crt -connect packagecloud-repositories.s3.amazonaws.com:443 &1 | grep -i "verify return code"').stdout).to match /\s+Verify return code: 0 \(ok\)/ 24 | end 25 | end 26 | 27 | has_docker = command('command -v docker').exit_status == 0 28 | it 'should make vagrant a member of the docker group', :if => has_docker do 29 | expect(user 'vagrant').to belong_to_group 'docker' 30 | end 31 | end 32 | -------------------------------------------------------------------------------- /test/spec_helper.rb: -------------------------------------------------------------------------------- 1 | require 'serverspec' 2 | require 'net/ssh' 3 | 4 | set :backend, :ssh 5 | 6 | # Set PATH 7 | set :path, '/usr/local/sbin:/usr/sbin:/sbin:$PATH' 8 | -------------------------------------------------------------------------------- /tpl/vagrantfile-centos6-desktop.tpl: -------------------------------------------------------------------------------- 1 | # -*- mode: ruby -*- 2 | # vi: set ft=ruby : 3 | 4 | Vagrant.configure("2") do |config| 5 | config.vm.define "vagrant-centos6-desktop" 6 | config.vm.box = "centos6-desktop" 7 | 8 | config.vm.provider :virtualbox do |v, override| 9 | v.gui = true 10 | v.customize ["modifyvm", :id, "--memory", 1024] 11 | v.customize ["modifyvm", :id, "--cpus", 1] 12 | v.customize ["modifyvm", :id, "--vram", "256"] 13 | v.customize ["setextradata", "global", "GUI/MaxGuestResolution", "any"] 14 | v.customize ["setextradata", :id, "CustomVideoMode1", "1024x768x32"] 15 | v.customize ["modifyvm", :id, "--ioapic", "on"] 16 | v.customize ["modifyvm", :id, "--rtcuseutc", "on"] 17 | v.customize ["modifyvm", :id, "--accelerate3d", "on"] 18 | v.customize ["modifyvm", :id, "--clipboard", "bidirectional"] 19 | end 20 | 21 | ["vmware_fusion", "vmware_workstation"].each do |provider| 22 | config.vm.provider provider do |v, override| 23 | v.gui = true 24 | v.vmx["memsize"] = "1024" 25 | v.vmx["numvcpus"] = "1" 26 | v.vmx["cpuid.coresPerSocket"] = "1" 27 | v.vmx["ethernet0.virtualDev"] = "vmxnet3" 28 | v.vmx["RemoteDisplay.vnc.enabled"] = "false" 29 | v.vmx["RemoteDisplay.vnc.port"] = "5900" 30 | v.vmx["scsi0.virtualDev"] = "lsilogic" 31 | end 32 | end 33 | end 34 | -------------------------------------------------------------------------------- /tpl/vagrantfile-centos7-desktop.tpl: -------------------------------------------------------------------------------- 1 | # -*- mode: ruby -*- 2 | # vi: set ft=ruby : 3 | 4 | Vagrant.configure("2") do |config| 5 | config.vm.define "vagrant-centos7-desktop" 6 | config.vm.box = "centos7-desktop" 7 | 8 | config.vm.provider :virtualbox do |v, override| 9 | v.gui = true 10 | v.customize ["modifyvm", :id, "--memory", 1024] 11 | v.customize ["modifyvm", :id, "--cpus", 1] 12 | v.customize ["modifyvm", :id, "--vram", "256"] 13 | v.customize ["setextradata", "global", "GUI/MaxGuestResolution", "any"] 14 | v.customize ["setextradata", :id, "CustomVideoMode1", "1024x768x32"] 15 | v.customize ["modifyvm", :id, "--ioapic", "on"] 16 | v.customize ["modifyvm", :id, "--rtcuseutc", "on"] 17 | v.customize ["modifyvm", :id, "--accelerate3d", "on"] 18 | v.customize ["modifyvm", :id, "--clipboard", "bidirectional"] 19 | end 20 | 21 | ["vmware_fusion", "vmware_workstation"].each do |provider| 22 | config.vm.provider provider do |v, override| 23 | v.gui = true 24 | v.vmx["memsize"] = "1024" 25 | v.vmx["numvcpus"] = "1" 26 | v.vmx["cpuid.coresPerSocket"] = "1" 27 | v.vmx["ethernet0.virtualDev"] = "vmxnet3" 28 | v.vmx["RemoteDisplay.vnc.enabled"] = "false" 29 | v.vmx["RemoteDisplay.vnc.port"] = "5900" 30 | v.vmx["scsi0.virtualDev"] = "lsilogic" 31 | v.vmx["mks.enable3d"] = "TRUE" 32 | end 33 | end 34 | end 35 | -------------------------------------------------------------------------------- /tpl/vagrantfile-centos8-desktop.tpl: -------------------------------------------------------------------------------- 1 | # -*- mode: ruby -*- 2 | # vi: set ft=ruby : 3 | 4 | Vagrant.configure("2") do |config| 5 | config.vm.define "vagrant-centos8-desktop" 6 | config.vm.box = "centos8-desktop" 7 | 8 | config.vm.provider :virtualbox do |v, override| 9 | v.gui = true 10 | v.customize ["modifyvm", :id, "--memory", 1024] 11 | v.customize ["modifyvm", :id, "--cpus", 1] 12 | v.customize ["modifyvm", :id, "--vram", "256"] 13 | v.customize ["setextradata", "global", "GUI/MaxGuestResolution", "any"] 14 | v.customize ["setextradata", :id, "CustomVideoMode1", "1024x768x32"] 15 | v.customize ["modifyvm", :id, "--ioapic", "on"] 16 | v.customize ["modifyvm", :id, "--rtcuseutc", "on"] 17 | v.customize ["modifyvm", :id, "--accelerate3d", "on"] 18 | v.customize ["modifyvm", :id, "--clipboard", "bidirectional"] 19 | end 20 | 21 | ["vmware_fusion", "vmware_workstation"].each do |provider| 22 | config.vm.provider provider do |v, override| 23 | v.gui = true 24 | v.vmx["memsize"] = "1024" 25 | v.vmx["numvcpus"] = "1" 26 | v.vmx["cpuid.coresPerSocket"] = "1" 27 | v.vmx["ethernet0.virtualDev"] = "vmxnet3" 28 | v.vmx["RemoteDisplay.vnc.enabled"] = "false" 29 | v.vmx["RemoteDisplay.vnc.port"] = "5900" 30 | v.vmx["scsi0.virtualDev"] = "lsilogic" 31 | v.vmx["mks.enable3d"] = "TRUE" 32 | end 33 | end 34 | end 35 | --------------------------------------------------------------------------------