Giter Club home page Giter Club logo

osimages's Introduction

OS Images

These Packer templates create Ubuntu and CentOS Linux OVA images primarily via the VirtualBox builder. However, the templates are straightforward enough to be used as a based for other work:

Template Name OS Packer Builder Status
ubuntu2004.json Ubuntu 20.04 VirtualBox Working
ubuntu1804.json Ubuntu 18.04 VirtualBox Working
centos81911.json CentOS 8.1.1911 VirtualBox Working
centos72003.json CentOS 7.8.2003 VirtualBox Working
centos71911.json CentOS 7.7.1911 VirtualBox Working
centos71908.json CentOS 7.7.1908 VirtualBox Working
centos71908pvm.json CentOS 7.7.1908 Parallels Untested
centos71908ami.json CentOS 7.7.1908 AWS Untested

Prerequisites

These templates have been tested on macOS v10.15.4, and some on Windows 10. You need at least the following versions of these applications:

  • VirtualBox v6.1.6
  • Packer v1.5.6

Getting Started

Validate a specific template, then build the image. For example:

packer validate ubuntu1804.json
packer build ubuntu1804.json

Test the new OVA image with something like the vm utility (hosted here) to test the OVA image:

vm create dev1 output-virtualbox-iso/ubuntu1804.ova
vm start dev1
vm ssh dev1
vm imgimp output-virtualbox-iso/ubuntu1804.ova

Vagrant

Vagrant is another open-source software product for building and maintaining portable virtual software development environments. To use these OS images with Vagrant you can either:

  1. Run vagrant package [etc] against a VM created from one of these default OVA images, or

  2. Create a new template based on one of these templates, by adding a post-processors stanza, like this:

  "post-processors": [
    {
      "type": "vagrant",
      "keep_input_artifact": true,
      "output": "./centos72003.box",
      "vagrantfile_template": "./Vagrantfile"
    }
  ]

A Vagrantfile is included as example, but you'll need to read more of the Vagrant documentation for further use.

Of course, once you have a working Vagrantfile, you can test with commands such as:

vagrant up
vagrant ssh
vagrant destroy
vagrant box remove ubuntu1804

Parallels

Also included is a Packer template to create a Parallels PVM OS image. Note that this is a still a work in progress.

To play with this further, make sure you install Parallels v14.1.0 or above, and the Parallels Virtualization SDK, as well as the Vagrant provider (if using Vagrant):

brew cask install parallels-virtualization-sdk
vagrant plugin install vagrant-parallels

To build the images:

packer validate centos71908pvm.json   # Confirm template is good
packer build centos71908pvm.json      # Build CentOS 7 1908 Parallels PVM machine

Amazon

Also a Packer template to create an Amazon AMIs.

Tested from macOS v10.14.2, but should work on any Linux OS.

  • On target AWS account, create a packer IAM user, and attach below PackerBuilder policy.

    {
      "Version": "2012-10-17",
      "Statement": [
        {
          "Sid": "PackerBuilder",
          "Effect": "Allow",
          "Action": [
            "ec2:AttachVolume",
            "ec2:AuthorizeSecurityGroupIngress",
            "ec2:CopyImage",
            "ec2:CopyImage",
            "ec2:CreateImage",
            "ec2:CreateKeypair",
            "ec2:CreateSecurityGroup",
            "ec2:CreateSnapshot",
            "ec2:CreateTags",
            "ec2:CreateVolume",
            "ec2:DeleteKeypair",
            "ec2:DeleteSecurityGroup",
            "ec2:DeleteSnapshot",
            "ec2:DeleteVolume",
            "ec2:DeregisterImage",
            "ec2:DescribeImageAttribute",
            "ec2:DescribeImages",
            "ec2:DescribeInstances",
            "ec2:DescribeRegions",
            "ec2:DescribeSecurityGroups",
            "ec2:DescribeSnapshots",
            "ec2:DescribeSubnets",
            "ec2:DescribeTags",
            "ec2:DescribeVolumes",
            "ec2:DetachVolume",
            "ec2:GetPasswordData",
            "ec2:ModifyImageAttribute",
            "ec2:ModifyInstanceAttribute",
            "ec2:ModifySnapshotAttribute",
            "ec2:RegisterImage",
            "ec2:RunInstances",
            "ec2:StopInstances",
            "ec2:TerminateInstances"
          ],
          "Resource": "*"
        }
      ]
    }
    
  • Logon to target AWS account via CLI using above packer user.

  • Ensure aws_source_ami is the CentOS 7 image base you need.

  • Ensure aws_security_group_ids are valid EC2 Security Group IDs in your target AWS account

  • STILL UNDER CONSTRUCTION ... there are more parameters

Build image by doing the usual:

packer validate centos71908ami.json  # First, confirm template is good
packer build centos71908ami.json     # Build CentOS 7 AMI

osimages's People

Contributors

git719 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.