GithubHelp home page GithubHelp logo

stefb69 / packer-vsphere-cloud-init Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kalenarndt/packer-vsphere-cloud-init

0.0 0.0 0.0 25 KB

Repository for Packer vSphere templates that support cloud-init

Shell 16.61% HCL 83.39%

packer-vsphere-cloud-init's Introduction

Packer vSphere Cloud-Init

This repo contains templates that are specifically configured to be built with HashiCorp Packer and utilize Cloud-Init as the customization engine on VMware vSphere

Requirements

  • HashiCorp Packer 1.78
  • mkpasswd
    • Ubuntu - apt install whois
  • Internet Connection - Packer will download the Ubuntu ISO from the internet

Usage/Examples

Build Credentials

  1. Generate your SSH keys by running create-ssh-keys.sh
  2. Copy the contents of the packer.pub file
  3. Paste the contents on line 12 of templates/build.pkrvars.hcl
  4. Edit the build_username on line 9 of templates/build.pkrvars.hcl
  5. Edit the build_password on line 10 of templates/build.pkrvars.hcl
  6. In a linux terminal run mkpasswd -m sha-512 and enter your desired password
  7. Copy the output and edit the build_password_encrypted on line 11 of templates/build.pkrvars.hcl

vSphere Credentials

  1. Edit the vsphere_endpoint variable on line 8 of templates/vsphere.pkrvars.hcl
  2. Edit the vsphere_username variable on line 9 of templates/vsphere.pkrvars.hcl
  3. Edit the vsphere_password variable on line 10 of templates/vsphere.pkrvars.hcl

vSphere Settings

  1. Edit the vsphere_datacenter variable on line 14 of templates/vsphere.pkrvars.hcl
  2. Edit the vsphere_cluster variable on line 15 of templates/vsphere.pkrvars.hcl
  3. Edit the vsphere_datastore variable on line 16 of templates/vsphere.pkrvars.hcl
  4. Edit the vsphere_network variable on line 17 of templates/vsphere.pkrvars.hcl
  5. Edit the vsphere_folder variable on line 18 of templates/vsphere.pkrvars.hcl If these folders don't exist, Packer will create them.

Virtual Machine Settings

  1. Edit the vsphere_vm_version variable on line 22 of templates/vsphere.pkrvars.hcl to match the version your environment supports

Run

  1. Run build-ubuntu-20.sh

FAQ

I'm getting an error when Packer runs saying it can't find the ISO

  • This Packer setup downloads the Ubuntu Server ISO from a pre-determined URL located in templates/ubuntu/20/linux-ubuntu-server.auto.pkrvars.hcl
  • You can change the URL to something else or a newer release and re-run Packer
  • Packer may throw an error for a checksum mismatch and if it does you can copy the new value output via the terminal to the config file so that they match

Acknowledgements

Roadmap

  • Add dynamic fetching of public ssh key during build instead of manually requiring variable changes in build.hcl

  • Add additional distro's

    • CentOS

packer-vsphere-cloud-init's People

Contributors

kalenarndt 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.