vagrant-bolt 0.1.2 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/spec.yml +71 -0
- data/.gitignore +2 -0
- data/.rubocop.yml +3 -8
- data/CHANGELOG.md +68 -2
- data/Gemfile +5 -4
- data/README.md +31 -16
- data/acceptance/components/bolt_spec.rb +27 -28
- data/acceptance/skeletons/advanced/Vagrantfile +2 -2
- data/acceptance/skeletons/base/Puppetfile +2 -0
- data/acceptance/skeletons/base/Vagrantfile +2 -1
- data/acceptance/skeletons/provisioner/Vagrantfile +1 -1
- data/acceptance/skeletons/trigger/Vagrantfile +1 -1
- data/acceptance/vagrant-spec.config.rb +3 -3
- data/lib/vagrant-bolt/command.rb +6 -6
- data/lib/vagrant-bolt/config/bolt.rb +31 -22
- data/lib/vagrant-bolt/config/global.rb +23 -5
- data/lib/vagrant-bolt/config_builder/config.rb +35 -5
- data/lib/vagrant-bolt/config_builder/monkey_patches.rb +2 -1
- data/lib/vagrant-bolt/config_builder/provisioner.rb +28 -4
- data/lib/vagrant-bolt/runner.rb +10 -10
- data/lib/vagrant-bolt/util/bolt.rb +13 -7
- data/lib/vagrant-bolt/util/config.rb +3 -2
- data/lib/vagrant-bolt/util/machine.rb +4 -3
- data/lib/vagrant-bolt/version.rb +1 -1
- data/spec/unit/config/bolt_spec.rb +8 -1
- data/spec/unit/config/global_spec.rb +4 -2
- data/spec/unit/runner/runner_spec.rb +37 -11
- data/spec/unit/util/bolt_spec.rb +26 -7
- metadata +9 -26
- data/.travis.yml +0 -28
- data/acceptance/skeletons/base/modules/facts/CHANGELOG.md +0 -26
- data/acceptance/skeletons/base/modules/facts/CONTRIBUTING.md +0 -279
- data/acceptance/skeletons/base/modules/facts/Gemfile +0 -98
- data/acceptance/skeletons/base/modules/facts/LICENSE +0 -201
- data/acceptance/skeletons/base/modules/facts/README.md +0 -45
- data/acceptance/skeletons/base/modules/facts/Rakefile +0 -8
- data/acceptance/skeletons/base/modules/facts/checksums.json +0 -42
- data/acceptance/skeletons/base/modules/facts/lib/puppet/functions/facts/group_by.rb +0 -14
- data/acceptance/skeletons/base/modules/facts/metadata.json +0 -62
- data/acceptance/skeletons/base/modules/facts/plans/info.pp +0 -16
- data/acceptance/skeletons/base/modules/facts/plans/init.pp +0 -13
- data/acceptance/skeletons/base/modules/facts/tasks/bash.json +0 -5
- data/acceptance/skeletons/base/modules/facts/tasks/bash.sh +0 -93
- data/acceptance/skeletons/base/modules/facts/tasks/init.json +0 -10
- data/acceptance/skeletons/base/modules/facts/tasks/powershell.json +0 -4
- data/acceptance/skeletons/base/modules/facts/tasks/powershell.ps1 +0 -56
- data/acceptance/skeletons/base/modules/facts/tasks/ruby.json +0 -4
- data/acceptance/skeletons/base/modules/facts/tasks/ruby.rb +0 -40
data/lib/vagrant-bolt/runner.rb
CHANGED
@@ -16,12 +16,12 @@ class VagrantBolt::Runner
|
|
16
16
|
# @param [Symbol, String] command The command of bolt to run; task or plan
|
17
17
|
# @param [String] name The name of the bolt task or plan to run
|
18
18
|
# @param [Hash] args A optional hash of bolt config overrides. No merging will be done with the overrides
|
19
|
-
# @example run('task', 'facts', {
|
19
|
+
# @example run('task', 'facts', {targets: ["machinename"]})
|
20
20
|
def run(command, name, **args)
|
21
21
|
@boltconfig = setup_overrides(command, name, **args)
|
22
|
-
# Don't run anything if there are
|
23
|
-
# TODO: Gate this in a more efficient manner. It is possible to run plans without a
|
24
|
-
return if @boltconfig.
|
22
|
+
# Don't run anything if there are targets to run it on
|
23
|
+
# TODO: Gate this in a more efficient manner. It is possible to run plans without a target list.
|
24
|
+
return if @boltconfig.target_list.nil?
|
25
25
|
|
26
26
|
@inventory_path = VagrantBolt::Util::Bolt.update_inventory_file(@env)
|
27
27
|
validate
|
@@ -44,14 +44,14 @@ class VagrantBolt::Runner
|
|
44
44
|
config = VagrantBolt::Util::Config.merge_config(config, @env.vagrantfile.config.bolt)
|
45
45
|
# Add any additional arguments to the config object
|
46
46
|
config.set_options(args) unless args.nil?
|
47
|
-
# Configure the
|
48
|
-
config.
|
49
|
-
config.
|
50
|
-
config.
|
47
|
+
# Configure the target_list based on the config
|
48
|
+
config.target_list ||= [config.targets - config.excludes].flatten.join(',') unless config.targets.empty? || config.targets.to_s.casecmp("all").zero?
|
49
|
+
config.target_list ||= [VagrantBolt::Util::Machine.machines_in_environment(@env).map(&:name) - config.excludes].flatten.join(',') if config.targets.to_s.casecmp("all").zero?
|
50
|
+
config.target_list ||= @machine.name.to_s unless config.excludes.include?(@machine.name.to_s)
|
51
51
|
|
52
52
|
# Ensure these are absolute paths to allow for running vagrant commands outside of the root dir
|
53
53
|
config.modulepath = VagrantBolt::Util::Config.relative_path(config.modulepath, @env.root_path)
|
54
|
-
config.
|
54
|
+
config.project = VagrantBolt::Util::Config.relative_path(config.project, @env.root_path)
|
55
55
|
|
56
56
|
config
|
57
57
|
end
|
@@ -63,7 +63,7 @@ class VagrantBolt::Runner
|
|
63
63
|
errors.merge!(@boltconfig.validate(@machine))
|
64
64
|
errors.merge!(validate_config)
|
65
65
|
|
66
|
-
errors.
|
66
|
+
errors.each_key do |key|
|
67
67
|
errors.delete(key) if errors[key].empty?
|
68
68
|
end
|
69
69
|
|
@@ -26,7 +26,12 @@ module VagrantBolt::Util
|
|
26
26
|
# Verbose and debug do not have --no flags so exclude them
|
27
27
|
next if ['verbose', 'debug', 'noop'].include?(key) && !value
|
28
28
|
|
29
|
-
arg =
|
29
|
+
arg = if key == 'debug'
|
30
|
+
'--log-level=debug'
|
31
|
+
else
|
32
|
+
value ? "--#{key}" : "--no-#{key}"
|
33
|
+
end
|
34
|
+
|
30
35
|
command << arg
|
31
36
|
when String
|
32
37
|
command << "--#{key} \'#{value}\'"
|
@@ -36,7 +41,7 @@ module VagrantBolt::Util
|
|
36
41
|
end
|
37
42
|
|
38
43
|
command << "--inventoryfile \'#{inventory_path}\'" unless inventory_path.nil?
|
39
|
-
command << "--
|
44
|
+
command << "--targets \'#{config.target_list}\'" unless config.target_list.nil?
|
40
45
|
command << config.args unless config.args.nil?
|
41
46
|
command.flatten.join(" ")
|
42
47
|
end
|
@@ -45,12 +50,12 @@ module VagrantBolt::Util
|
|
45
50
|
# @param env [Object] The env object
|
46
51
|
# @return [Hash] The hash of config options for the inventory.yaml
|
47
52
|
def self.generate_inventory_hash(env)
|
48
|
-
inventory = { '
|
53
|
+
inventory = { 'targets' => [] }
|
49
54
|
inventory.merge!(env.vagrantfile.config.bolt.inventory_config.compact)
|
50
|
-
VagrantBolt::Util::Machine.
|
55
|
+
VagrantBolt::Util::Machine.machines_in_environment(env).each do |vm|
|
51
56
|
next unless VagrantBolt::Util::Machine.running?(vm)
|
52
57
|
|
53
|
-
inventory['
|
58
|
+
inventory['targets'] << generate_node_hash(vm)
|
54
59
|
end
|
55
60
|
inventory.compact
|
56
61
|
end
|
@@ -64,18 +69,19 @@ module VagrantBolt::Util
|
|
64
69
|
ssh_info = machine.ssh_info
|
65
70
|
return node_hash if ssh_info.nil?
|
66
71
|
|
67
|
-
node_hash['alias'] = machine.name.to_s
|
68
72
|
machine_config = machine.config.bolt.inventory_config
|
69
73
|
node_hash['config'] = {}
|
70
74
|
transport = VagrantBolt::Util::Machine.windows?(machine) ? 'winrm' : 'ssh'
|
71
75
|
node_hash['config'][transport] = machine_transport_hash(machine, machine_config, ssh_info).compact
|
72
76
|
node_hash['config']['transport'] = transport
|
73
|
-
node_hash['
|
77
|
+
node_hash['uri'] = "#{transport}://#{ssh_info[:host]}:#{node_hash['config'][transport]['port']}"
|
74
78
|
machine_config.each do |key, value|
|
75
79
|
next if key == 'config' || value.nil? || value.empty?
|
76
80
|
|
77
81
|
node_hash[key] = value
|
78
82
|
end
|
83
|
+
node_hash['name'] ||= machine.name.to_s
|
84
|
+
node_hash['alias'] = machine.name.to_s if node_hash['alias'].nil? && node_hash['name'] != machine.name.to_s
|
79
85
|
node_hash.compact
|
80
86
|
end
|
81
87
|
|
@@ -18,10 +18,11 @@ module VagrantBolt::Util
|
|
18
18
|
[other, local].each do |obj|
|
19
19
|
obj.instance_variables.each do |key|
|
20
20
|
value = obj.instance_variable_get(key)
|
21
|
-
|
21
|
+
case value
|
22
|
+
when Array
|
22
23
|
res_value = result.instance_variable_get(key)
|
23
24
|
value = (value + res_value).uniq if res_value.is_a? Array
|
24
|
-
|
25
|
+
when Hash
|
25
26
|
res_value = result.instance_variable_get(key)
|
26
27
|
value = res_value.merge(value) if res_value.is_a? Hash
|
27
28
|
end
|
@@ -21,9 +21,10 @@ module VagrantBolt::Util
|
|
21
21
|
notify: [:stdout, :stderr],
|
22
22
|
env: { PATH: ENV["VAGRANT_OLD_ENV_PATH"] },
|
23
23
|
) do |io_name, data|
|
24
|
-
|
24
|
+
case io_name
|
25
|
+
when :stdout
|
25
26
|
localui.info data
|
26
|
-
|
27
|
+
when :stderr
|
27
28
|
localui.warn data
|
28
29
|
end
|
29
30
|
end
|
@@ -32,7 +33,7 @@ module VagrantBolt::Util
|
|
32
33
|
# Generate a list of active machines in the environment
|
33
34
|
# @param env [Object] The Environment
|
34
35
|
# @return [Array<Object>]
|
35
|
-
def self.
|
36
|
+
def self.machines_in_environment(env)
|
36
37
|
env.active_machines.map { |vm|
|
37
38
|
begin
|
38
39
|
env.machine(*vm)
|
data/lib/vagrant-bolt/version.rb
CHANGED
@@ -72,6 +72,7 @@ describe VagrantBolt::Config::Bolt do
|
|
72
72
|
context "defaults" do
|
73
73
|
expected_values = {
|
74
74
|
nodes: [],
|
75
|
+
targets: [],
|
75
76
|
excludes: [],
|
76
77
|
}
|
77
78
|
expected_values.each do |val, expected|
|
@@ -86,6 +87,7 @@ describe VagrantBolt::Config::Bolt do
|
|
86
87
|
"command",
|
87
88
|
"params",
|
88
89
|
"node_list",
|
90
|
+
"target_list",
|
89
91
|
"user",
|
90
92
|
"password",
|
91
93
|
"port",
|
@@ -99,9 +101,12 @@ describe VagrantBolt::Config::Bolt do
|
|
99
101
|
"verbose",
|
100
102
|
"debug",
|
101
103
|
"host_key_check",
|
104
|
+
"machine_alias",
|
105
|
+
"machine_name",
|
102
106
|
"modulepath",
|
103
107
|
"bolt_exe",
|
104
108
|
"boltdir",
|
109
|
+
"project",
|
105
110
|
"noop",
|
106
111
|
]
|
107
112
|
expected_nil.each do |val|
|
@@ -120,12 +125,13 @@ describe VagrantBolt::Config::Bolt do
|
|
120
125
|
"password" => "foo",
|
121
126
|
"port" => "22",
|
122
127
|
"run-as" => "root",
|
128
|
+
"user" => "Admin",
|
123
129
|
"host-key-check" => false,
|
124
130
|
},
|
125
131
|
"winrm" => {
|
126
132
|
"password" => "foo",
|
127
133
|
"port" => "22",
|
128
|
-
"
|
134
|
+
"user" => "Admin",
|
129
135
|
"ssl" => false,
|
130
136
|
},
|
131
137
|
},
|
@@ -134,6 +140,7 @@ describe VagrantBolt::Config::Bolt do
|
|
134
140
|
before(:each) do
|
135
141
|
subject.password = 'foo'
|
136
142
|
subject.run_as = 'root'
|
143
|
+
subject.user = 'Admin'
|
137
144
|
subject.port = '22'
|
138
145
|
subject.ssl = false
|
139
146
|
subject.host_key_check = false
|
@@ -26,7 +26,7 @@ describe VagrantBolt::Config::Global do
|
|
26
26
|
|
27
27
|
expected_values = {
|
28
28
|
bolt_exe: "/opt/puppetlabs/bin/bolt",
|
29
|
-
|
29
|
+
project: ".",
|
30
30
|
}
|
31
31
|
expected_values.each do |val, expected|
|
32
32
|
it "defaults #{val} to #{expected}" do
|
@@ -70,12 +70,13 @@ describe VagrantBolt::Config::Global do
|
|
70
70
|
"password" => "foo",
|
71
71
|
"port" => "22",
|
72
72
|
"run-as" => "root",
|
73
|
+
"user" => "Admin",
|
73
74
|
"host-key-check" => false,
|
74
75
|
},
|
75
76
|
"winrm" => {
|
76
77
|
"password" => "foo",
|
77
78
|
"port" => "22",
|
78
|
-
"
|
79
|
+
"user" => "Admin",
|
79
80
|
"ssl" => false,
|
80
81
|
},
|
81
82
|
},
|
@@ -84,6 +85,7 @@ describe VagrantBolt::Config::Global do
|
|
84
85
|
before(:each) do
|
85
86
|
subject.password = 'foo'
|
86
87
|
subject.run_as = 'root'
|
88
|
+
subject.user = 'Admin'
|
87
89
|
subject.port = '22'
|
88
90
|
subject.ssl = false
|
89
91
|
subject.host_key_check = false
|
@@ -46,7 +46,7 @@ describe VagrantBolt::Runner do
|
|
46
46
|
|
47
47
|
context 'setup_overrides' do
|
48
48
|
before(:each) do
|
49
|
-
allow(VagrantBolt::Util::Machine).to receive(:
|
49
|
+
allow(VagrantBolt::Util::Machine).to receive(:machines_in_environment).with(iso_env).and_return([machine, machine2])
|
50
50
|
end
|
51
51
|
it 'adds the command and name to the config' do
|
52
52
|
result = subject.send(:setup_overrides, 'task', 'foo')
|
@@ -54,31 +54,47 @@ describe VagrantBolt::Runner do
|
|
54
54
|
expect(result.name).to eq('foo')
|
55
55
|
end
|
56
56
|
|
57
|
-
it 'uses the server name for the
|
57
|
+
it 'uses the server name for the targets' do
|
58
58
|
result = subject.send(:setup_overrides, 'task', 'foo')
|
59
|
-
expect(result.
|
59
|
+
expect(result.target_list).to eq('server')
|
60
60
|
end
|
61
61
|
|
62
|
-
it 'allows for using multiple
|
62
|
+
it 'allows for using multiple targets' do
|
63
|
+
config.targets = ['server', 'server2']
|
64
|
+
config.finalize!
|
65
|
+
result = subject.send(:setup_overrides, 'task', 'foo')
|
66
|
+
expect(result.target_list).to eq('server,server2')
|
67
|
+
end
|
68
|
+
|
69
|
+
it 'allows for using nodes parameter' do
|
63
70
|
config.nodes = ['server', 'server2']
|
64
71
|
config.finalize!
|
65
72
|
result = subject.send(:setup_overrides, 'task', 'foo')
|
66
|
-
expect(result.
|
73
|
+
expect(result.target_list).to eq('server,server2')
|
67
74
|
end
|
68
75
|
|
69
|
-
it 'adds all
|
70
|
-
config.
|
76
|
+
it 'adds all targets when "all" is specified' do
|
77
|
+
config.targets = 'all'
|
71
78
|
config.finalize!
|
72
79
|
result = subject.send(:setup_overrides, 'task', 'foo')
|
73
|
-
expect(result.
|
80
|
+
expect(result.target_list).to eq('server,server2')
|
74
81
|
end
|
75
82
|
|
76
83
|
it 'does not override specified ssh settings' do
|
84
|
+
config.target_list = 'ssh://test:22'
|
85
|
+
config.user = 'root'
|
86
|
+
config.finalize!
|
87
|
+
result = subject.send(:setup_overrides, 'task', 'foo')
|
88
|
+
expect(result.target_list).to eq('ssh://test:22')
|
89
|
+
expect(result.user).to eq('root')
|
90
|
+
end
|
91
|
+
|
92
|
+
it 'target_list defaults to node_list' do
|
77
93
|
config.node_list = 'ssh://test:22'
|
78
94
|
config.user = 'root'
|
79
95
|
config.finalize!
|
80
96
|
result = subject.send(:setup_overrides, 'task', 'foo')
|
81
|
-
expect(result.
|
97
|
+
expect(result.target_list).to eq('ssh://test:22')
|
82
98
|
expect(result.user).to eq('root')
|
83
99
|
end
|
84
100
|
|
@@ -109,11 +125,21 @@ describe VagrantBolt::Runner do
|
|
109
125
|
end
|
110
126
|
|
111
127
|
it 'creates a shell execution' do
|
128
|
+
config.bolt_exe = 'bolt'
|
129
|
+
config.project = '.'
|
130
|
+
config.target_list = 'ssh://test:22'
|
131
|
+
config.finalize!
|
132
|
+
command = "bolt task run 'foo' --project '.' --inventoryfile '#{inventory_path}' --targets 'ssh://test:22'"
|
133
|
+
expect(Vagrant::Util::Subprocess).to receive(:execute).with('bash', '-c', command, options).and_return(subprocess_result)
|
134
|
+
subject.run('task', 'foo')
|
135
|
+
end
|
136
|
+
|
137
|
+
it 'creates a shell execution with a project' do
|
112
138
|
config.bolt_exe = 'bolt'
|
113
139
|
config.boltdir = '.'
|
114
|
-
config.
|
140
|
+
config.target_list = 'ssh://test:22'
|
115
141
|
config.finalize!
|
116
|
-
command = "bolt task run 'foo' --
|
142
|
+
command = "bolt task run 'foo' --project '.' --inventoryfile '#{inventory_path}' --targets 'ssh://test:22'"
|
117
143
|
expect(Vagrant::Util::Subprocess).to receive(:execute).with('bash', '-c', command, options).and_return(subprocess_result)
|
118
144
|
subject.run('task', 'foo')
|
119
145
|
end
|
data/spec/unit/util/bolt_spec.rb
CHANGED
@@ -26,7 +26,6 @@ describe VagrantBolt::Util::Bolt do
|
|
26
26
|
end
|
27
27
|
let(:machine_hash) do
|
28
28
|
{
|
29
|
-
"alias" => "machine",
|
30
29
|
"config" => {
|
31
30
|
"ssh" => {
|
32
31
|
"connect-timeout" => "30",
|
@@ -39,8 +38,10 @@ describe VagrantBolt::Util::Bolt do
|
|
39
38
|
},
|
40
39
|
"transport" => "ssh",
|
41
40
|
},
|
42
|
-
"
|
41
|
+
"uri" => "ssh://machine:22",
|
43
42
|
"facts" => { 'a' => 'b' },
|
43
|
+
"alias" => 'machine',
|
44
|
+
"name" => 'somename',
|
44
45
|
"vars" => { 'foo' => 'bar' },
|
45
46
|
"features" => ['foo'],
|
46
47
|
}
|
@@ -48,7 +49,7 @@ describe VagrantBolt::Util::Bolt do
|
|
48
49
|
let(:config_hash) { { 'config' => { 'a' => 'b' } } }
|
49
50
|
let(:node_hash) do
|
50
51
|
{
|
51
|
-
'
|
52
|
+
'targets' => [machine_hash],
|
52
53
|
'config' => config_hash['config'],
|
53
54
|
}
|
54
55
|
end
|
@@ -63,6 +64,7 @@ describe VagrantBolt::Util::Bolt do
|
|
63
64
|
config.facts = { 'a' => 'b' }
|
64
65
|
config.features = ['foo']
|
65
66
|
config.vars = { 'foo' => 'bar' }
|
67
|
+
config.machine_name = 'somename'
|
66
68
|
config.finalize!
|
67
69
|
allow(machine).to receive_message_chain("config.bolt.inventory_config").and_return(config.inventory_config)
|
68
70
|
allow(machine).to receive_message_chain("config.vm.communicator").and_return(:ssh)
|
@@ -70,7 +72,7 @@ describe VagrantBolt::Util::Bolt do
|
|
70
72
|
allow(env).to receive_message_chain("vagrantfile.config.bolt.inventory_config").and_return(config_hash)
|
71
73
|
allow(env).to receive(:active_machines).and_return(['machine'])
|
72
74
|
allow(env).to receive(:machine).and_return(machine)
|
73
|
-
allow_any_instance_of(VagrantBolt::Util::Machine).to receive(:
|
75
|
+
allow_any_instance_of(VagrantBolt::Util::Machine).to receive(:machines_in_environment).with(env).and_return([machine])
|
74
76
|
allow_any_instance_of(VagrantBolt::Util::Machine).to receive(:running?).with(machine).and_return(true)
|
75
77
|
end
|
76
78
|
|
@@ -95,7 +97,7 @@ describe VagrantBolt::Util::Bolt do
|
|
95
97
|
config.node_list = 'ssh://test:22'
|
96
98
|
config.user = 'user'
|
97
99
|
config.finalize!
|
98
|
-
expected = "bolt task run 'foo' --user \'user\' --inventoryfile '#{inventory_path}' --
|
100
|
+
expected = "bolt task run 'foo' --user \'user\' --inventoryfile '#{inventory_path}' --targets \'ssh://test:22\'"
|
99
101
|
expect(subject.generate_bolt_command(config, inventory_path)).to eq(expected)
|
100
102
|
end
|
101
103
|
|
@@ -107,10 +109,18 @@ describe VagrantBolt::Util::Bolt do
|
|
107
109
|
end
|
108
110
|
|
109
111
|
it 'adds directories to the command' do
|
112
|
+
config.modulepath = 'baz'
|
113
|
+
config.project = 'foo'
|
114
|
+
config.finalize!
|
115
|
+
expected = "bolt task run 'foo' --modulepath 'baz' --project 'foo' --inventoryfile '#{inventory_path}'"
|
116
|
+
expect(subject.generate_bolt_command(config, inventory_path)).to eq(expected)
|
117
|
+
end
|
118
|
+
|
119
|
+
it 'uses project when boltdir is specified' do
|
110
120
|
config.modulepath = 'baz'
|
111
121
|
config.boltdir = 'foo'
|
112
122
|
config.finalize!
|
113
|
-
expected = "bolt task run 'foo' --
|
123
|
+
expected = "bolt task run 'foo' --modulepath 'baz' --project 'foo' --inventoryfile '#{inventory_path}'"
|
114
124
|
expect(subject.generate_bolt_command(config, inventory_path)).to eq(expected)
|
115
125
|
end
|
116
126
|
|
@@ -134,7 +144,16 @@ describe VagrantBolt::Util::Bolt do
|
|
134
144
|
config.verbose = true
|
135
145
|
config.noop = true
|
136
146
|
config.finalize!
|
137
|
-
expected = "bolt task run 'foo' --verbose --debug --noop --inventoryfile '#{inventory_path}'"
|
147
|
+
expected = "bolt task run 'foo' --verbose --log-level=debug --noop --inventoryfile '#{inventory_path}'"
|
148
|
+
expect(subject.generate_bolt_command(config, inventory_path)).to eq(expected)
|
149
|
+
end
|
150
|
+
|
151
|
+
it 'run_as is not included' do
|
152
|
+
config.node_list = 'ssh://test:22'
|
153
|
+
config.user = 'user'
|
154
|
+
config.run_as = 'foo'
|
155
|
+
config.finalize!
|
156
|
+
expected = "bolt task run 'foo' --user \'user\' --inventoryfile '#{inventory_path}' --targets \'ssh://test:22\'"
|
138
157
|
expect(subject.generate_bolt_command(config, inventory_path)).to eq(expected)
|
139
158
|
end
|
140
159
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-bolt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jarret Lavallee
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-03-15 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: " Vagrant provisioning with Puppet Bolt\n"
|
14
14
|
email:
|
@@ -17,10 +17,10 @@ executables: []
|
|
17
17
|
extensions: []
|
18
18
|
extra_rdoc_files: []
|
19
19
|
files:
|
20
|
+
- ".github/workflows/spec.yml"
|
20
21
|
- ".gitignore"
|
21
22
|
- ".rspec"
|
22
23
|
- ".rubocop.yml"
|
23
|
-
- ".travis.yml"
|
24
24
|
- ".yardopts"
|
25
25
|
- CHANGELOG.md
|
26
26
|
- Gemfile
|
@@ -32,25 +32,8 @@ files:
|
|
32
32
|
- acceptance/artifacts/.keep
|
33
33
|
- acceptance/components/bolt_spec.rb
|
34
34
|
- acceptance/skeletons/advanced/Vagrantfile
|
35
|
+
- acceptance/skeletons/base/Puppetfile
|
35
36
|
- acceptance/skeletons/base/Vagrantfile
|
36
|
-
- acceptance/skeletons/base/modules/facts/CHANGELOG.md
|
37
|
-
- acceptance/skeletons/base/modules/facts/CONTRIBUTING.md
|
38
|
-
- acceptance/skeletons/base/modules/facts/Gemfile
|
39
|
-
- acceptance/skeletons/base/modules/facts/LICENSE
|
40
|
-
- acceptance/skeletons/base/modules/facts/README.md
|
41
|
-
- acceptance/skeletons/base/modules/facts/Rakefile
|
42
|
-
- acceptance/skeletons/base/modules/facts/checksums.json
|
43
|
-
- acceptance/skeletons/base/modules/facts/lib/puppet/functions/facts/group_by.rb
|
44
|
-
- acceptance/skeletons/base/modules/facts/metadata.json
|
45
|
-
- acceptance/skeletons/base/modules/facts/plans/info.pp
|
46
|
-
- acceptance/skeletons/base/modules/facts/plans/init.pp
|
47
|
-
- acceptance/skeletons/base/modules/facts/tasks/bash.json
|
48
|
-
- acceptance/skeletons/base/modules/facts/tasks/bash.sh
|
49
|
-
- acceptance/skeletons/base/modules/facts/tasks/init.json
|
50
|
-
- acceptance/skeletons/base/modules/facts/tasks/powershell.json
|
51
|
-
- acceptance/skeletons/base/modules/facts/tasks/powershell.ps1
|
52
|
-
- acceptance/skeletons/base/modules/facts/tasks/ruby.json
|
53
|
-
- acceptance/skeletons/base/modules/facts/tasks/ruby.rb
|
54
37
|
- acceptance/skeletons/provisioner/Vagrantfile
|
55
38
|
- acceptance/skeletons/trigger/Vagrantfile
|
56
39
|
- acceptance/vagrant-spec.config.rb
|
@@ -88,7 +71,7 @@ homepage: https://github.com/oscar-stack/vagrant-bolt
|
|
88
71
|
licenses:
|
89
72
|
- Apache-2.0
|
90
73
|
metadata: {}
|
91
|
-
post_install_message:
|
74
|
+
post_install_message:
|
92
75
|
rdoc_options: []
|
93
76
|
require_paths:
|
94
77
|
- lib
|
@@ -103,9 +86,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
103
86
|
- !ruby/object:Gem::Version
|
104
87
|
version: '0'
|
105
88
|
requirements: []
|
106
|
-
rubyforge_project:
|
107
|
-
rubygems_version: 2.7.6
|
108
|
-
signing_key:
|
89
|
+
rubyforge_project:
|
90
|
+
rubygems_version: 2.7.6.2
|
91
|
+
signing_key:
|
109
92
|
specification_version: 4
|
110
93
|
summary: Vagrant provisioning with Puppet Bolt
|
111
94
|
test_files: []
|