All Projects → jantman → vagrant-r10k

jantman / vagrant-r10k

Licence: MIT license
UNSUPPORTED - SEEKING MAINTAINER - Vagrant middleware plugin to retrieve puppet modules using r10k.

Programming Languages

ruby
36898 projects - #4 most used programming language
shell
77523 projects
python
139335 projects - #7 most used programming language
Puppet
460 projects

Projects that are alternatives of or similar to vagrant-r10k

Jenkins Infra
Jenkins main control repo for R10k and our Puppet Enterprise managed infrastructure
Stars: ✭ 76 (+111.11%)
Mutual labels:  vagrant, puppet
Detectionlab
Automate the creation of a lab environment complete with security tooling and logging best practices
Stars: ✭ 3,237 (+8891.67%)
Mutual labels:  vagrant, vagrantfile
Vagrant Golang
A very easy to use golang environment for use with vagrant.
Stars: ✭ 104 (+188.89%)
Mutual labels:  vagrant, puppet
Ghtorrent Vagrant
A Vagrant box with Puppet provisioning for running GHTorrent locally
Stars: ✭ 6 (-83.33%)
Mutual labels:  vagrant, puppet
workstation-bootstrap
My r10k/puppet based workstation bootstrapping and configuration
Stars: ✭ 18 (-50%)
Mutual labels:  puppet, r10k
Vagrant Rails Dev
my vagrant rails development box
Stars: ✭ 16 (-55.56%)
Mutual labels:  vagrant, puppet
Primary Vagrant
An Apache based Vagrant configuration for helping you get the most out of WordPress Development
Stars: ✭ 192 (+433.33%)
Mutual labels:  vagrant, puppet
vagrant-puppetmaster
A simple vagrant setup exposing all permutations of puppetmaster roles
Stars: ✭ 19 (-47.22%)
Mutual labels:  vagrant, puppet
packer-vagrant-builder
Build Solaris,CentOS or Ubuntu Vagrant box with puppet rpm's
Stars: ✭ 49 (+36.11%)
Mutual labels:  vagrant, puppet
build-inspector
Inspect your builds to look for changes in filesystem, network traffic and running processes.
Stars: ✭ 12 (-66.67%)
Mutual labels:  vagrant, vagrantfile
Chassis
📦 Chassis is a virtual server for your WordPress site, built using Vagrant.
Stars: ✭ 602 (+1572.22%)
Mutual labels:  vagrant, puppet
kubernetes-cluster
Vagrant As Automation Script
Stars: ✭ 34 (-5.56%)
Mutual labels:  vagrant, vagrantfile
Wirbelsturm
Wirbelsturm is a Vagrant and Puppet based tool to perform 1-click local and remote deployments, with a focus on big data tech like Kafka.
Stars: ✭ 332 (+822.22%)
Mutual labels:  vagrant, puppet
Phalcon Vm
Vagrant configuration for PHP7, Phalcon 3.x and Zephir development.
Stars: ✭ 43 (+19.44%)
Mutual labels:  vagrant, puppet
devops
Setup & installers for databases, runtimes, queues etc. using Anaconda, Ansible, Vagrant, Docker, AWS, Puppet, automation etc.
Stars: ✭ 28 (-22.22%)
Mutual labels:  vagrant, puppet
Kubernetes Vagrant Centos Cluster
Setting up a distributed Kubernetes cluster along with Istio service mesh locally with Vagrant and VirtualBox, only PoC or Demo use.
Stars: ✭ 1,750 (+4761.11%)
Mutual labels:  vagrant, vagrantfile
sig-windows-dev-tools
This is a batteries included local development environment for Kubernetes on Windows.
Stars: ✭ 52 (+44.44%)
Mutual labels:  vagrant, vagrantfile
vagrant-ids
An Ubuntu 16.04 build containing Suricata, PulledPork, Bro, and Splunk
Stars: ✭ 21 (-41.67%)
Mutual labels:  vagrant, vagrantfile
vagrant-magento
**DEPRECATED**
Stars: ✭ 12 (-66.67%)
Mutual labels:  vagrant, puppet
puppet-magnum
rubygems.org/gems/puppet-magnum
Stars: ✭ 31 (-13.89%)
Mutual labels:  vagrant, puppet

Vagrant::R10k

Build Status Code Coverage Code Climate Gem Version Total Downloads Github Issues Project Status: Unsupported – The project has reached a stable, usable state but the author(s) have ceased all work on it. A new maintainer may be desired.

vagrant-r10k is a Vagrant 1.2+ middleware plugin to allow you to have just a Puppetfile and manifests in your vagrant project, and pull in the required modules via r10k. This plugin only works with the 'puppet' provisioner, not a puppet server. It expects you to have a Puppetfile in the same repository as your Vagrantfile.

