vagrant-invade 0.4.4 → 0.4.5
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 +4 -4
- data/Gemfile.lock +1 -1
- data/invade.yml.dist +11 -7
- data/lib/vagrant-invade/action/generate.rb +6 -5
- data/lib/vagrant-invade/action/validate.rb +20 -20
- data/lib/vagrant-invade/builder/provision/shell.rb +4 -3
- data/lib/vagrant-invade/builder/provision/shell_inline.rb +7 -6
- data/lib/vagrant-invade/generator/section/provision.rb +8 -8
- data/lib/vagrant-invade/generator/section/synced_folder.rb +3 -4
- data/lib/vagrant-invade/template/definition.erb +6 -6
- data/lib/vagrant-invade/template/network/private_network.erb +2 -1
- data/lib/vagrant-invade/template/network/public_network.erb +4 -4
- data/lib/vagrant-invade/template/provider/virtualbox.erb +1 -0
- data/lib/vagrant-invade/template/provider/vmware.erb +2 -1
- data/lib/vagrant-invade/template/provision/puppet_agent.erb +2 -1
- data/lib/vagrant-invade/template/provision/puppet_apply.erb +2 -1
- data/lib/vagrant-invade/template/provision/shell.erb +3 -2
- data/lib/vagrant-invade/template/provision/shell_inline.erb +3 -2
- data/lib/vagrant-invade/template/synced_folder/nfs.erb +2 -1
- data/lib/vagrant-invade/template/synced_folder/virtualbox.erb +1 -1
- data/lib/vagrant-invade/template/vm/vm.erb +2 -1
- data/lib/vagrant-invade/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7bf54260067f47e80923d6cd17aad5fd106b6a4f
|
|
4
|
+
data.tar.gz: d29622a60426162f6db16fa554cf102755b44295
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c4f988ba5de968dcbde596d846e7590abeef3d922b3b92e0149f89251a8a42f2784df5a0f5dc9dcae7b9f32c1fa667b5d2f6e6df03b2850f5e9a483e413ba77a
|
|
7
|
+
data.tar.gz: 08dad8d04de000b9e111432c2b0948f5f0b7ef355bd2b6503d84871b7a93581d06af8e1a78fe3087218bc93c442759099a433a6bff342bb8dc917bbab3899fe2
|
data/Gemfile.lock
CHANGED
data/invade.yml.dist
CHANGED
|
@@ -32,23 +32,27 @@ machines:
|
|
|
32
32
|
|
|
33
33
|
# Synced Folder settings
|
|
34
34
|
# synced_folder:
|
|
35
|
-
#
|
|
36
|
-
#
|
|
35
|
+
# www:
|
|
36
|
+
# type: nfs
|
|
37
37
|
# path: '/www'
|
|
38
38
|
# source: '..'
|
|
39
39
|
# mount_options:
|
|
40
40
|
# - nolock
|
|
41
|
+
#
|
|
42
|
+
# ssh:
|
|
43
|
+
# type: nfs
|
|
44
|
+
# path: '/home/vagrant/.ssh/'
|
|
45
|
+
# source: '/Users/$USER/.ssh/'
|
|
41
46
|
|
|
42
47
|
# provision:
|
|
43
|
-
#
|
|
44
|
-
# name: 'set-permissions'
|
|
48
|
+
# set-permissions:
|
|
45
49
|
# inline: 'chmod 777 /tmp'
|
|
46
50
|
|
|
47
|
-
#
|
|
48
|
-
# name: 'run-composer'
|
|
51
|
+
# run-composer:
|
|
49
52
|
# path: '/home/vagrant/provision/shell/run-composer.sh'
|
|
50
53
|
|
|
51
|
-
# puppet:
|
|
54
|
+
# puppet-agent:
|
|
55
|
+
# type: 'puppet'
|
|
52
56
|
# manifests_path: 'puppet/manifests'
|
|
53
57
|
# manifest_file: 'init.pp'
|
|
54
58
|
# module_path:
|
|
@@ -55,22 +55,23 @@ module VagrantPlugins
|
|
|
55
55
|
unless section['synced_folder'] == nil
|
|
56
56
|
part['synced_folder'] = ''
|
|
57
57
|
|
|
58
|
-
section['synced_folder'].each do |
|
|
59
|
-
parts = Generator::Section::SyncedFolder.new(machine,
|
|
58
|
+
section['synced_folder'].each do |name, data|
|
|
59
|
+
parts = Generator::Section::SyncedFolder.new(machine, data).generate
|
|
60
60
|
part['synced_folder'].concat(parts)
|
|
61
61
|
end
|
|
62
62
|
end
|
|
63
63
|
|
|
64
|
-
#
|
|
64
|
+
# PROVISION
|
|
65
65
|
unless section['provision'] == nil
|
|
66
66
|
part['provision'] = ''
|
|
67
67
|
|
|
68
|
-
section['provision'].each do |
|
|
69
|
-
parts = Generator::Section::Provision.new(machine,
|
|
68
|
+
section['provision'].each do |name, data|
|
|
69
|
+
parts = Generator::Section::Provision.new(machine, name, data).generate
|
|
70
70
|
part['provision'].concat(parts)
|
|
71
71
|
end
|
|
72
72
|
end
|
|
73
73
|
|
|
74
|
+
# PLUGIN
|
|
74
75
|
unless section['plugin'] == nil
|
|
75
76
|
part['plugin'] = ''
|
|
76
77
|
|
|
@@ -32,14 +32,14 @@ module VagrantPlugins
|
|
|
32
32
|
|
|
33
33
|
# VM
|
|
34
34
|
unless sections['vm'] == nil
|
|
35
|
-
@env[:ui].info("\n[Invade] #{machine.upcase}: Validating VM
|
|
35
|
+
@env[:ui].info("\n[Invade] #{machine.upcase}: Validating VM section...") unless quiet
|
|
36
36
|
|
|
37
37
|
sections['vm'] = Validator::VM.new(env, sections['vm']).validate
|
|
38
38
|
end
|
|
39
39
|
|
|
40
40
|
# NETWORK
|
|
41
41
|
unless sections['network'] == nil
|
|
42
|
-
@env[:ui].info("\n[Invade] #{machine.upcase}: Validating
|
|
42
|
+
@env[:ui].info("\n[Invade] #{machine.upcase}: Validating NETWORK section...") unless quiet
|
|
43
43
|
|
|
44
44
|
sections['network'].each do |type, network|
|
|
45
45
|
@env[:ui].info("\tNetwork: #{type}") unless quiet
|
|
@@ -51,52 +51,52 @@ module VagrantPlugins
|
|
|
51
51
|
when 'public', 'puplic_network', 'publicnetwork', 'public-network'
|
|
52
52
|
network = Validator::Network::PublicNetwork.new(@machine_name, network).validate
|
|
53
53
|
else
|
|
54
|
-
raise StandardError, "Network type unknown or not set. Please check
|
|
54
|
+
raise StandardError, "Network type unknown or not set. Please check network section in configuration."
|
|
55
55
|
end
|
|
56
56
|
end
|
|
57
57
|
end
|
|
58
58
|
|
|
59
59
|
# PROVIDER
|
|
60
60
|
unless sections['provider'] == nil
|
|
61
|
-
@env[:ui].info("\n[Invade] #{machine.upcase}: Validating
|
|
61
|
+
@env[:ui].info("\n[Invade] #{machine.upcase}: Validating PROVIDER section...") unless quiet
|
|
62
62
|
|
|
63
63
|
sections['provider'].each do |type, provider|
|
|
64
|
-
@env[:ui].info("
|
|
64
|
+
@env[:ui].info(" Provider: #{type}") unless quiet
|
|
65
65
|
case type
|
|
66
66
|
when 'virtualbox'
|
|
67
67
|
provider = Validator::Provider::VirtualBox.new(env, provider).validate
|
|
68
68
|
when 'vmware'
|
|
69
69
|
provider = Validator::Provider::VMware.new(env, provider).validate
|
|
70
70
|
else
|
|
71
|
-
raise StandardError, "Provider unknown or not set. Please check configuration
|
|
71
|
+
raise StandardError, "Provider unknown or not set. Please check provider section in configuration."
|
|
72
72
|
end
|
|
73
73
|
end
|
|
74
74
|
end
|
|
75
75
|
|
|
76
76
|
# SYNCED FOLDER
|
|
77
77
|
unless sections['synced_folder'] == nil
|
|
78
|
-
@env[:ui].info("\n[Invade] #{machine.upcase}: Validating
|
|
78
|
+
@env[:ui].info("\n[Invade] #{machine.upcase}: Validating SYNCED FOLDER section...") unless quiet
|
|
79
79
|
|
|
80
|
-
sections['synced_folder'].each do |
|
|
81
|
-
@env[:ui].info("
|
|
82
|
-
case type
|
|
80
|
+
sections['synced_folder'].each do |name, sf|
|
|
81
|
+
@env[:ui].info(" Synced Folder: #{name}") unless quiet
|
|
82
|
+
case sf['type']
|
|
83
83
|
when 'nfs'
|
|
84
84
|
sf = Validator::SyncedFolder::NFS.new(env, sf).validate
|
|
85
85
|
when 'vb'
|
|
86
86
|
sf = Validator::SyncedFolder::VB.new(env, sf).validate
|
|
87
87
|
else
|
|
88
|
-
raise StandardError, "Synced Folder type unknown or not set. Please check configuration
|
|
88
|
+
raise StandardError, "Synced Folder type unknown or not set. Please check synced folder section in configuration."
|
|
89
89
|
end
|
|
90
90
|
end
|
|
91
91
|
end
|
|
92
92
|
|
|
93
93
|
# PROVISION
|
|
94
94
|
unless sections['provision'] == nil
|
|
95
|
-
@env[:ui].info("\n[Invade] #{machine.upcase}: Validating
|
|
95
|
+
@env[:ui].info("\n[Invade] #{machine.upcase}: Validating PROVISION section...") unless quiet
|
|
96
96
|
|
|
97
|
-
sections['provision'].each do |
|
|
98
|
-
@env[:ui].info("
|
|
99
|
-
case type
|
|
97
|
+
sections['provision'].each do |name, provision|
|
|
98
|
+
@env[:ui].info(" Provision: #{name}") unless quiet
|
|
99
|
+
case provision['type']
|
|
100
100
|
when 'shell'
|
|
101
101
|
provision = Validator::Provision::Shell.new(env, provision).validate
|
|
102
102
|
when 'shellinline', 'shell-inline'
|
|
@@ -106,23 +106,23 @@ module VagrantPlugins
|
|
|
106
106
|
when 'puppet-agent', 'puppetagent', 'puppet-server', 'puppet-master'
|
|
107
107
|
provision = Validator::Provision::PuppetAgent.new(env, provision).validate
|
|
108
108
|
else
|
|
109
|
-
raise StandardError, "Provision type unknown or not set. Please check configuration
|
|
109
|
+
raise StandardError, "Provision type unknown or not set. Please check provision section in configuration."
|
|
110
110
|
end
|
|
111
111
|
end
|
|
112
112
|
end
|
|
113
113
|
|
|
114
114
|
# SSH
|
|
115
115
|
unless sections['ssh'] == nil
|
|
116
|
-
@env[:ui].info("\n[Invade] #{machine.upcase}: Validating SSH
|
|
116
|
+
@env[:ui].info("\n[Invade] #{machine.upcase}: Validating SSH section...") unless quiet
|
|
117
117
|
|
|
118
118
|
sections['ssh'] = Validator::SSH.new(env, sections['ssh']).validate
|
|
119
119
|
end
|
|
120
120
|
|
|
121
121
|
unless sections['plugin'] == nil
|
|
122
|
-
@env[:ui].info("\n[Invade] #{machine.upcase}: Validating
|
|
122
|
+
@env[:ui].info("\n[Invade] #{machine.upcase}: Validating PLUGIN section...") unless quiet
|
|
123
123
|
|
|
124
124
|
sections['plugin'].each do |type, plugin|
|
|
125
|
-
@env[:ui].info("
|
|
125
|
+
@env[:ui].info(" Plugin: #{type}") unless quiet
|
|
126
126
|
case type
|
|
127
127
|
when 'hostmanager'
|
|
128
128
|
plugin = Validator::Plugin::HostManager.new(env, plugin).validate
|
|
@@ -131,7 +131,7 @@ module VagrantPlugins
|
|
|
131
131
|
when 'r10k'
|
|
132
132
|
plugin = Validator::Plugin::R10k.new(env, plugin).validate
|
|
133
133
|
else
|
|
134
|
-
raise StandardError, "Plugin type unknown or not set. Please check configuration
|
|
134
|
+
raise StandardError, "Plugin type unknown or not set. Please check plugin section in configuration."
|
|
135
135
|
end
|
|
136
136
|
end
|
|
137
137
|
end
|
|
@@ -8,10 +8,11 @@ module VagrantPlugins
|
|
|
8
8
|
class Shell
|
|
9
9
|
|
|
10
10
|
attr_reader :result
|
|
11
|
-
attr_accessor :machine_name, :shell_data
|
|
11
|
+
attr_accessor :machine_name, :name, :shell_data
|
|
12
12
|
|
|
13
|
-
def initialize(machine_name, shell_data, result: nil)
|
|
13
|
+
def initialize(machine_name, name, shell_data, result: nil)
|
|
14
14
|
@machine_name = machine_name
|
|
15
|
+
@shell_name = name
|
|
15
16
|
@shell_data = shell_data
|
|
16
17
|
@result = result
|
|
17
18
|
end
|
|
@@ -26,7 +27,7 @@ module VagrantPlugins
|
|
|
26
27
|
machine_name = @machine_name
|
|
27
28
|
|
|
28
29
|
# Values for shell provision section
|
|
29
|
-
name = @
|
|
30
|
+
name = @shell_name
|
|
30
31
|
path = @shell_data['path']
|
|
31
32
|
binary = @shell_data['binary']
|
|
32
33
|
privileged = @shell_data['privileged']
|
|
@@ -5,15 +5,16 @@ module VagrantPlugins
|
|
|
5
5
|
|
|
6
6
|
require 'erubis'
|
|
7
7
|
|
|
8
|
-
class
|
|
8
|
+
class ShellInline
|
|
9
9
|
|
|
10
10
|
attr_reader :result
|
|
11
|
-
attr_accessor :machine_name, :shell_inline_data
|
|
11
|
+
attr_accessor :machine_name, :name, :shell_inline_data
|
|
12
12
|
|
|
13
|
-
def initialize(machine_name, shell_inline_data, result: nil)
|
|
13
|
+
def initialize(machine_name, name, shell_inline_data, result: nil)
|
|
14
14
|
@machine_name = machine_name
|
|
15
|
-
@
|
|
16
|
-
@
|
|
15
|
+
@shell_inline_name = name
|
|
16
|
+
@shell_inline_data = shell_inline_data
|
|
17
|
+
@result = result
|
|
17
18
|
end
|
|
18
19
|
|
|
19
20
|
def build
|
|
@@ -26,7 +27,7 @@ module VagrantPlugins
|
|
|
26
27
|
machine_name = @machine_name
|
|
27
28
|
|
|
28
29
|
# Values for shell provision section
|
|
29
|
-
name = @
|
|
30
|
+
name = @shell_inline_name
|
|
30
31
|
inline = @shell_inline_data['inline']
|
|
31
32
|
binary = @shell_inline_data['binary']
|
|
32
33
|
privileged = @shell_inline_data['privileged']
|
|
@@ -5,21 +5,21 @@ module VagrantPlugins
|
|
|
5
5
|
|
|
6
6
|
class Provision
|
|
7
7
|
|
|
8
|
-
attr_accessor :machine_name, :
|
|
8
|
+
attr_accessor :machine_name, :name, :provision_data
|
|
9
9
|
|
|
10
|
-
def initialize(machine_name,
|
|
10
|
+
def initialize(machine_name, name, provision_data)
|
|
11
11
|
@machine_name = machine_name
|
|
12
|
-
@
|
|
12
|
+
@name = name
|
|
13
13
|
@provision_data = provision_data
|
|
14
14
|
end
|
|
15
15
|
|
|
16
16
|
def generate
|
|
17
|
-
case @type
|
|
17
|
+
case @provision_data['type']
|
|
18
18
|
when 'shell'
|
|
19
|
-
provision = Builder::Provision::Shell.new(@machine_name, @provision_data)
|
|
20
|
-
when '
|
|
21
|
-
provision = Builder::Provision::ShellInline.new(@machine_name, @provision_data)
|
|
22
|
-
when 'puppet', '
|
|
19
|
+
provision = Builder::Provision::Shell.new(@machine_name, @name, @provision_data)
|
|
20
|
+
when 'shell-inline', 'inline', 'shellinline'
|
|
21
|
+
provision = Builder::Provision::ShellInline.new(@machine_name, @name, @provision_data)
|
|
22
|
+
when 'puppet', 'puppetapply', 'puppet-apply'
|
|
23
23
|
provision = Builder::Provision::PuppetApply.new(@machine_name, @provision_data)
|
|
24
24
|
when 'puppet-agent', 'puppetagent'
|
|
25
25
|
provision = Builder::Provision::PuppetAgent.new(@machine_name, @provision_data)
|
|
@@ -5,16 +5,15 @@ module VagrantPlugins
|
|
|
5
5
|
|
|
6
6
|
class SyncedFolder
|
|
7
7
|
|
|
8
|
-
attr_accessor :machine_name, :
|
|
8
|
+
attr_accessor :machine_name, :synced_folder_data
|
|
9
9
|
|
|
10
|
-
def initialize(machine_name,
|
|
10
|
+
def initialize(machine_name, synced_folder_data)
|
|
11
11
|
@machine_name = machine_name
|
|
12
|
-
@type = type
|
|
13
12
|
@synced_folder_data = synced_folder_data
|
|
14
13
|
end
|
|
15
14
|
|
|
16
15
|
def generate
|
|
17
|
-
case @type
|
|
16
|
+
case @synced_folder_data['type']
|
|
18
17
|
when 'vb', 'virtualbox'
|
|
19
18
|
synced_folder = Builder::SyncedFolder::VirtualBox.new(@machine_name, @synced_folder_data)
|
|
20
19
|
when 'nfs'
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
config.vm.define "<%= machine_name %>" do |<%= machine_name %>|
|
|
2
2
|
|
|
3
3
|
<% if vm %>
|
|
4
|
-
# VM
|
|
4
|
+
# --- VM Section ---
|
|
5
5
|
<%= vm %>
|
|
6
6
|
<% end %>
|
|
7
7
|
<% if network %>
|
|
8
|
-
# Network
|
|
8
|
+
# --- Network Section ---
|
|
9
9
|
<%= network %>
|
|
10
10
|
<% end %>
|
|
11
11
|
<% if provider %>
|
|
12
|
-
# Provider
|
|
12
|
+
# --- Provider Section ---
|
|
13
13
|
<%= provider %>
|
|
14
14
|
<% end %>
|
|
15
15
|
<% if synced_folder %>
|
|
16
|
-
# Synced
|
|
16
|
+
# --- Synced Folder Section ---
|
|
17
17
|
<%= synced_folder %>
|
|
18
18
|
<% end %>
|
|
19
19
|
<% if provision %>
|
|
20
|
-
# Provision
|
|
20
|
+
# --- Provision Section ---
|
|
21
21
|
<%= provision %>
|
|
22
22
|
<% end %>
|
|
23
23
|
<% if plugin %>
|
|
24
|
-
# Plugin
|
|
24
|
+
# --- Plugin Section
|
|
25
25
|
<%= plugin %>
|
|
26
26
|
<% end %>
|
|
27
27
|
end
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
|
+
<%= machine_name %>.vm.network "private_network"<% if ip %>, ip: "<%= ip %>"<% end %><% if dhcp %>, type: "<%= dhcp %>"<% end %><% if auto_config %>, auto_config: <%= auto_config %><% end %>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
<%= machine_name %>.vm.network "public_network"
|
|
3
|
+
<% if ip %>, ip: <%= ip %><% end %>
|
|
4
|
+
<% if type %>, type: <%= type %><% end %>
|
|
5
|
+
<% if auto_config %>, auto_config: <%= auto_config %><% end %>
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
|
|
2
|
+
<%= machine_name %>.vm.provision "shell",
|
|
3
|
+
path: '<%= path %>'<% if name %>, name: '<%= name %>'<% end %><% if binary %>, binary: <%= binary %><% end %><% if privileged %>, privileged: <%= privileged %><% end %>
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
|
|
2
|
+
<%= machine_name %>.vm.provision "shell",
|
|
3
|
+
inline: '<%= inline %>'<% if name %>, name: '<%= name %>'<% end %><% if binary %>, binary: <%= binary %><% end %><% if privileged %>, privileged: <%= privileged %><% end %>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
|
+
<%= machine_name %>.vm.synced_folder '<%= source %>', '<%= path %>',
|
|
2
3
|
type: 'nfs'<% if mount_options %>, mount_options: <%= mount_options %><% end %><% if enabled %>, disabled: true<% end %>
|
|
3
4
|
<% if uid %>
|
|
4
5
|
<%= machine_name %>.nfs.map_uid = <%= uid %>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<%= machine_name -%>.vm.synced_folder <%= source -%>, <%= path -%>, id: 'vagrant-root', owner: <%= owner -%>, <%= group -%>, mount_options: ["dmode=<%= dmode -%>,fmode=<%= fmode -%>], disabled: <%= enabled-%>
|
|
1
|
+
<%= machine_name -%>.vm.synced_folder <%= source -%>, <%= path -%>, id: 'vagrant-root', owner: <%= owner -%>, <%= group -%>, mount_options: ["dmode=<%= dmode -%>,fmode=<%= fmode -%>], disabled: <%= enabled-%>
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: vagrant-invade
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.4.
|
|
4
|
+
version: 0.4.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Lennart Stein
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2015-10-
|
|
11
|
+
date: 2015-10-31 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|