{"id":20444088,"url":"https://github.com/tknerr/vagrant-managed-servers","last_synced_at":"2025-04-04T21:09:32.949Z","repository":{"id":56897239,"uuid":"10604766","full_name":"tknerr/vagrant-managed-servers","owner":"tknerr","description":"Enables Vagrant to ssh into and provision managed servers","archived":false,"fork":false,"pushed_at":"2019-09-19T08:43:01.000Z","size":190,"stargazers_count":183,"open_issues_count":16,"forks_count":30,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-03-28T20:09:27.779Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tknerr.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-06-10T16:40:10.000Z","updated_at":"2025-02-22T11:50:10.000Z","dependencies_parsed_at":"2022-08-21T01:50:52.091Z","dependency_job_id":null,"html_url":"https://github.com/tknerr/vagrant-managed-servers","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tknerr%2Fvagrant-managed-servers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tknerr%2Fvagrant-managed-servers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tknerr%2Fvagrant-managed-servers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tknerr%2Fvagrant-managed-servers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tknerr","download_url":"https://codeload.github.com/tknerr/vagrant-managed-servers/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247249530,"owners_count":20908212,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-15T09:51:11.219Z","updated_at":"2025-04-04T21:09:32.929Z","avatar_url":"https://github.com/tknerr.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Vagrant ManagedServers Provider\n\n[![Build Status](https://travis-ci.org/tknerr/vagrant-managed-servers.png?branch=master)](https://travis-ci.org/tknerr/vagrant-managed-servers)\n\nThis is a [Vagrant](http://www.vagrantup.com) 1.6+ plugin that adds a provider for \"managed servers\" to Vagrant, i.e. servers for which you have SSH access but no control over their lifecycle.\n\nSince you don't control the lifecycle:\n * `up` and `destroy` are re-interpreted as \"linking\" / \"unlinking\" vagrant with a managed server\n * once \"linked\", the `ssh`, `provision` and `share` commands work as expected, and `status` shows the managed server as either \"running\" or \"not reachable\"\n * `reload` will issue a reboot command on the managed server (cross your fingers ;-))\n * `halt`, `suspend` and `resume` are no-ops in this provider\n\nCredits: this provider was initially based on the [vagrant-aws](https://github.com/mitchellh/vagrant-aws) provider with the AWS-specific functionality stripped out.\n\n## Features\n\n* SSH into managed servers.\n* Provision managed servers with any built-in Vagrant provisioner.\n* Reboot a managed server.\n* Synced folder support.\n* Provide access to a managed server via Vagrant Share.\n\n## Usage\n\nInstall using the standard Vagrant plugin installation method:\n```\n$ vagrant plugin install vagrant-managed-servers\n```\n\nIn the Vagrantfile you can now use the `managed` provider and specify the managed server's hostname and credentials:\n```ruby\nVagrant.configure(\"2\") do |config|\n  config.vm.box = \"tknerr/managed-server-dummy\"\n\n  config.vm.provider :managed do |managed, override|\n    managed.server = \"foo.acme.com\"\n    override.ssh.username = \"bob\"\n    override.ssh.private_key_path = \"/path/to/bobs_private_key\"\n  end\nend\n```\n\nNext run `vagrant up --provider=managed` in order to \"link\" the vagrant VM with the managed server:\n```\n$ vagrant up --provider=managed\nBringing machine 'default' up with 'managed' provider...\n==\u003e default: Box 'tknerr/managed-server-dummy' could not be found. Attempting to find and install...\n    default: Box Provider: managed\n    default: Box Version: \u003e= 0\n==\u003e default: Loading metadata for box 'tknerr/managed-server-dummy'\n    default: URL: https://vagrantcloud.com/tknerr/managed-server-dummy\n==\u003e default: Adding box 'tknerr/managed-server-dummy' (v1.0.0) for provider: managed\n    default: Downloading: https://vagrantcloud.com/tknerr/managed-server-dummy/version/1/provider/managed.box\n    default: Progress: 100% (Rate: 122k/s, Estimated time remaining: --:--:--)\n==\u003e default: Successfully added box 'tknerr/managed-server-dummy' (v1.0.0) for 'managed'!\n==\u003e default: Linking vagrant with managed server foo.acme.com\n==\u003e default:  -- Server: foo.acme.com\n```\n\nOnce linked, you can run `vagrant ssh` to ssh into the managed server or `vagrant provision` to provision that server with any of the available vagrant provisioners:\n```\n$ vagrant provision\n...\n$ vagrant ssh\n...\n```\n\nIn some cases you might need to reboot the managed server via `vagrant reload`:\n```\n$ vagrant reload\n==\u003e default: Rebooting managed server foo.acme.com\n==\u003e default:  -- Server: foo.acme.com\n==\u003e default: Waiting for foo.acme.com to reboot\n==\u003e default: Waiting for foo.acme.com to reboot\n==\u003e default: Waiting for foo.acme.com to reboot\n==\u003e default:  foo.acme.com rebooted and ready.\n```\n\nIf you are done, you can \"unlink\" vagrant from the managed server by running `vagrant destroy`:\n```\n$ vagrant destroy -f\n==\u003e default: Unlinking vagrant from managed server foo.acme.com\n==\u003e default:  -- Server: foo.acme.com\n```\n\nIf you try any of the other VM lifecycle commands like `halt`, `suspend`, `resume`, etc... you will get a warning that these commands are not supported with the vagrant-managed-servers provider.\n\n## Box Format\n\nEvery provider in Vagrant must introduce a custom box format. This provider introduces a \"dummy box\" for the `managed` provider which is really nothing more than the required `metadata.json` with the provider name set to \"managed\".\n\nYou can use the [tknerr/managed-server-dummy](https://atlas.hashicorp.com/tknerr/boxes/managed-server-dummy) box like that:\n```ruby\nVagrant.configure(\"2\") do |config|\n  config.vm.box = \"tknerr/managed-server-dummy\"\n  ...\nend\n```\n\n## Configuration\n\nThis provider currently exposes only a single provider-specific configuration option:\n\n* `server` - The IP address or hostname of the existing managed server\n\nIt can be set like typical provider-specific configuration:\n\n```ruby\nVagrant.configure(\"2\") do |config|\n  # ... other stuff\n\n  config.vm.provider :managed do |managed|\n    managed.server = \"myserver.mydomain.com\"\n  end\nend\n```\n\n## Networks\n\nNetworking features in the form of `config.vm.network` are not\nsupported with `vagrant-managed-servers`. If any of these are\nspecified, Vagrant will emit a warning and just ignore it.\n\n## Synced Folders\n\nThere is minimal synced folders support for provisioning linux guests\nvia rsync, and for windows guests via either smb, winrm or rsync\n([see below](https://github.com/tknerr/vagrant-managed-servers#synced-folders-windows)).\n\nThis is good enough for all built-in Vagrant provisioners (shell,\nchef, and puppet) to work!\n\n## Windows support\nIt is possible to use this plugin to control pre-existing windows servers using\nWinRM instead of rsync, with a few prerequisites:\n\n* WinRM installed and running on the target machine\n* The account used to connect is a local account and also a local administrator (domain accounts don't work over basic auth)\n* WinRM basic authentication is enabled\n* WinRM unencrypted traffic is enabled\n\nFor more information, see the WinRM Gem [Troubleshooting Guide](https://github.com/WinRb/WinRM#troubleshooting)\n\nYour vagrantfile will look something like this:\n```ruby\nconfig.vm.define 'my-windows-server' do |windows|\n  windows.vm.communicator = :winrm\n  windows.winrm.username = 'vagrant'\n  windows.winrm.password = 'vagrant'\n  windows.vm.provider :managed do |managed, override|\n    managed.server = 'myserver.mydomain.com'\n  end\nend\n```\n\n### Synced Folders (Windows)\nIt is recommended that you install the `vagrant-winrm-syncedfolders` plugin for communicating with Windows guests (`vagrant plugin install vagrant-winrm-syncedfolders`). Once installed, Vagrant Managed Servers will try several different mechanisms to sync folders for Windows guests. In order of priority:\n\n1. [SMB](http://docs.vagrantup.com/v2/synced-folders/smb.html) - requires running from a Windows host, an Administrative console, and Powershell 3 or greater. Note that there is a known [bug](https://github.com/mitchellh/vagrant/issues/3139) which causes the Powershell version check to hang for Powershell 2\n2. [WinRM](https://github.com/cimpress-mcp/vagrant-winrm-syncedfolders) - uses the WinRM communicator and is reliable, but can be slow for large numbers of files.\n3. [RSync](http://docs.vagrantup.com/v2/synced-folders/rsync.html) - requires `rsync.exe` installed and on your path.\n\nVagrant will try to use the best folder synchronization mechanism given your host and guest capabilities, but you can force a different type of folder sync with the `type` parameter of the `synced_folder` property in your Vagrantfile.\n\n```ruby\nwindows.vm.synced_folder '.', '/vagrant', type: \"winrm\"\n```\n\n## Development\n\nTo work on the `vagrant-managed-servers` plugin, clone this repository out, and use\n[Bundler](http://gembundler.com) to get the dependencies:\n\n```\n$ bundle\n```\n\nOnce you have the dependencies, verify the unit tests pass with `rake`:\n\n```\n$ bundle exec rake\n```\n\nIf those pass, you're ready to start developing the plugin. You can test\nthe plugin without installing it into your Vagrant environment by using the\n`Vagrantfile` in the top level of this directory and use bundler to execute Vagrant.\n\nFirst, let's pretend we have a managed server by bringing up the `local_linux` vagrant VM with the default virtualbox provider:\n\n```\n$ bundle exec vagrant up local_linux\n```\n\nNow you can use the managed provider (defined in a separate VM named `managed_linux`) to ssh into or provision the actual managed server:\n\n```\n$ # link vagrant with the server\n$ bundle exec vagrant up managed_linux --provider=managed\n$ # ssh / provision\n$ bundle exec vagrant ssh managed_linux\n$ bundle exec vagrant provision managed_linux\n$ # unlink\n$ bundle exec vagrant destroy managed_linux\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftknerr%2Fvagrant-managed-servers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftknerr%2Fvagrant-managed-servers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftknerr%2Fvagrant-managed-servers/lists"}