Giter Club home page Giter Club logo

packer-templates's Introduction

Packer Templates

Packer templates, mainly for use building boxes for Atlas.

Environment

โ– packer version && vagrant -v && vboxmanage --version
Packer v0.8.6
Vagrant 1.8.1
5.0.14r105127

Current boxes

Use existing template

Using alpine3.3.1 as an example:

  1. cd alpine3
  2. Edit alpine-3.3.1-x86_64.json 3. Update push.name to use the correct Atlas account name. 4. And anything else that interests you
  3. Edit sh_vars 6. Set ATLAS_USER_NAME to the correct Atlas account name.

To perform a local build simply run, packer build alpine-3.3.1-x86_64.json

To perform the build integrated with Atlas run, ../atlas.sh

Check syntax

$ packer validate alpine-3.3.1-x86_64.json

Test build

Note, this is a local build and will intentionally fail on the atlas post-processor. If it didn't it would push every build up to Atlas, probably not what is desired when the template is being developed, updated, and/or tested.

$ packer build alpine-3.3.1-x86_64.json

Note, to debug the VM boot process change headless to false in the template. Optionally, run PACKER_LOG=1 packer build alpine-3.3.1-x86_64.json to see output from Packer.

Deploy to Atlas

This will act accordingly to how the variables were set in sh_vars.

$ ../atlas.sh

NOTES

  • When the build is created on Atlas some variables need to be set before it will work. Namely, the two ATLAS_* variables from sh_vars & ../atlas.sh. The template is expecting these to be in the environment when Atlas performs the build. But, there is a chicken-and-egg issue with regards to, the template needs to be pushed to Atlas before the build variables can be edited... There does not currently appear to be a way to create a build without pushing a template first, which then triggers a build, which then fails... As such, the first build will probably fail until the ATLAS_USER_NAME and ATLAS_BOX_NAME variables are added in the Atlas Build Configuration Variables section.
  • CentOS 7 uses build_type="local", builds the box locally then pushes the built box up to Atlas. (versus alpine3 and centos6 which leverage remote Atlas builds.) The reason for this is, the version of virtualbox used by Atlas is older and the vbga repeatedly failed to build/install on CentOS 7...YMMV. Building the box locally with virtualbox v4.3.26 works correctly [for me].

Creating a new distribution/release template

  1. Create distribution specific directory structure. e.g. $ cp -r skel <New_Distro_or_Ver>
  2. Change to the directory
  3. Edit sh_vars and set the required variables.
  4. Run ../atlas.sh once to generate a skeleton Packer template.
  5. Edit the resulting template. Specific items which need to change are in <<>> (the description and push.name primarily.) Update the rest based on the needs of the distribution and the Packer template documentation. The iso_url, iso_checksum, and boot_comand would have to be set at the barest minimum. Add any additional builders or provisioners, etc.
  6. Create any applicable artifacts in http and scripts to be used by the template.

Check syntax

$ packer validate <template>

Test build

Note, this is a local build and will intentionally fail on the atlas post-processor. If it didn't it would push every build up to Atlas, probably not what is desired when the template is being developed, updated, and/or tested.

$ packer build <template>

Deploy to Atlas

This will act accordingly to how the variables wer set in sh_vars.

$ ../atlas.sh

packer-templates's People

Contributors

maier avatar bodgit avatar

Watchers

 avatar James Cloos avatar David C avatar Saswat Praharaj avatar Neelesh Pateriya avatar Fabio Giannetti avatar Chi Nguyen avatar  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.