predat / packer-centos-template

packer-centos-template

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Packer CentOS template

Packer templates to bake VirtualBox images (vagrant).

Packer:

Provided Templates have been tested with following versions of Packer:

CentOS Releases Details:

Build Release Version
7 (1810) 7.6
7 (1804) 7.5
7 (1708) 7.4
7 (1611) 7.3
7 (1511) 7.2
7 (1503) 7.1
7 (1406) 7.0

Templates Variables Files:

CentOS Packer Templates:

Building with Packer for Local Usage

Baking:

$ make last

$ packer build -var-file vars/centos-7.6.1810.json vagrant-centos-local.json
$ packer build -var-file vars/centos-7.5.1804.json vagrant-centos-local.json
$ packer build -var-file vars/centos-7.4.1708.json vagrant-centos-local.json
$ packer build -var-file vars/centos-7.3.1611.json vagrant-centos-local.json
$ packer build -var-file vars/centos-7.2.1511.json vagrant-centos-local.json
$ packer build -var-file vars/centos-6.9.json vagrant-centos-local.json
$ packer build -var-file vars/centos-6.8.json vagrant-centos-local.json

Local Import:

$ vagrant box add 'sbeliakou/centos-7.6-x86_64-minimal' sbeliakou-vagrant-centos-7.6-x86_64-minimal.box
$ vagrant box add 'sbeliakou/centos-7.5-x86_64-minimal' sbeliakou-vagrant-centos-7.5-x86_64-minimal.box
$ vagrant box add 'sbeliakou/centos-7.4-x86_64-minimal' sbeliakou-vagrant-centos-7.4-x86_64-minimal.box
$ vagrant box add 'sbeliakou/centos-7.3-x86_64-minimal' sbeliakou-vagrant-centos-7.3-x86_64-minimal.box
$ vagrant box add 'sbeliakou/centos-7.2-x86_64-minimal' sbeliakou-vagrant-centos-7.2-x86_64-minimal.box
$ vagrant box add 'sbeliakou/centos-6.9-x86_64-minimal' sbeliakou-vagrant-centos-6.9-x86_64-minimal.box
$ vagrant box add 'sbeliakou/centos-6.7-x86_64-minimal' sbeliakou-vagrant-centos-6.7-x86_64-minimal.box

Images on Atlas / Vagrant Cloud:

VagrantCloud Search

Use boxes with Vagrant:

  • vagrant init sbeliakou/centos-7.6-x86_64-minimal; vagrant up --provider virtualbox
  • vagrant init sbeliakou/centos-7.5-x86_64-minimal; vagrant up --provider virtualbox
  • vagrant init sbeliakou/centos-7.4-x86_64-minimal; vagrant up --provider virtualbox
  • vagrant init sbeliakou/centos-7.3-x86_64-minimal; vagrant up --provider virtualbox
  • vagrant init sbeliakou/centos-7.2-x86_64-minimal; vagrant up --provider virtualbox
  • vagrant init sbeliakou/centos-6.9-x86_64-minimal; vagrant up --provider virtualbox
  • vagrant init sbeliakou/centos-6.8-x86_64-minimal; vagrant up --provider virtualbox

Vagrantfile

# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure("2") do |config|
  config.vm.box = "sbeliakou/centos"
  config.vm.box_version = "7.6"
end
# -*- mode: ruby -*-
# vi: set ft=ruby :

IP_ADDR = "192.168.56.15"
SERVER_NAME = "server-name.local.domain"

Vagrant.configure("2") do |config|
  config.vm.box = "sbeliakou/centos"

  config.vm.network :private_network, ip: IP_ADDR
  config.vm.network "forwarded_port", guest: 80, host: 8080

  config.vm.hostname = SERVER_NAME

  config.ssh.insert_key = false
  config.vm.provider "virtualbox" do |vb|
    vb.name = SERVER_NAME
    vb.gui = false
    vb.memory = "512"
  end

  config.vm.provision "shell", inline: <<-SHELL
    yum update -y  
  SHELL

  config.vm.post_up_message = "#{SERVER_NAME} IS READY"
end

About

packer-centos-template


Languages

Language:Shell 54.9%Language:Makefile 25.5%Language:Ruby 19.7%