0.0
No commit activity in last 3 years
No release in over 3 years
Vagrant plugin to install a Rancher server and agents on all Vagrant guests.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 1.11
~> 10.0
 Project Readme

vagrant-rancher

Vagrant plugin to install a Rancher server and agents on all vagrant guests.

Installation

vagrant plugin install vagrant-rancher

Requirements

  • Docker to be intalled and running on the guest (ideally via unix socket)
  • Guest to have an IP reachable by the host running the vagrant command (for VirtualBox and VMWare, see private_network)

Usage

Vagrant.configure("2") do |config|
  config.vm.box = "ubuntu/trusty64"
  config.vm.network "private_network", ip: "192.168.33.100"
  config.vm.provider "virtualbox" do |vb|
    vb.memory = "1024"
  end

  config.vm.provision :docker
  config.vm.provision "rancher" do |rancher|
    rancher.hostname = "192.168.33.100"
  end
end

The vagrant-rancher plugin requires the hostname being set to either a DNS name or IP that is reachable by the host running the vagrant command.

Options

  • hostname (required): the DNS name or IP of the rancher server (must be reachable by the host running the vagrant command)
  • role (optional, default: 'server'): either 'server' (to run the Rancher server) or 'agent' to only run the Rancher agent
  • version (optional, default: 'latest'): version (tag) of the Rancher server container to run
  • port (optional, default: 8080): port to run the rancher server on in the case of the server, and communicate with in the case of the agent
  • rancher_server_image (optional, default: rancher/server): Override default Rancher server image name. Allows for pull from a private registry
  • server_args (optional, default: ''): additional args to pass to the Docker run command when starting the Rancher server
  • agent_args (optional, default: ''): additional args to pass to the Docker run command when starting the Rancher agent
  • install_agent (optional, default: true): install rancher-agent on guest
  • labels (optional, default: []): array of key=value pairs of labels to assign to the agent (ex. ["role=server","env=local"])
  • deactivate (optional, default: false): deactivate the host in Rancher to prevent it from being scheduled on
  • project (optional, default: Default): the project to start the agent in (project will be created if it doesn't exist)
  • project_type (optional, default: cattle): the project type (one of 'cattle', 'swarm', or 'kubernetes')

Examples

See examples directory. For a quick setup of a Rancher environment running on RancherOS, see https://github.com/nextrevision/rancheros-vagrant.

Providers Tested

  • VirtualBox

Development

bundle install
bundle exec vagrant ...

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/nextrevision/vagrant-rancher.

License

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