Important Note: I no longer use this project anywhere, and am no longer able to maintain it. If anyone is interested in taking over as maintainer, please contact me.

Installation

$ vagrant plugin install vagrant-r10k

Note that if you include modules from a (the) forge in your Puppetfile, i.e. in the format

mod 'username/modulename'

instead of just git references, you will need the puppet rubygem installed and available. It is not included in the Gemfile so that users who only use git references won't have a new/possibly conflicting Puppet installation.

Usage

Add the following to your Vagrantfile, before the puppet section:

config.r10k.puppet_dir = 'dir' # the parent directory that contains your module directory and Puppetfile
config.r10k.puppetfile_path = 'dir/Puppetfile' # the path to your Puppetfile, within the repo

For the following example directory structure:

.
├── README.md
├── Vagrantfile
├── docs
│   └── foo.md
├── puppet
│   ├── Puppetfile
│   ├── manifests
│   │   └── default.pp
│   └── modules
└── someproject
    └── foo.something

The configuration for r10k and puppet would look like:

# r10k plugin to deploy puppet modules
config.r10k.puppet_dir = "puppet"
config.r10k.puppetfile_path = "puppet/Puppetfile"

# Provision the machine with the appliction
config.vm.provision "puppet" do |puppet|
  puppet.manifests_path = "puppet/manifests"
  puppet.manifest_file  = "default.pp"
  puppet.module_path = "puppet/modules"
end

If you provide an array of directories in puppet.module_path, vagrant-r10k will use the first directory listed for auto configuration. If you want to let r10k use a different directory, see below.

Puppet Forge Modules in Puppetfile

In order to prevent conflicts with other plugins and allow you to use whatever Puppet version you need, puppet itself is not included in this plugin. This means that, as-is, this plugin can't install Forge modules in your Puppetfile, only modules from Git or SVN. This is because installing Forge modules requires puppet itself to download the module.

The two possible ways to deal with this are:

  1. Only use git or svn repo references in your Puppetfile.
  2. Install puppet into Vagrant's gems

For #2, installing puppet into Vagrant's gems, simply vagrant plugin install puppet; for further information, see the vagrant plugin documentation. If you do this, you should probably ensure that puppet is present by putting something like this at the top of your Vagrantfile:

# test that puppet is installed as a Vagrant plugin
# you can't use ``Vagrant.has_plugin?("puppet")`` because Vagrant's built-in
# Puppet Provisioner provides a plugin named "puppet", so this always evaluates to true.
begin
  gem "puppet"
rescue Gem::LoadError
  raise "puppet is not installed in vagrant gems! please run 'vagrant plugin install puppet'"
end

If you want to check for a specific version of Puppet, you can replace the content of the begin block with something like:

  gem "puppet", ">=3.8"

Usage with explicit path to module installation directory

Add the following to your Vagrantfile, before the puppet section:

config.r10k.puppet_dir = 'dir' # the parent directory that contains your module directory and Puppetfile
config.r10k.puppetfile_path = 'dir/Puppetfile' # the path to your Puppetfile, within the repo
config.r10k.module_path = 'dir/moduledir' # the path where r10k should install its modules (should be same / one of those in puppet provisioner, will be checked)

For the following example directory structure:

.
├── README.md
├── Vagrantfile
├── docs
│   └── foo.md
├── puppet
│   ├── Puppetfile
│   ├── manifests
│   │   └── default.pp
│   ├── modules # your own modules
│   └── vendor # modules installed by r10k
└── someproject
└── foo.something

The configuration for r10k and puppet would look like:

# r10k plugin to deploy puppet modules
config.r10k.puppet_dir = "puppet"
config.r10k.puppetfile_path = "puppet/Puppetfile"
config.r10k.module_path = "puppet/vendor"

# Provision the machine with the appliction
config.vm.provision "puppet" do |puppet|
  puppet.manifests_path = "puppet/manifests"
  puppet.manifest_file  = "default.pp"
  puppet.module_path = ["puppet/modules", "puppet/vendor"]
end

Usage With Puppet4 Environment-Based Provisioner

Puppet4 discontinues use of the manifest_file and manifests_path parameters, and also makes the module_path parameter optional for Puppet. In cases where only environment and environment_path are specified, module_path will be parsed from the environment's environment.conf.

vagrant-r10k does not handle parsing environment.conf; you must still specify the module_path for r10k to deploy modules into.

