vagrant-itamae 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 7c79a9d68f9fca8d3626714355a9c5bec32cd6a3
4
+ data.tar.gz: bc9fe260e0b052af7b9ba51f8989f4aa32621269
5
+ SHA512:
6
+ metadata.gz: 73c7d01af52fc23bf1290dcfc3849b3faf141b91a524e14fb7543ebe075bb435479c9bfd4c16746a98f68f82948563aad654e28ce206025a00cb982388218fb0
7
+ data.tar.gz: 92061b089bfa433d94d4d5006d44ab128a7f45156678e271cdfc6354406ce341fe56fe342aa7222c69258a33fbadc2d04d5cebdb1b5c0cac563e85df37946fcd
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/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", 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,32 @@
1
+ # vagrant-itamae
2
+
3
+ vagrant-itamae is a vagrant plugin for [Itamae](https://github.com/ryotarai/itamae)
4
+
5
+ ## Example
6
+
7
+ ```ruby
8
+ Vagrant.configure('2') do |config|
9
+ config.vm.box = "ubuntu/trusty64"
10
+
11
+ config.vm.provision :itamae do |config|
12
+ # recipes(String or Array)
13
+ config.recipes = ['./recipe.rb']
14
+
15
+ config.json = './node.json'
16
+ end
17
+ end
18
+ ```
19
+
20
+ ## Installation
21
+
22
+ ```ruby
23
+ vagrant plugin install vagrant-itamae
24
+ ```
25
+
26
+ ## Contributing
27
+
28
+ 1. Fork it ( https://github.com/chiastolite/vagrant-itamae/fork )
29
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
30
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
31
+ 4. Push to the branch (`git push origin my-new-feature`)
32
+ 5. Create a new Pull Request
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,20 @@
1
+ module VagrantPlugins
2
+ module Itamae
3
+ class Config < Vagrant.plugin('2', :config)
4
+ attr_accessor :json
5
+ attr_accessor :recipes
6
+
7
+ def initialize
8
+ @recipes = UNSET_VALUE
9
+ @json = UNSET_VALUE
10
+ end
11
+
12
+ def finalize!
13
+ @recipes = [] if @recipes == UNSET_VALUE
14
+ @recipes = Array(@recipes)
15
+
16
+ @json = nil if @json == UNSET_VALUE
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,16 @@
1
+ module VagrantPlugins
2
+ module Itamae
3
+ class Plugin < Vagrant.plugin('2')
4
+ name 'itamae'
5
+ provisioner(:itamae) do
6
+ require_relative 'provisioner'
7
+ Provisioner
8
+ end
9
+
10
+ config(:itamae, :provisioner) do
11
+ require_relative 'config'
12
+ Config
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,18 @@
1
+ require 'itamae'
2
+
3
+ module VagrantPlugins
4
+ module Itamae
5
+ class Provisioner < Vagrant.plugin('2', :provisioner)
6
+ def provision
7
+ options = {
8
+ node_json: config.json,
9
+ host: @machine.ssh_info[:host],
10
+ port: @machine.ssh_info[:port],
11
+ user: @machine.ssh_info[:username],
12
+ key: @machine.ssh_info[:private_key_path][0]
13
+ }
14
+ ::Itamae::Runner.run(config.recipes, :ssh, options)
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,5 @@
1
+ module Vagrant
2
+ module Itamae
3
+ VERSION = "0.0.1"
4
+ end
5
+ end
@@ -0,0 +1,2 @@
1
+ require "vagrant-itamae/version"
2
+ require 'vagrant-itamae/plugin'
data/test/Vagrantfile ADDED
@@ -0,0 +1,13 @@
1
+ Vagrant.require_plugin('vagrant-itamae')
2
+ # vi: set ft=ruby :
3
+
4
+ VAGRANTFILE_API_VERSION = "2"
5
+
6
+ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
7
+ config.vm.box = "ubuntu/trusty64"
8
+
9
+ config.vm.provision :itamae do |config|
10
+ config.recipes = ['./recipe.rb']
11
+ config.json = './node.json'
12
+ end
13
+ end
data/test/foo ADDED
@@ -0,0 +1 @@
1
+ Hello
data/test/node.json ADDED
@@ -0,0 +1 @@
1
+ {"file_source": "foo"}
data/test/recipe.rb ADDED
@@ -0,0 +1,15 @@
1
+ package "git" do
2
+ action :install
3
+ end
4
+
5
+ remote_file '/home/vagrant/foo' do
6
+ source node['file_source']
7
+ end
8
+
9
+ directory '/tmp/itamae' do
10
+ action :create
11
+ mode '0777'
12
+ owner 'vagrant'
13
+ group 'vagrant'
14
+ end
15
+
@@ -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/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "vagrant-itamae"
8
+ spec.version = Vagrant::Itamae::VERSION
9
+ spec.authors = ["chiastolite"]
10
+ spec.email = ["chiastolite.1980@gmail.com"]
11
+ spec.summary = %q{Vagrant plugin for itamae}
12
+ spec.description = %q{Vagrant plugin for itamae}
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'
22
+
23
+ spec.add_development_dependency "bundler", "~> 1.6"
24
+ spec.add_development_dependency "rake", "~> 10.0"
25
+ end
metadata ADDED
@@ -0,0 +1,106 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: vagrant-itamae
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - chiastolite
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-08-21 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: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.6'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.6'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '10.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '10.0'
55
+ description: Vagrant plugin for itamae
56
+ email:
57
+ - chiastolite.1980@gmail.com
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - ".gitignore"
63
+ - Gemfile
64
+ - LICENSE.txt
65
+ - README.md
66
+ - Rakefile
67
+ - lib/vagrant-itamae.rb
68
+ - lib/vagrant-itamae/config.rb
69
+ - lib/vagrant-itamae/plugin.rb
70
+ - lib/vagrant-itamae/provisioner.rb
71
+ - lib/vagrant-itamae/version.rb
72
+ - test/Vagrantfile
73
+ - test/foo
74
+ - test/node.json
75
+ - test/recipe.rb
76
+ - vagrant-itamae.gemspec
77
+ homepage: ''
78
+ licenses:
79
+ - MIT
80
+ metadata: {}
81
+ post_install_message:
82
+ rdoc_options: []
83
+ require_paths:
84
+ - lib
85
+ required_ruby_version: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ required_rubygems_version: !ruby/object:Gem::Requirement
91
+ requirements:
92
+ - - ">="
93
+ - !ruby/object:Gem::Version
94
+ version: '0'
95
+ requirements: []
96
+ rubyforge_project:
97
+ rubygems_version: 2.4.1
98
+ signing_key:
99
+ specification_version: 4
100
+ summary: Vagrant plugin for itamae
101
+ test_files:
102
+ - test/Vagrantfile
103
+ - test/foo
104
+ - test/node.json
105
+ - test/recipe.rb
106
+ has_rdoc: