From 750c453dd14a0e5647ef55a47fb4cece9a4da386 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Thu, 12 Dec 2019 17:20:28 -0600 Subject: [PATCH] Deprecate project, move to consolidated project. --- README.md | 46 ++----------------------- Vagrantfile | 25 -------------- ansible/main.yml | 8 ----- builds/README.md | 1 - centos7.json | 76 ------------------------------------------ http/ks.cfg | 83 ---------------------------------------------- requirements.yml | 3 -- scripts/ansible.sh | 4 --- scripts/cleanup.sh | 11 ------ 9 files changed, 3 insertions(+), 254 deletions(-) delete mode 100644 Vagrantfile delete mode 100755 ansible/main.yml delete mode 100755 builds/README.md delete mode 100755 centos7.json delete mode 100644 http/ks.cfg delete mode 100644 requirements.yml delete mode 100644 scripts/ansible.sh delete mode 100644 scripts/cleanup.sh diff --git a/README.md b/README.md index 52f2cdd..a497778 100755 --- a/README.md +++ b/README.md @@ -1,45 +1,5 @@ -# Packer Example - CentOS 7 minimal Vagrant Box using Ansible provisioner +# Packer Build - CentOS 7 minimal Vagrant Box -**Current CentOS Version Used**: 7.7 (1908) +**DEPRECATED**: This Packer build has been moved to a new consolidated project: https://github.com/geerlingguy/packer-boxes -**Pre-built Vagrant Box**: - - - [`vagrant init geerlingguy/centos7`](https://vagrantcloud.com/geerlingguy/boxes/centos7) - - See older versions: http://files.midwesternmac.com/ - -This example build configuration installs and configures CentOS 7 x86_64 minimal using Ansible, and then generates a Vagrant box file for VirtualBox. - -The example can be modified to use more Ansible roles, plays, and included playbooks to fully configure (or partially) configure a box file suitable for deployment for development environments. - -## Requirements - -The following software must be installed/present on your local machine before you can use Packer to build the Vagrant box file: - - - [Packer](http://www.packer.io/) - - [Vagrant](http://vagrantup.com/) - - [VirtualBox](https://www.virtualbox.org/) (if you want to build the VirtualBox box) - - [Ansible](http://docs.ansible.com/intro_installation.html) - -## Usage - -Make sure all the required software (listed above) is installed, then cd to the directory containing this README.md file, and run: - - $ packer build -var 'version=1.2.0' centos7.json - -After a few minutes, Packer should tell you the box was generated successfully, and the box was uploaded to Vagrant Cloud. - -> **Note**: This configuration includes a post-processor that pushes the built box to Vagrant Cloud (which requires a `VAGRANT_CLOUD_TOKEN` environment variable to be set); remove the `vagrant-cloud` post-processor from the Packer template to build the box locally and not push it to Vagrant Cloud. You don't need to specify a `version` variable either, if not using the `vagrant-cloud` post-processor. - -## Testing built boxes - -There's an included Vagrantfile that allows quick testing of the built Vagrant boxes. From this same directory, run one the following command after building the box: - - $ vagrant up - -## License - -MIT license. - -## Author Information - -Created in 2014 by [Jeff Geerling](https://www.jeffgeerling.com/), author of [Ansible for DevOps](https://www.ansiblefordevops.com/). +The public box is still available and updated on Vagrant Cloud: [`geerlingguy/centos7`](https://app.vagrantup.com/geerlingguy/boxes/centos7), but the build configuration has been moved to the consolidated project. \ No newline at end of file diff --git a/Vagrantfile b/Vagrantfile deleted file mode 100644 index f944f90..0000000 --- a/Vagrantfile +++ /dev/null @@ -1,25 +0,0 @@ -# -*- mode: ruby -*- -# vi: set ft=ruby : - -Vagrant.configure("2") do |config| - config.ssh.insert_key = false - config.vm.synced_folder '.', '/vagrant', type: 'nfs' - - # VirtualBox. - config.vm.define "virtualbox" do |virtualbox| - virtualbox.vm.hostname = "virtualbox-centos7" - virtualbox.vm.box = "file://builds/virtualbox-centos7.box" - virtualbox.vm.network :private_network, ip: "172.16.3.2" - - config.vm.provider :virtualbox do |v| - v.gui = false - v.memory = 1024 - v.cpus = 1 - v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"] - v.customize ["modifyvm", :id, "--ioapic", "on"] - end - - config.vm.provision "shell", inline: "echo Hello, World" - end - -end diff --git a/ansible/main.yml b/ansible/main.yml deleted file mode 100755 index 4df8845..0000000 --- a/ansible/main.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -- hosts: all - become: yes - gather_facts: yes - - roles: - - geerlingguy.nfs - - geerlingguy.packer_rhel diff --git a/builds/README.md b/builds/README.md deleted file mode 100755 index fbaa9ab..0000000 --- a/builds/README.md +++ /dev/null @@ -1 +0,0 @@ -This directory will contain built Vagrant box files. \ No newline at end of file diff --git a/centos7.json b/centos7.json deleted file mode 100755 index f36d023..0000000 --- a/centos7.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "variables": { - "version": "" - }, - "provisioners": [ - { - "type": "shell", - "execute_command": "echo 'vagrant' | {{.Vars}} sudo -S -E bash '{{.Path}}'", - "script": "scripts/ansible.sh" - }, - { - "type": "ansible-local", - "playbook_file": "ansible/main.yml", - "galaxy_file": "requirements.yml" - }, - { - "type": "shell", - "execute_command": "echo 'vagrant' | {{.Vars}} sudo -S -E bash '{{.Path}}'", - "script": "scripts/cleanup.sh" - } - ], - "builders": [ - { - "type": "virtualbox-iso", - "boot_command": [ - " text ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/ks.cfg" - ], - "boot_wait": "10s", - "disk_size": 81920, - "guest_os_type": "RedHat_64", - "headless": true, - "http_directory": "http", - "iso_urls": [ - "CentOS-7-x86_64-Minimal-1908.iso", - "http://mirrors.mit.edu/centos/7/isos/x86_64/CentOS-7-x86_64-Minimal-1908.iso" - ], - "iso_checksum_type": "sha256", - "iso_checksum": "9a2c47d97b9975452f7d582264e9fc16d108ed8252ac6816239a3b58cef5c53d", - "ssh_username": "vagrant", - "ssh_password": "vagrant", - "ssh_port": 22, - "ssh_wait_timeout": "10000s", - "shutdown_command": "echo 'vagrant'|sudo -S /sbin/halt -h -p", - "guest_additions_path": "VBoxGuestAdditions_{{.Version}}.iso", - "virtualbox_version_file": ".vbox_version", - "vm_name": "packer-centos-7-x86_64", - "vboxmanage": [ - [ - "modifyvm", - "{{.Name}}", - "--memory", - "512" - ], - [ - "modifyvm", - "{{.Name}}", - "--cpus", - "2" - ] - ] - } - ], - "post-processors": [ - [ - { - "output": "builds/{{.Provider}}-centos7.box", - "type": "vagrant" - }, - { - "type": "vagrant-cloud", - "box_tag": "geerlingguy/centos7", - "version": "{{user `version`}}" - } - ] - ] -} diff --git a/http/ks.cfg b/http/ks.cfg deleted file mode 100644 index f5ed706..0000000 --- a/http/ks.cfg +++ /dev/null @@ -1,83 +0,0 @@ -install -cdrom -lang en_US.UTF-8 -keyboard us -unsupported_hardware -network --bootproto=dhcp -rootpw vagrant -firewall --disabled -selinux --permissive -timezone UTC -unsupported_hardware -bootloader --location=mbr -text -skipx -zerombr -clearpart --all --initlabel -autopart -auth --enableshadow --passalgo=sha512 --kickstart -firstboot --disabled -eula --agreed -services --enabled=NetworkManager,sshd -reboot -user --name=vagrant --plaintext --password vagrant --groups=vagrant,wheel - -%packages --ignoremissing --excludedocs -@Base -@Core -@Development Tools -openssh-clients -sudo -openssl-devel -readline-devel -zlib-devel -kernel-headers -kernel-devel -net-tools -vim -wget -curl -rsync - -# unnecessary firmware --aic94xx-firmware --atmel-firmware --b43-openfwwf --bfa-firmware --ipw2100-firmware --ipw2200-firmware --ivtv-firmware --iwl100-firmware --iwl1000-firmware --iwl3945-firmware --iwl4965-firmware --iwl5000-firmware --iwl5150-firmware --iwl6000-firmware --iwl6000g2a-firmware --iwl6050-firmware --libertas-usb8388-firmware --ql2100-firmware --ql2200-firmware --ql23xx-firmware --ql2400-firmware --ql2500-firmware --rt61pci-firmware --rt73usb-firmware --xorg-x11-drv-ati-firmware --zd1211-firmware -%end - -%post -yum update -y - -# update root certs -wget -O/etc/pki/tls/certs/ca-bundle.crt http://curl.haxx.se/ca/cacert.pem - -# sudo -yum install -y sudo -echo "vagrant ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers.d/vagrant -sed -i "s/^.*requiretty/#Defaults requiretty/" /etc/sudoers - -yum clean all -%end diff --git a/requirements.yml b/requirements.yml deleted file mode 100644 index 569d245..0000000 --- a/requirements.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -- src: geerlingguy.packer_rhel -- src: geerlingguy.nfs diff --git a/scripts/ansible.sh b/scripts/ansible.sh deleted file mode 100644 index 0ea8a20..0000000 --- a/scripts/ansible.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -eux - -# Install Ansible. -yum -y install ansible diff --git a/scripts/cleanup.sh b/scripts/cleanup.sh deleted file mode 100644 index 0eff8cb..0000000 --- a/scripts/cleanup.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash -eux - -# Remove Ansible and its dependencies. -yum -y remove ansible - -# Zero out the rest of the free space using dd, then delete the written file. -dd if=/dev/zero of=/EMPTY bs=1M -rm -f /EMPTY - -# Add `sync` so Packer doesn't quit too early, before the large file is deleted. -sync