Here is an example Vagrantfile (taken from vagrant-r10k's acceptance tests) for use with environment-based configuration. Note that config.r10k.module_path is still specified. You can see the directory structure of this example here.

Vagrant.configure("2") do |config|
  config.vm.box = "vagrantr10kspec"
  config.vm.network "private_network", type: "dhcp"

  # r10k plugin to deploy puppet modules
  config.r10k.puppet_dir = "environments/myenv"
  config.r10k.puppetfile_path = "environments/myenv/Puppetfile"
  config.r10k.module_path = "environments/myenv/modules"

  # Provision the machine with the appliction
  config.vm.provision "puppet" do |puppet|
    puppet.environment = "myenv"
    puppet.environment_path  = "environments"
  end
end

Getting Help

Bug reports, feature requests, and pull requests are always welcome. At this time, the GitHub Issues Tracker is the only place for support, so questions and comments are welcome there as well, but please be sure they haven't already been asked and answered.

Bug reports should include the following information in order to be investigated:

  1. A detailed description of the problem, including the behavior you expected and the actual behavior that you're observing.
  2. The output of vagrant plugin list showing all of the plugins you're running and their versions.
  3. The versions of Ruby (ruby --version) and Vagrant (vagrant --version) itself that you're running.
  4. A copy of the Vagrantfile that was being used. Please include all lines in it; if you have any confidential or proprietary information, feel free to replace usernames, passwords, URLs, IPs, etc. with "X"s, but please don't remove large portions of it.
  5. A debug-level log of the command you're having problems with. i.e. if your problem is experienced when running vagrant up, please include the full output of VAGRANT_LOG=debug vagrant up.

Contributing

  1. Fork it ( https://github.com/jantman/vagrant-r10k/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Add yourself to the "Contributors" list below.
  5. Push to the branch (git push origin my-new-feature)
  6. Create a new Pull Request

Contributors

Development

Note that developing vagrant plugins requires ruby 2.0.0 or newer. A .ruby-version is provided to get rvm to use 2.1.1.

Unit Tests

These will be automatically run by TravisCI for any pull requests or commits to the repository. To run manually:

bundle install --path vendor
bundle exec rake spec

Acceptance Tests

Unfortunately, "acceptance" testing Vagrant requires the various providers be functional; i.e. to test the VMWare Providers requires both a license for them from Hashicorp, and the VMWare products themselves. Similarly, testing the AWS providers requires an AWS account and actually running EC2 instances. As such, acceptance tests are provided separately for each provider.

Note that the acceptance tests are tested with bundler 1.7.14. Also note that the first time the VMWare provider is run in a given installation, it will present an interactive sudo prompt in order to be able to interact with VMWare.

Running Virtualbox acceptance tests:

bundle exec rake acceptance:virtualbox

When tests fail, they leave Virtualbox hostonlyifs around; this can quickly clutter up the system and cause other problems. As a result, after the virtualbox tests, we invoke the Vagrant VirtualBox Provider's delete_unused_host_only_networks method. This can also be manually run via bundle exec rake clean_vbox.

These tests may generate a lot of output; since there's no nice standalone junit XML viewer, it may be helpful to run the tests as:

bundle exec rake acceptance:virtualbox 2>&1 | tee acceptance.out

And then examine acceptance.out as needed.

Note that the vmware-workstation provider acceptance tests are not currently functional; I've only been able to get the VirtualBox acceptance tests working. If many users report vmware-specific problems, I'll give the tests another try. Helpful information for them is available at http://www.codingonstilts.com/2013/07/how-to-bundle-exec-vagrant-up-with.html and https://groups.google.com/d/topic/vagrant-up/J8J6LmhzBqM/discussion I had these working at some point, but have been unable to get them working since; it seems that (a bit painfully and ironically), mitchellh's vagrant-spec doesn't seem to work cleanly with Hashicorp's paid/licensed Vagrant providers.

Running (currently broken) VMWare Workstation acceptance tests:

bundle exec rake acceptance:vmware_workstation

Manually Testing Vagrant

For manual testing:

bundle install --path vendor
VAGRANT_LOG=debug bundle exec vagrant up

To use an existing project's Vagrantfile, you can just specify the directory that the Vagrantfile is in using the VAGRANT_CWD environment variable (i.e. prepend VAGRANT_CWD=/path/to/project to the above command).

Note that this will not work easily with the VMWare provider, or any other Hashicorp paid/licensed provider.

Debugging

Exporting VAGRANT_LOG=debug will also turn on debug-level logging for r10k.

Releasing

  1. Ensure all tests are passing, coverage is acceptable, etc.
  2. Increment the version number in lib/vagrant-r10k/version.rb
  3. Update CHANGES.md
  4. Push those changes to origin.
  5. bundle exec rake build
  6. bundle exec rake release

Acknowlegements

Thanks to the following people:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].