vagrant-itamae-command 0.0.1

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
+ SHA1:
3
+ metadata.gz: b147cd69026b78557ee1f7b68e30f9a2f5073879
4
+ data.tar.gz: dee97fd884d0ded7ae107fa0f06bbae9d8f65222
5
+ SHA512:
6
+ metadata.gz: 05d34ae4fa486e4a00c5217ec798f8c0fb12db30e9a0e7bb7917890efea769abe0db9ad06cefe68412c533462785fc800abd1502868f454b840806b4c92c826a
7
+ data.tar.gz: 6047e9f72e29d0d6dbadd13043645674b20d3183d557d79375e706cb71b5127f5877bca01513c52f39a8d6968743b3cabe04d788038696b507087018cd03f79a
data/.gitignore ADDED
@@ -0,0 +1,15 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ *.bundle
11
+ *.so
12
+ *.o
13
+ *.a
14
+ mkmf.log
15
+ .vagrant
data/CHANGELOG.md ADDED
@@ -0,0 +1,10 @@
1
+ # Change Log
2
+
3
+ ## [v0.0.1](https://github.com/gendosu/vagrant-itamae-command/tree/v0.0.1) (2016-01-27)
4
+ **Merged pull requests:**
5
+
6
+ - refactoring [\#3](https://github.com/gendosu/vagrant-itamae-command/pull/3) ([gendosu](https://github.com/gendosu))
7
+
8
+
9
+
10
+ \* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
data/Gemfile ADDED
@@ -0,0 +1,12 @@
1
+ source 'https://rubygems.org'
2
+
3
+ group :development do
4
+ gem 'vagrant', github: 'mitchellh/vagrant'
5
+ end
6
+
7
+ group :plugins do
8
+ gem "vagrant-itamae-command", path: "."
9
+ end
10
+
11
+ # Specify your gem's dependencies in vagrant-itamae.gemspec
12
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 chiastolite
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,40 @@
1
+ # vagrant-itamae-command
2
+
3
+ vagrant-itamae-command is a vagrant plugin for [Itamae](https://github.com/ryotarai/itamae)
4
+
5
+ When used in conjunction with vagrant-serverspec.
6
+ "sudo_password" is duplicated
7
+ In order to use at the same time.
8
+ It was not required to call the Itamae
9
+
10
+ ## Example
11
+
12
+ ```ruby
13
+ Vagrant.configure('2') do |config|
14
+ config.vm.box = "ubuntu/trusty64"
15
+
16
+ config.vm.provision :itamae-command do |config|
17
+ # execute command with sudo privilege(true or false)
18
+ config.sudo = true
19
+
20
+ # recipes(String or Array)
21
+ config.recipes = ['./recipe.rb']
22
+
23
+ config.json = './node.json'
24
+ end
25
+ end
26
+ ```
27
+
28
+ ## Installation
29
+
30
+ ```ruby
31
+ vagrant plugin install vagrant-itamae-command
32
+ ```
33
+
34
+ ## Contributing
35
+
36
+ 1. Fork it ( https://github.com/gendosu/vagrant-itamae-command/fork )
37
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
38
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
39
+ 4. Push to the branch (`git push origin my-new-feature`)
40
+ 5. Create a new Pull Request
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,2 @@
1
+ require "vagrant-itamae-command/version"
2
+ require 'vagrant-itamae-command/plugin'
@@ -0,0 +1,36 @@
1
+ require 'logger'
2
+
3
+ module VagrantPlugins
4
+ module ItamaeCommand
5
+ class Config < Vagrant.plugin('2', :config)
6
+ attr_accessor :json
7
+ attr_accessor :yaml
8
+ attr_accessor :sudo
9
+ attr_accessor :recipes
10
+ attr_accessor :shell
11
+ attr_accessor :log_level
12
+
13
+ def initialize
14
+ @recipes = UNSET_VALUE
15
+ @json = UNSET_VALUE
16
+ @yaml = UNSET_VALUE
17
+ @sudo = UNSET_VALUE
18
+ @shell = UNSET_VALUE
19
+ @log_level = UNSET_VALUE
20
+ end
21
+
22
+ def finalize!
23
+ @recipes = [] if @recipes == UNSET_VALUE
24
+ @recipes = Array(@recipes)
25
+
26
+ @json = nil if @json == UNSET_VALUE
27
+ @yaml = nil if @yaml == UNSET_VALUE
28
+ @shell = nil if @shell == UNSET_VALUE
29
+
30
+ @sudo = false if @sudo == UNSET_VALUE
31
+
32
+ @log_level = ::Logger.const_get((@log_level == UNSET_VALUE ? :info : @log_level).upcase)
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,16 @@
1
+ module VagrantPlugins
2
+ module ItamaeCommand
3
+ class Plugin < Vagrant.plugin('2')
4
+ name 'itamae-command'
5
+ provisioner(:"itamae-command") do
6
+ require_relative 'provisioner'
7
+ Provisioner
8
+ end
9
+
10
+ config(:"itamae-command", :provisioner) do
11
+ require_relative 'config'
12
+ Config
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,21 @@
1
+ module VagrantPlugins
2
+ module ItamaeCommand
3
+ class Provisioner < Vagrant.plugin('2', :provisioner)
4
+ def provision
5
+ option_params = []
6
+ option_params << "--node_json=#{config.json}" if config.json
7
+ option_params << "--node_yaml=#{config.yaml}" if config.yaml
8
+ option_params << '--sudo' if config.sudo
9
+ option_params << "--shell=#{config.shell}" if config.shell
10
+ option_params << "--host=#{@machine.ssh_info[:host]}"
11
+ option_params << "--port=#{@machine.ssh_info[:port]}"
12
+ option_params << "--user=#{@machine.ssh_info[:username]}"
13
+ option_params << "--key=#{@machine.ssh_info[:private_key_path][0]}"
14
+
15
+ config.recipes.each do |recipe|
16
+ system("itamae ssh --vagrant #{option_params.join(' ')} #{recipe}")
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,5 @@
1
+ module Vagrant
2
+ module ItamaeCommand
3
+ VERSION = "0.0.1"
4
+ end
5
+ end
@@ -0,0 +1,25 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'vagrant-itamae-command/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "vagrant-itamae-command"
8
+ spec.version = Vagrant::ItamaeCommand::VERSION
9
+ spec.authors = ["gendosu"]
10
+ spec.email = ["gendosu@gmail.com"]
11
+ spec.summary = %q{Vagrant plugin for itamae command}
12
+ spec.description = %q{Vagrant plugin for itamae command}
13
+ spec.homepage = ""
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_dependency 'itamae', '~> 1.0', '>= 1.0.8'
22
+
23
+ spec.add_development_dependency "bundler", "~> 1.6"
24
+ spec.add_development_dependency "rake", "~> 10.0"
25
+ end
metadata ADDED
@@ -0,0 +1,104 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: vagrant-itamae-command
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - gendosu
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-01-27 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: itamae
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.0'
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 1.0.8
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - "~>"
28
+ - !ruby/object:Gem::Version
29
+ version: '1.0'
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: 1.0.8
33
+ - !ruby/object:Gem::Dependency
34
+ name: bundler
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '1.6'
40
+ type: :development
41
+ prerelease: false
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - "~>"
45
+ - !ruby/object:Gem::Version
46
+ version: '1.6'
47
+ - !ruby/object:Gem::Dependency
48
+ name: rake
49
+ requirement: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - "~>"
52
+ - !ruby/object:Gem::Version
53
+ version: '10.0'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - "~>"
59
+ - !ruby/object:Gem::Version
60
+ version: '10.0'
61
+ description: Vagrant plugin for itamae command
62
+ email:
63
+ - gendosu@gmail.com
64
+ executables: []
65
+ extensions: []
66
+ extra_rdoc_files: []
67
+ files:
68
+ - ".gitignore"
69
+ - CHANGELOG.md
70
+ - Gemfile
71
+ - LICENSE.txt
72
+ - README.md
73
+ - Rakefile
74
+ - lib/vagrant-itamae-command.rb
75
+ - lib/vagrant-itamae-command/config.rb
76
+ - lib/vagrant-itamae-command/plugin.rb
77
+ - lib/vagrant-itamae-command/provisioner.rb
78
+ - lib/vagrant-itamae-command/version.rb
79
+ - vagrant-itamae.gemspec
80
+ homepage: ''
81
+ licenses:
82
+ - MIT
83
+ metadata: {}
84
+ post_install_message:
85
+ rdoc_options: []
86
+ require_paths:
87
+ - lib
88
+ required_ruby_version: !ruby/object:Gem::Requirement
89
+ requirements:
90
+ - - ">="
91
+ - !ruby/object:Gem::Version
92
+ version: '0'
93
+ required_rubygems_version: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - ">="
96
+ - !ruby/object:Gem::Version
97
+ version: '0'
98
+ requirements: []
99
+ rubyforge_project:
100
+ rubygems_version: 2.5.1
101
+ signing_key:
102
+ specification_version: 4
103
+ summary: Vagrant plugin for itamae command
104
+ test_files: []