Vagrant plugin to install a Rancher server and agents on all vagrant guests.
vagrant plugin install vagrant-rancher
vagrant
command (for VirtualBox and VMWare, see private_network)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.
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 agentversion
(optional, default: 'latest'
): version (tag) of the Rancher server container to runport
(optional, default: 8080
): port to run the rancher server on in the case of the server, and communicate with in the case of the agentrancher_server_image
(optional, default: rancher/server
): Override default Rancher server image name. Allows for pull from a private registryserver_args
(optional, default: ''
): additional args to pass to the Docker run command when starting the Rancher serveragent_args
(optional, default: ''
): additional args to pass to the Docker run command when starting the Rancher agentinstall_agent
(optional, default: true
): install rancher-agent on guestlabels
(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 onproject
(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')See examples directory. For a quick setup of a Rancher environment running on RancherOS, see https://github.com/nextrevision/rancheros-vagrant.
bundle install
bundle exec vagrant ...
Bug reports and pull requests are welcome on GitHub at https://github.com/nextrevision/vagrant-rancher.
The gem is available as open source under the terms of the MIT License.