{"id":16854612,"url":"https://github.com/philpennock/etc-vagrant","last_synced_at":"2026-05-22T14:06:14.480Z","repository":{"id":145532768,"uuid":"104538277","full_name":"philpennock/etc-vagrant","owner":"philpennock","description":"My ~/etc/vagrant directory","archived":false,"fork":false,"pushed_at":"2021-02-02T17:06:50.000Z","size":24,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-24T17:18:09.451Z","etag":null,"topics":["openssh","testing","vagrant"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/philpennock.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-09-23T03:24:26.000Z","updated_at":"2021-04-30T02:36:56.000Z","dependencies_parsed_at":"2023-05-17T18:22:03.120Z","dependency_job_id":null,"html_url":"https://github.com/philpennock/etc-vagrant","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philpennock%2Fetc-vagrant","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philpennock%2Fetc-vagrant/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philpennock%2Fetc-vagrant/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philpennock%2Fetc-vagrant/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/philpennock","download_url":"https://codeload.github.com/philpennock/etc-vagrant/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244207670,"owners_count":20416100,"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":["openssh","testing","vagrant"],"created_at":"2024-10-13T13:56:07.180Z","updated_at":"2026-05-22T14:06:14.406Z","avatar_url":"https://github.com/philpennock.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"Phil's `~/etc/vagrant`\n======================\n\nThis repository started as “let's put common system setup scripts I create\ninto `~/etc/vagrant/` and then refer to them from `Vagrantfile` I have\nelsewhere, copying them into the local repo as-and-when if needed”.\n\nI then added a `stub/` sub-directory, intended to just hold a fast list of\nboxes in the `Vagrantfile` and bringing them up \"simply\", referencing the\nsetup scripts if need be.  I wanted one place to refer to all the boxes I\nmight reasonably care about, to populate `vagrant box list` and be able to\nbring up any one of those boxes as a near-empty image.\n\nI hit issues with one OS's official RelEng images being Rather Defective and\nadded lots of workarounds, via tunable attributes on the object defining the\nmachine we want to bring up.\n\nThen there was a call for testing snapshots of OpenSSH, coming up to a new\nrelease, and I decided to use what I had lying around.  I repeatedly automated\nthings until it was just `all.sh` to test on each of a bunch of machines and\npull back the configure/make report to a local directory.\n\n\n## Top Directory\n\nScripts suitable for referencing as a script provisioner from a `Vagrantfile`.\n\n`pt` is Pennock Tech, LLC, my company.  `ptlocal.foo.sh` references some tag\n`foo` which might be matched by some box.  The stub uses this for an `ostype`\nsuch as `debian-family`.\n\nThis is intended primarily for my use, so my own apt repo is automatically\nconfigured.  The setup assumes that I have an apt repo for a particular\ndistribution/release pairing, so some caution might be needed if extending the\nlist of D/R for which Vagrant images are wanted.\n\n\n## `auto/`\n\nIf you just want to bring up a box ASAP, this is the way.\n\nThis is a very thin shim around defining a simple box based purely on an\nenvironment variable, `PT_VAGRANT_BOX`, providing the box name.\n\nYou can use a few other variables to tune it further, see the file.\n\nBut at the simplest usage:\n\n    PT_VAGRANT_BOX=debian/buster64 vagrant up\n\nwill download the box and run it, with a VM named `buster64`, and running a\nDebian-specific tuning script `ptlocal.debian-family.sh`.\n\n\n## `simpler/`\n\nIf you're not familiar with Vagrant but can program, start here; it's not the\nsimplest Vagrantfile (empty, or about three lines) but shows the core of\nwhat's in `stub/` in a reduced way.\n\nWe define a Ruby class to hold our per-machine data; a list of instances of\nthat class, then we reference the Vagrant object to define a node for each\ninstance in the list.  We set a couple of environment variables and reference\na provisioning script, if it exists.\n\n```\nvagrant help\nvagrant status\nvagrant up centos-7\nvagrant ssh centos-7\n#...\nvagrant destroy centos-7\n```\n\nThat should be enough to get started with understanding what's going on with\nVagrant and the general style of what we're doing in `stub/`.  Stub has just\n... \"grown\" a lot.  From something which started out very much like\n`simpler/`.\n\nIf you change provisioning scripts when a machine is already up, use the\n`provision` sub-command to re-run them.\n\n\n## `stub/`\n\nAn organically-grown `Vagrantfile` which shows what you can do when your DSL\nis Ruby.  This has good and bad sides.\n\nThis `Vagrantfile` assumes that it is in `~/etc/vagrant/stub`.  (Well, it\nassumes that `~/etc/vagrant` is useful as a starting point, anyway).\n\nSome common shell/editor files I use get copied in, if their parent dir\nexists.  If you are not me, then they're not likely to.\n\nIf `PT_BUILD_ASSETS` is found in environ, then it's a whitespace-separated\nlist of paths to files which should be copied into `/tmp/` of the VM.\n\nIf `PT_BUILD_SCRIPTS` is found in environ, then it's a whitespace-separated\nlist of paths relative to `~/etc/vagrant`, which should be used as\nprovisioning scripts at the end of everything else.\n\nNote that some attempt is made to have the downloaded packages area of the\nguest VM be mapped to a cache area in the host OS, so that repeatedly bringing\nup the same OS will avoid needing to re-download everything.  This will be a\ndirectory called `Vagrant/` within one of a few places: `~/Library/Caches/` on\nmacOS, `$XDG_CACHE_HOME` `~/.cache/` if it exists, else a Vagrant environment\narea, _probably_ `~/.vagrant.d/cache`.\n\nIn addition, if `http_proxy` is a current environment variable when you invoke\nVagrant, then the value will be propagated into the guest.\n\nIf you have a command in your path called `not_at_home` and it returns false,\nthen you might experience breakage as the install scripts for apt-based\nsystems try to configure an HTTP proxy of `http://cheddar.lan:3142`, which is\nspecific to my environment.  For me, that's an `apt-cacher-ng` instance.\n\n\n## openssh\n\nTo build all expected OSes, edit `Version.sh` to be the snapshot date-stamp,\nthen invoke `./all.sh` from within that directory.  The list of images which\nwill be tested by default is within that `all.sh` script, as defaults for when\nno names are passed on argv.  Each machine will be brought up, OpenSSH\ninstalled and tested, the output of the configure/make-test copied back to a\nlocal logs dir, and the machine _suspended_, not destroyed.\n\nWhen done, you can bring out of suspension any machines of interest, or\ndestroy them all.\n\nArranging NFS syncing for some OSes will require sudo for Vagrant to auto-edit\n`/etc/exports`.  \u003chttps://www.vagrantup.com/docs/synced-folders/nfs.html\u003e has\ninstructions on how to make this passwordless.\n\nI use the `publish-reports` script to copy the files to where I make them\npublicly available.  It probably won't work for you and is not part of\n`all.sh`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphilpennock%2Fetc-vagrant","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphilpennock%2Fetc-vagrant","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphilpennock%2Fetc-vagrant/lists"}