{"id":15022695,"url":"https://github.com/puppetlabs/education-builds","last_synced_at":"2025-04-05T00:05:13.663Z","repository":{"id":66233167,"uuid":"2126568","full_name":"puppetlabs/education-builds","owner":"puppetlabs","description":"Bootstrap CentOS training VMs from scratch. Now with true versioning!","archived":false,"fork":false,"pushed_at":"2025-02-04T02:04:03.000Z","size":30131,"stargazers_count":82,"open_issues_count":1,"forks_count":57,"subscribers_count":44,"default_branch":"master","last_synced_at":"2025-03-28T23:03:32.227Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://tickets.puppetlabs.com/browse/TRAINVM/","language":"Ruby","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/puppetlabs.png","metadata":{"files":{"readme":"README.markdown","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2011-07-29T22:10:26.000Z","updated_at":"2025-03-07T10:37:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"ed8d2395-a633-4739-a31e-2a32446d7137","html_url":"https://github.com/puppetlabs/education-builds","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/puppetlabs%2Feducation-builds","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/puppetlabs%2Feducation-builds/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/puppetlabs%2Feducation-builds/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/puppetlabs%2Feducation-builds/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/puppetlabs","download_url":"https://codeload.github.com/puppetlabs/education-builds/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247266562,"owners_count":20910836,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-09-24T19:58:16.976Z","updated_at":"2025-04-05T00:05:13.633Z","avatar_url":"https://github.com/puppetlabs.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bootstrap CentOS VMs for training\nPacker build scripts and tools for master, training, or learning VMs, and classroom_in_a_box setup.\n\nSee versioned release notes at [ReleaseNotes.md](ReleaseNotes.md).\n\n## Usage\n\n1. If you are looking for info on `classroom_in_a_box`, look in that directory for a [README.md](classroom_in_a_box/README.md) file for instructions on how to set up a classroom_in_a_box machine.\n2. Install virtualbox, packer, vmware ovftool, bundler, and Xcode Command-Line Tools and ensure the binaries are in the path.\n    * Install Bundler\n      * `sudo gem install bundler`\n    * Install XCode Command-Line Tools\n      * `sudo xcode-select --install`\n      * `sudo xcodebuild -license`\n3. Run setup task to download and deploy base images:\n    * `bundle install`\n    * `rake setup`\n4. Builds are triggered by a rake task that handles local caching and wraps the\npacker command. To begin a build, run the corresponding rake task, for example\n`rake build_base['master']`. (Details on the available build tasks are included below.)\n5. To specify which version of PE to use for a base build, use the PE\\_FAMILY,\nPE\\_VERSION, and PRE\\_RELEASE environment variables, for example,\n`PE_FAMILY=2016.3 PRE_RELEASE=true rake build_base['learning']`. See the *Environment variables*\nsection below for details on how the correct version is derived from these\nvariables.\n\n## Detailed Usage\n\n### Rake tasks\n\nThe Rakefile includes rake tasks to build the following VMs:\n\n* training\n  * `build_base['training']`\n  * `build_main['training']`\n\n* master\n  * `build_base['master']`\n  * `build_main['master']`\n\n* learning\n  * `build_base['learning']`\n  * `build_main['learning']`\n\nIn addition, there are several tasks to help with caching, packaging, and\nrelated processes:\n\n* `cache_pe_installer`\n* `package_learning`\n* `ship['learning']`\n\n### Environment Variables\n\nThe version of PE cached and subsequently installed can be specified through a\ncombination of three environment variables:\n\n* **PE_VERSION**  \n  This specifies the verison of a PE release or pre-release to be cached and/or\n  used in a base build, for example `2016.2.0` for a release build or\n  `2016.3.0-rc1-141-g5e261dc` for a pre-release build. If this is unset or\n  set to `latest`, the version will default to the most recent release version\n  in the case of a release build or the latest pre-release build of the\n  specified family. (Note that currently setting `latest` for a release\n  build will always use the latest release version regardless of a specified\n  PE_FAMILY variable.)\n* **PE_FAMILY**  \n  Thos specifies a y-level release, such as `2016.2`. This can be specified\n  instead of PE_VERSION to get the latest pre-release for the specified family.\n* **PRE_RELEASE**  \n  If this is set to true, rake will use pre-release PE versions.\n\n* **STABLE_MODULES**\n  If this is set to true, rake will use the \"release\" branch of the pltraining\n  modules. Otherwise it defaults to using the \"master\".\n \nA build without PE_VERSION or PE_FAMILY specified will use the latest release\nversion of PE. A build with PRE_RELEASE set to true requires PE_VERSION or\nPE_FAMILY to be specified.\n\nThese environment variables are used to calculate corresponding values that are\npassed through to the packer command in the format `-var name=value`. This\nmethod of specifying variables takes precedence over variables specified\nelsewhere, so the version information set via environment variables will take\nprecedence over any specified version in the build template.\n\n* **AUTOMATED_BUILD**\n  If this is set to `true`, the build will skip the bailout message after the\n  build validation output.\n\n### Packer\n\nThe build tasks in the Rakefile wrap the `packer` tool, which is used to\nrun the VM builds. Packer can also be run directly.\n\nPacker scripts are provided in the `templates` directory. These depend on\npacker (\u003e= v0.10.0), VirtualBox, and ovftool.\n\nThe base VMs are the published puppetlabs vagrant boxes.  To download and\nprepare them, run `setup.sh`. This will create the output, file_cache, and\npacker_cache directories if they don't exist.  \n\nThe file_cache directory has a subfolder called \"installers\" for holding \nPE installer tarballs and another called gems for caching gems, the setup \nscript will create any necessary directories if they don't exist. If you'd like\nto keep those on a separate volume to save disk space, create symlinks before \nrunning the setup script. The installer is automatically cached by the\n`cache_pe_installer` rake task, which precedes all base build tasks and selects\na version of PE based on provided environment variables.\n\nThe common configuration options for the training, learning, and master VMs\nhave been set up in educationbase.json and VM-specific variables are set in\n*VMNAME*.json\n\nAfter the base VM is provisioned according to the settings in *VMNAME*.json, the\nbootstrap can be applied using educationbuild.json.\n\nFirst create a base VM without any bootstrap applied:\n- `packer build -var-file=templates/learning.json templates/educationbase.json`\n\nTo initiate a packer build of the learning vm on the base vm:\n- `packer build -var-file=templates/learning.json templates/educationbuild.json`\n\nFor the training vm follow the same two steps but with training.json:\n- `packer build -var-file=templates/training.json templates/educationbase.json`\n- `packer build -var-file=templates/training.json templates/educationbuild.json`\n\nThere are also several AMI builds in templates. These don't require a base build.\nTo build these, set up the AWS builder requirements as described in the packer\ndocumentation and use the following command:\n- `packer build -var-file=templates/learning.json templates/awsbuild.json`\n\n## Vagrant\nThere is a Vagrantfile that automates this process and builds on the\npuppetlabs/centos-7.2-x86_64-nocm base box.\n\nThe Vagrant boxes will use the current local files for building rather than \nchecking out the code from GitHub. They have full write access, to be aware that\nnew files in the repo be created and existing files may change.\n\nThere are three boxes specified.\n\nTo start a student vagrant box:\n- `vagrant up`\n\nTo start a training vagrant box for instructor use:\n- `vagrant up training`\n\nTo start a learning vagrant box:\n- `vagrant up learning`\n\n\n## Building with pre-released modules and code\nTo develop the VMs, you need to use modules and other code that haven't yet\nbeen merged to master or released to the Puppet Forge.\n\nThe modules used during the VM build are included in `build_files/Puppetfile`.\nSee the documentation [here](https://puppet.com/docs/pe/latest/code_management/puppetfile.html#creating-and-editing-puppetfiles)\nfor detailed information on specifying git refs in a Puppetfile. \n\n## Troubleshooting\n\n### Setup script\nIf the initial setup script fails, delete the contents of `output` and rerun.\n\n### Failed builds\nVM builds will fail if the output artifacts already exist.  You can avoid that\nby using the `--force` flag with packer.  If a build does fail on the OVA export\nyou can run the ovftool directly.  For example usage see `scripts/export-ova.sh`.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpuppetlabs%2Feducation-builds","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpuppetlabs%2Feducation-builds","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpuppetlabs%2Feducation-builds/lists"}