From fd92bcaa253f59f576cdeaf9ff5c163417108662 Mon Sep 17 00:00:00 2001 From: Erik Wilson Date: Sun, 21 Apr 2019 11:43:04 -0700 Subject: [PATCH] Add Vagrantfile for development use --- Vagrantfile | 74 +++++++++++++++++++++++++++++ scripts/vagrant-provision | 99 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 173 insertions(+) create mode 100644 Vagrantfile create mode 100755 scripts/vagrant-provision diff --git a/Vagrantfile b/Vagrantfile new file mode 100644 index 0000000000..1dadfef13c --- /dev/null +++ b/Vagrantfile @@ -0,0 +1,74 @@ +BOX = "generic/alpine39" +HOME = File.dirname(__FILE__) +PROJECT = File.basename(HOME) +MOUNT_TYPE = ENV['MOUNT_TYPE'] || "nfs" +NUM_NODES = (ENV['NUM_NODES'] || 0).to_i +NODE_CPUS = (ENV['NODE_CPUS'] || 4).to_i +NODE_MEMORY = (ENV['NODE_MEMORY'] || 8192).to_i +NETWORK_PREFIX = ENV['NETWORK_PREFIX'] || "10.135.135" +VAGRANT_PROVISION = ENV['VAGRANT_PROVISION'] || "./scripts/vagrant-provision" + +# --- Rules for /etc/sudoers to avoid password entry configuring NFS: +# %admin ALL = (root) NOPASSWD: /usr/bin/sed -E -e * -ibak /etc/exports +# %admin ALL = (root) NOPASSWD: /usr/bin/tee -a /etc/exports +# %admin ALL = (root) NOPASSWD: /sbin/nfsd restart +# --- May need to add terminal to System Preferences -> Security & Privacy -> Privacy -> Full Disk Access + +# --- Check for missing plugins +required_plugins = %w( vagrant-alpine vagrant-timezone ) +plugin_installed = false +required_plugins.each do |plugin| + unless Vagrant.has_plugin?(plugin) + system "vagrant plugin install #{plugin}" + plugin_installed = true + end +end +# --- If new plugins installed, restart Vagrant process +if plugin_installed === true + exec "vagrant #{ARGV.join' '}" +end + +provision = <