vagrant-none-communicator 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 9a937bc2933977425adcfb1bc38bd442e62281015a57e690c7363919dd1b0871
4
+ data.tar.gz: 7e1e733fa897c138be35a148b8fcf10d6bafb97ec690896f730adebeacd2a23f
5
+ SHA512:
6
+ metadata.gz: 0cd8d5561df27227d2efe02fff1332a03f94f33c3435b2b50502d9e2984c41dc712de27947ad05dedae86cd50015f39e0fe49e447aac762f7098ab58c68e0863
7
+ data.tar.gz: 554088ce68cd0ff060e31cadc294168be4d623148db3bec7593b11d86c40c19e07da93d4af40a21c2a2fc83c4558814ab74b984ee8c8f40281b606b5557209df
@@ -0,0 +1,21 @@
1
+ on:
2
+ push:
3
+ branches:
4
+ - main
5
+ paths-ignore:
6
+ - 'CHANGELOG.md'
7
+
8
+ jobs:
9
+ build-gem:
10
+ name: Build gem
11
+ runs-on: ubuntu-18.04
12
+ steps:
13
+ - name: Code Checkout
14
+ uses: actions/checkout@v1
15
+ - name: Set Ruby
16
+ uses: ruby/setup-ruby@v1
17
+ with:
18
+ ruby-version: '2.6'
19
+ - name: Build RubyGem
20
+ run: gem build vagrant-none-communicator.gemspec
21
+ working-directory: ${{github.workspace}}
@@ -0,0 +1,20 @@
1
+ on:
2
+ push:
3
+ tags: '*'
4
+
5
+ jobs:
6
+ release:
7
+ name: Build and release gem
8
+ runs-on: ubuntu-18.04
9
+ steps:
10
+ - name: Code Checkout
11
+ uses: actions/checkout@v1
12
+ - name: Set Ruby
13
+ uses: ruby/setup-ruby@v1
14
+ with:
15
+ ruby-version: '2.6'
16
+ - name: Build and release
17
+ uses: cadwallion/publish-rubygems-action@master
18
+ env:
19
+ RUBYGEMS_API_KEY: ${{secrets.RUBYGEMS_API_KEY}}
20
+ RELEASE_COMMAND: rake release
data/.gitignore ADDED
@@ -0,0 +1,52 @@
1
+ # OS-specific
2
+ .DS_Store
3
+
4
+ # Editor swapfiles
5
+ .*.sw?
6
+ *~
7
+
8
+ # Vagrant stuff
9
+ acceptance_config.yml
10
+ boxes/*
11
+ /.vagrant
12
+ /website/.vagrant
13
+ /website/build
14
+ /vagrant-spec.config.rb
15
+ test/vagrant-spec/.vagrant/
16
+
17
+ # Bundler/Rubygems
18
+ *.gem
19
+ .bundle
20
+ pkg/*
21
+ tags
22
+ /Gemfile.lock
23
+ test/tmp/
24
+ vendor/
25
+ /exec
26
+ .ruby-bundle
27
+
28
+ # Documentation
29
+ _site/*
30
+ .yardoc/
31
+ doc/
32
+
33
+ # Python
34
+ *.pyc
35
+
36
+ # Rubinius
37
+ *.rbc
38
+
39
+ # IDE junk
40
+ .idea/*
41
+ *.iml
42
+ .project
43
+
44
+ # Ruby Managers
45
+ .rbenv
46
+ .rbenv-gemsets
47
+ .ruby-gemset
48
+ .ruby-version
49
+ .rvmrc
50
+
51
+ # Box storage for spec
52
+ test/vagrant-spec/boxes/*.box
data/CHANGELOG.md ADDED
@@ -0,0 +1,3 @@
1
+ # 0.1.0 (03/05/2021)
2
+
3
+ * Create vagrant-none-communicator for not connecting to Vagrant guests
data/Gemfile ADDED
@@ -0,0 +1,12 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
4
+
5
+ group :development do
6
+ if File.exist?(File.expand_path("../../vagrant", __FILE__))
7
+ gem 'vagrant', path: "../vagrant"
8
+ else
9
+ gem 'vagrant', :git => 'https://github.com/hashicorp/vagrant.git', branch: "main"
10
+ end
11
+ gem 'rake', '>= 12.3.3'
12
+ end
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2013-2014 Fábio Rehm
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,31 @@
1
+ # vagrant-none-communicator
2
+
3
+ This is a Vagrant communicator plugin that does not communicate with the guest. Instead, it replaces all the communicator functions with no op's. This might be useful if you have a non standard type guest that does not support common communicator formats such as ssh or winrm. Please be warned, this is NOT a recommended way to use Vagrant.
4
+
5
+ ## Some of the things that might go wrong
6
+
7
+ Since this plugin allows Vagrant connections to the guest to pass thru and not actually communicate with the guest there might be some unexpected/broken behaviour. Any actions that require running commands on the guest will NOT work while using this plugin. Some common features that fall into this bucket include:
8
+
9
+ * Synced folders will not be mounted in the guest
10
+ * Won't be able to change a guest's hostname
11
+ * Any provisioner that runs on the guest won't work as expected, including (but not limited to) `shell`, `ansible`, `docker`
12
+ * ...
13
+
14
+ ## Installation
15
+
16
+ ```
17
+ $ vagrant plugin install vagrant-none-communicator
18
+ ```
19
+
20
+ ## Example usage
21
+
22
+ ```
23
+ Vagrant.configure("2") do |config|
24
+
25
+ config.vm.box = "hashicorp/bionic64"
26
+
27
+ # Use the none communicator. Vagrant will not be able to
28
+ # communicate with the guest
29
+ config.vm.communicator = "none"
30
+ end
31
+ ```
data/Rakefile ADDED
@@ -0,0 +1,22 @@
1
+ require 'rubygems'
2
+ require 'bundler/setup'
3
+ require 'rake/testtask'
4
+ require 'rspec/core/rake_task'
5
+
6
+ # Immediately sync all stdout so that tools like buildbot can
7
+ # immediately load in the output.
8
+ $stdout.sync = true
9
+ $stderr.sync = true
10
+
11
+ # This installs the tasks that help with gem creation and
12
+ # publishing.
13
+ Bundler::GemHelper.install_tasks
14
+
15
+ namespace :test do
16
+ RSpec::Core::RakeTask.new(:unit) do |t|
17
+ t.pattern = "test/unit/**/*_test.rb"
18
+ t.rspec_opts = "--color"
19
+ end
20
+ end
21
+
22
+ task default: "test:unit"
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.1.0
@@ -0,0 +1,21 @@
1
+ begin
2
+ require "vagrant"
3
+ rescue LoadError
4
+ raise "Vagrant is required!"
5
+ end
6
+
7
+ require "vagrant-none-communicator/communicator"
8
+
9
+ module VagrantNoneCommunicator
10
+ class Plugin < Vagrant.plugin("2")
11
+ name "None communicator"
12
+ description <<-DESC
13
+ This plugins is bad it communicating! It does not communicate
14
+ with the guest, even when it says it does
15
+ DESC
16
+
17
+ communicator("none") do
18
+ Communicator
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,63 @@
1
+ require 'logger'
2
+
3
+ module VagrantNoneCommunicator
4
+ # This class provides no communication with the VM
5
+ class Communicator < Vagrant.plugin("2", :communicator)
6
+ def self.match?(machine)
7
+ # All machines are capable of not communicating
8
+ true
9
+ end
10
+
11
+ def initialize(machine)
12
+ @machine = machine
13
+ @logger = Log4r::Logger.new("vagrant::plugin::communication::none")
14
+ end
15
+
16
+ def wait_for_ready(timeout)
17
+ @logger.debug("always ready, never connecting")
18
+ true
19
+ end
20
+
21
+ def ready?
22
+ @logger.debug("ready! not actually going to connect")
23
+ # Always ready
24
+ true
25
+ end
26
+
27
+ def execute(command, opts=nil, &block)
28
+ @logger.debug("trying to run command #{command}")
29
+ @logger.debug("not actually going to do it!")
30
+ # Good exit status
31
+ return 0
32
+ end
33
+
34
+ def sudo(command, opts=nil, &block)
35
+ execute(command, opts, &block)
36
+ end
37
+
38
+ def download(from, to=nil)
39
+ @logger.debug("trying to download! Not acutally going to do it")
40
+ true
41
+ end
42
+
43
+ def test(command, opts=nil)
44
+ @logger.debug("trying to test! Not acutally going to do it")
45
+ execute(command, opts) == 0
46
+ end
47
+
48
+ def upload(from, to)
49
+ @logger.debug("trying to upload! Not acutally going to do it")
50
+ true
51
+ end
52
+
53
+ def reset!
54
+ @logger.debug("trying to reset! Not acutally going to do it")
55
+ true
56
+ end
57
+
58
+ def generate_environment_export(env_key, env_value)
59
+ template = machine_config_ssh.export_command_template
60
+ template.sub("%ENV_KEY%", env_key).sub("%ENV_VALUE%", env_value) + "\n"
61
+ end
62
+ end
63
+ end
@@ -0,0 +1,3 @@
1
+ module VagrantNoneCommunicator
2
+ VERSION = File.read(File.expand_path("../../../VERSION", __FILE__)).chop
3
+ end
@@ -0,0 +1,19 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ Gem::Specification.new do |gem|
4
+ gem.name = "vagrant-none-communicator"
5
+ gem.version = File.read('VERSION').chop
6
+ gem.authors = ["Sophia Castellarin"]
7
+ gem.email = ["scastellarin95@gmail.com"]
8
+ gem.description = "Vagrant communicator plugin for not communicating with guests"
9
+ gem.summary = "The Vagrant plugin will allow Vagrant to silently pass through not connecting to a guest"
10
+ gem.license = 'MIT'
11
+ gem.homepage = "https://github.com/soapy1/vagrant-none-communicator"
12
+
13
+ gem.add_development_dependency "rake", "~> 13.0"
14
+ gem.add_development_dependency "rspec", "~> 3.5.0"
15
+
16
+ gem.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features|testdrive)/}) }
17
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
18
+ gem.require_paths = ["lib"]
19
+ end
metadata ADDED
@@ -0,0 +1,85 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: vagrant-none-communicator
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Sophia Castellarin
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2021-05-03 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rake
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '13.0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '13.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rspec
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 3.5.0
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 3.5.0
41
+ description: Vagrant communicator plugin for not communicating with guests
42
+ email:
43
+ - scastellarin95@gmail.com
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - ".github/workflows/build.yml"
49
+ - ".github/workflows/release.yml"
50
+ - ".gitignore"
51
+ - CHANGELOG.md
52
+ - Gemfile
53
+ - LICENSE.txt
54
+ - README.md
55
+ - Rakefile
56
+ - VERSION
57
+ - lib/vagrant-none-communicator.rb
58
+ - lib/vagrant-none-communicator/communicator.rb
59
+ - lib/vagrant-none-communicator/version.rb
60
+ - vagrant-none-communicator.gemspec
61
+ homepage: https://github.com/soapy1/vagrant-none-communicator
62
+ licenses:
63
+ - MIT
64
+ metadata: {}
65
+ post_install_message:
66
+ rdoc_options: []
67
+ require_paths:
68
+ - lib
69
+ required_ruby_version: !ruby/object:Gem::Requirement
70
+ requirements:
71
+ - - ">="
72
+ - !ruby/object:Gem::Version
73
+ version: '0'
74
+ required_rubygems_version: !ruby/object:Gem::Requirement
75
+ requirements:
76
+ - - ">="
77
+ - !ruby/object:Gem::Version
78
+ version: '0'
79
+ requirements: []
80
+ rubygems_version: 3.0.3
81
+ signing_key:
82
+ specification_version: 4
83
+ summary: The Vagrant plugin will allow Vagrant to silently pass through not connecting
84
+ to a guest
85
+ test_files: []