GithubHelp home page GithubHelp logo

andif888 / packer-ubuntu-vsphere-iso Goto Github PK

View Code? Open in Web Editor NEW
26.0 4.0 10.0 13 KB

This repo builds automatically Ubuntu VM templates (Ubuntu 20.04, 22.04) for VMware vSphere environment using Hashicorp's Packer and downloads ISOs automatically.

PowerShell 12.86% Shell 28.74% HCL 58.40%
packer ubuntu2004 ubuntu-server vsphere-iso ubuntu2204

packer-ubuntu-vsphere-iso's Introduction

packer-ubuntu-vsphere-iso

This repo builds automatically Ubuntu VM templates (Ubuntu 20.04, 22.04) for VMware vSphere environment using Hashicorp's Packer and downloads ISOs automatically.

With this repo VM templates for the following Ubuntu systems can be built.

  • Ubuntu Server 20.04
  • Ubuntu Server 22.04

You don't need do pre-download any Windows ISO. Ubuntu ISO files gets download automatically from public sources.

How to use this repo

Pre-requesites

Download or git clone https://github.com/andif888/packer-ubuntu-vsphere-iso.git this repo and make sure you have Packer Version 1.7.1 or later installed. If you don't know Packer, it's a single commandline binary which only needs to be on your PATH.

Step 1: Adjust variables

Rename the file variables.auto.pkrvars.hcl.sample to variables.auto.pkrvars.hcl and adjust the variables for your VMware vSphere environment. Some documentation on each variable is inside the sample file.

mv variables.auto.pkrvars.hcl.sample variables.auto.pkrvars.hcl
nano variables.auto.pkrvars.hcl

Step 2: Init Packer

Init Packer by using the following command. (Spot the dot at the end of the command!)

packer init .

Step 3: Build a VM Template

To build a VM template run one of the provided build-scripts.
For example to build a Ubuntu Server 20.04 template run:

./build-2004.sh

If you are on a Windows machine then use the build-*.ps1 files.

Optional: Template default credentials

the default credentials after a successful build are
Username: vagrant
Password: vagrant

If you would like to change the default ćredentials before a packer build, then you need to edit the following files:

  • variables.auto.pkrvars.hcl
  • user-data (Line 13.14; Line 41)

To generate an encypted password for user-data use the following command:

mkpasswd -m SHA-512 --rounds=4096

packer-ubuntu-vsphere-iso's People

Contributors

andif888 avatar j4v3l avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

packer-ubuntu-vsphere-iso's Issues

ssh-keygen

Hey, thank you very much for your ubuntu template! Yours actually works with just minor expected changes (user/pass etc)!

One question, how do you handle the ssh-keygen issue? I have an ugly solution which is to echo creating a systemclt unit to run once and disable itself. I was wondering if you had a better option?

Thanks for your work!!

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.