Gem Version

VAGRANT TEMPLATED PLUGIN

Vagrant Templated is Vagrant plugin that add a new vagrant action to start a new Project. You will be able to choose between templates and start with a project with a Vagrantfile (and Berksfile) with cookbooks and configurations already configured.

I started this gem because every time I start a new project, for production or just testing something, after the traditional vagrant init I had look in others projects looking for a specific configuration (for example, a Rails 5 project)

Installation

With vagrant:

vagrant plugin install vagrant-templated

To use the Vagranfile and Berksfile created, you will need chefdk, vagrant-berkshelf and vagrant-omnibus.

Usage

The new init action runs like this:

vagrant templated init <template> [version]

The templates available at this moment are:

  • base
    • 1.0: apt and timezone update
  • vagrant-plugin:
    • 1.9: base, rbenv, ruby 2.3 and bundler
  • django:
    • 1.11: base, pyenv and python 2/3
  • rails:
    • 5.1: base, rbenv, ruby 2.4, bundler, node and postgresql
  • nodejs:
    • 6.11: base, nodenv and node 6.11

In both cases a Vagrantfile and a Berksfile will be generated where you executing the command. You should adapt these files to you projects, but it should work as a starting point.

Development

After checking out the repo, you just should vagrant up and enter the matrix. Everything is at /vagrant.

Inside the box run bundle install to install dependencies. Then, run bundle exec rake spec to run the tests. Run bundle exec vagrant templated init -h and help will arise.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/afaundes/vagrant-templated. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

TODO list

  • Add multiple choices for some components. For example, rails5 add postgresql by default, but it could be mysql or sqlite3 (that what I have used). Maybe it would better to add everything and leave everything commented but one default.
  • Display ad hoc tips when new files are created
  • Add tips as a command

License

The gem is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the Vagrant::Templated project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.