1.7.7 • Published 3 years ago

vagrant-box v1.7.7

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

Vagrant Box

A portable environment that can be added to any project

Host Requirements


Software

You will need to have the software listed below present on your system

ℹ️ Run boostrap-hosts.sh to install required software on the host

  • Vagrant ( creating VM )
  • VirtualBox ( Virtualizer )
  • Ansible ( Provision using YAML )

Running on Window Sorry but you will need to manually install the dependencies for the time being. You will also need to install the vagrant-guest_ansible plugin

There are also quite a few gotchas with running in WSL which I will document when I have time

Usage

  1. Install
yarn add --dev vagrant-box
  1. Configure the values.yml file to add your project source and any Ansible playbooks you want to run.
  • The values.yml file is how values are loaded into the environment. Any local values or secrets should be stored in values.override.yml
  • You can have local provisioning files setup by storing them in /local_provision they will not be source controlled so that you can run provisioning specific to your setup
# myproject/values.yml

workspace:
  synced_folders:
    - name: my-project
      src: path/to/my/project
      dest: path/on/the/vm/myproject
  playbooks:
    - name: add dependencies
      playbook: provision/setup-env.yml
      run: always
  1. Add any secrets or local values to values.override.yml
# myproject/values.override.yml

workspace:
    aws:
      enabled: true
      default:
        access_key_id: XXXXX
        secret_access_key: XXXXXX
        region: us-west-2
        output: json
      profiles: 
        - name: dev
          role_arn: XXXXX
        - name: staging
          role_arn: XXXXX
        
  1. Run Vagrant
yarn run vb-up
  1. Connect to the VM
yarn run vb-ssh
vagrant@workspace > ls path/to/my/project

See package.json for shortcut scripts

Why?

Encapsulating your development environment for a projects has many benefits

  • Portability - you don't need to worry about the "works on my machine" situation
  • Version control - You can see the changes with the environment reflected in VC
  • Self documenting - because the various steps that are required to get the environment working are in code, new users can see at a glance what is involved.
  • Easier to maintain - Again because the step is in code you can more easily change it.
  • Time travel - You can easily start from a fresh environment or load snapshots of the environment in various states
  • Avoid dependency conflicts - Avoid weirdness for dependencies that you might not be aware of

1.7.3

3 years ago

1.7.2

3 years ago

1.7.1

3 years ago

1.7.0

3 years ago

1.6.0

3 years ago

1.7.7

3 years ago

1.7.6

3 years ago

1.7.5

3 years ago

1.7.4

3 years ago

1.5.4

3 years ago

1.5.3

3 years ago

1.5.2

3 years ago

1.5.1

3 years ago

1.4.2

3 years ago

1.5.0

3 years ago

1.4.1

3 years ago

1.4.0

3 years ago

1.3.1

3 years ago

1.3.0

3 years ago

1.1.0

3 years ago

1.0.0

3 years ago

0.5.0

3 years ago

0.4.0

3 years ago

0.3.2

3 years ago

0.3.1

3 years ago

0.3.0

3 years ago

0.2.0

3 years ago

0.1.0

3 years ago