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
@@ -1,12 +1,12 @@
|
|
1
1
|
require 'vagrant-spec/which'
|
2
2
|
Vagrant.configure('2') do |config|
|
3
|
-
config.bolt.bolt_exe = Vagrant::Spec::Which.which('bolt')
|
3
|
+
config.bolt.bolt_exe = [Vagrant::Spec::Which.which('ruby'), Vagrant::Spec::Which.which('bolt')]
|
4
4
|
config.bolt.run_as = 'root'
|
5
5
|
config.vm.box = 'box'
|
6
6
|
# Run a trigger on all nodes after provision
|
7
7
|
config.trigger.after :provision do |trigger|
|
8
8
|
trigger.ruby do |env, machine|
|
9
|
-
VagrantBolt.command('/bin/echo "allnodetest"', env, machine,
|
9
|
+
VagrantBolt.command('/bin/echo "allnodetest"', env, machine, targets: 'all')
|
10
10
|
end
|
11
11
|
end
|
12
12
|
config.vm.define 'server1' do |node|
|
@@ -1,11 +1,12 @@
|
|
1
1
|
require 'vagrant-spec/which'
|
2
2
|
Vagrant.configure('2') do |config|
|
3
|
-
config.bolt.bolt_exe = Vagrant::Spec::Which.which('bolt')
|
3
|
+
config.bolt.bolt_exe = [Vagrant::Spec::Which.which('ruby'), Vagrant::Spec::Which.which('bolt')]
|
4
4
|
config.vm.box = 'box'
|
5
5
|
config.vm.define 'server' do |node|
|
6
6
|
node.vm.provision :bolt do |bolt|
|
7
7
|
bolt.command = :task
|
8
8
|
bolt.name = "facts"
|
9
|
+
bolt.targets = ['server']
|
9
10
|
end
|
10
11
|
end
|
11
12
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'vagrant-spec/which'
|
2
2
|
Vagrant.configure('2') do |config|
|
3
|
-
config.bolt.bolt_exe = Vagrant::Spec::Which.which('bolt')
|
3
|
+
config.bolt.bolt_exe = [Vagrant::Spec::Which.which('ruby'), Vagrant::Spec::Which.which('bolt')]
|
4
4
|
config.vm.box = 'box'
|
5
5
|
config.vm.define 'server' do |node|
|
6
6
|
node.vm.provision :bolt do |bolt|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'vagrant-spec/which'
|
2
2
|
Vagrant.configure('2') do |config|
|
3
|
-
config.bolt.bolt_exe = Vagrant::Spec::Which.which('bolt')
|
3
|
+
config.bolt.bolt_exe = [Vagrant::Spec::Which.which('ruby'), Vagrant::Spec::Which.which('bolt')]
|
4
4
|
config.vm.box = 'box'
|
5
5
|
config.vm.define 'server' do |node|
|
6
6
|
node.trigger.after :up do |trigger|
|
@@ -11,11 +11,11 @@ ENV['VAGRANT_DISABLE_PLUGIN_INIT'] = '1'
|
|
11
11
|
Vagrant::Spec::Acceptance.configure do |c|
|
12
12
|
acceptance_dir = Pathname.new File.expand_path(__dir__)
|
13
13
|
|
14
|
-
c.component_paths = [
|
15
|
-
c.skeleton_paths = [
|
14
|
+
c.component_paths = ["#{acceptance_dir}/components"]
|
15
|
+
c.skeleton_paths = ["#{acceptance_dir}/skeletons"]
|
16
16
|
|
17
17
|
c.provider 'virtualbox',
|
18
|
-
box:
|
18
|
+
box: "#{acceptance_dir}/artifacts/virtualbox.box",
|
19
19
|
env_vars: {
|
20
20
|
'VBOX_USER_HOME' => '{{homedir}}',
|
21
21
|
}
|
data/lib/vagrant-bolt/command.rb
CHANGED
@@ -42,21 +42,21 @@ class VagrantBolt::Command < Vagrant.plugin('2', :command)
|
|
42
42
|
execute_bolt_command(bolt_args)
|
43
43
|
end
|
44
44
|
|
45
|
-
# Run a bolt command with the inventory path, and
|
45
|
+
# Run a bolt command with the inventory path, and project
|
46
46
|
# @param args [Array<String>] An array containing the bolt arguments
|
47
47
|
def execute_bolt_command(args)
|
48
48
|
bolt_exe = @env.vagrantfile.config.bolt.bolt_exe
|
49
|
-
|
49
|
+
project = VagrantBolt::Util::Config.relative_path(@env.vagrantfile.config.bolt.project, @env.root_path)
|
50
50
|
inventoryfile = VagrantBolt::Util::Bolt.inventory_file(@env)
|
51
51
|
|
52
52
|
quoted_args = args.flatten.compact.map { |a| "'#{a}'" }
|
53
53
|
command = [
|
54
|
-
|
54
|
+
bolt_exe,
|
55
55
|
quoted_args,
|
56
|
-
'--
|
57
|
-
|
56
|
+
'--project',
|
57
|
+
project,
|
58
58
|
]
|
59
59
|
command << ['--inventoryfile', "\'#{inventoryfile}\'"] if File.exist?(inventoryfile)
|
60
|
-
VagrantBolt::Util::Machine.run_command(command.flatten.join(
|
60
|
+
VagrantBolt::Util::Machine.run_command(command.flatten.join(' '), @env.ui)
|
61
61
|
end
|
62
62
|
end
|
@@ -10,6 +10,7 @@ class VagrantBolt::Config::Bolt < VagrantBolt::Config::Global
|
|
10
10
|
attr_accessor :name
|
11
11
|
|
12
12
|
# @!attribute [rw] nodes
|
13
|
+
# DEPRECATED. Use `targets` instead.
|
13
14
|
# Note: The `node_list` will override this setting.
|
14
15
|
# @return [Array<String, Symbol>, "ALL"] The nodes to run the task or plan on.
|
15
16
|
# Valid values are an array of machine names or the string "ALL".
|
@@ -17,14 +18,15 @@ class VagrantBolt::Config::Bolt < VagrantBolt::Config::Global
|
|
17
18
|
|
18
19
|
# @!attribute [rw] excludes
|
19
20
|
# Note: The `node_list` will override this setting.
|
20
|
-
# Note: This will be merged with `
|
21
|
-
# @return [Array<String, Symbol>] The
|
21
|
+
# Note: This will be merged with `targets`, with `excludes` taking precidence.
|
22
|
+
# @return [Array<String, Symbol>] The targets to exclude from running this task or plan on.
|
22
23
|
# Valid values are an array of machine names.
|
23
24
|
attr_accessor :excludes
|
24
25
|
|
25
26
|
# @!attribute [rw] node_list
|
27
|
+
# DEPRECATED. Use `target_list` instead.
|
26
28
|
# This setting overrides `nodes` and needs to be in the `protocol://ipaddress:port` URI format.
|
27
|
-
# @return [String] The bolt node list. This defaults to the currnet
|
29
|
+
# @return [String] The bolt node list. This defaults to the currnet machine.
|
28
30
|
attr_accessor :node_list
|
29
31
|
|
30
32
|
# @!attribute [rw] params
|
@@ -39,6 +41,17 @@ class VagrantBolt::Config::Bolt < VagrantBolt::Config::Global
|
|
39
41
|
# @return [Boolean] If the command should be run with noop. Only valid with tasks and apply.
|
40
42
|
attr_accessor :noop
|
41
43
|
|
44
|
+
# @!attribute [rw] targets
|
45
|
+
# Note: The `target_list` will override this setting.
|
46
|
+
# @return [Array<String, Symbol>, "ALL"] The targets to run the task or plan on.
|
47
|
+
# Valid values are an array of machine names or the string "ALL".
|
48
|
+
attr_accessor :targets
|
49
|
+
|
50
|
+
# @!attribute [rw] target_list
|
51
|
+
# This setting overrides `targets` and needs to be in the `protocol://ipaddress:port` URI format.
|
52
|
+
# @return [String] The bolt target list. This defaults to the currnet machine.
|
53
|
+
attr_accessor :target_list
|
54
|
+
|
42
55
|
def initialize
|
43
56
|
super
|
44
57
|
@args = UNSET_VALUE
|
@@ -48,40 +61,32 @@ class VagrantBolt::Config::Bolt < VagrantBolt::Config::Global
|
|
48
61
|
@node_list = UNSET_VALUE
|
49
62
|
@params = UNSET_VALUE
|
50
63
|
@command = UNSET_VALUE
|
64
|
+
@targets = []
|
65
|
+
@target_list = UNSET_VALUE
|
51
66
|
end
|
52
67
|
|
53
68
|
def finalize!
|
54
69
|
@bolt_exe = nil if @bolt_exe == UNSET_VALUE
|
55
70
|
@boltdir = nil if @boltdir == UNSET_VALUE
|
56
|
-
|
57
|
-
@modulepath = nil if @modulepath == UNSET_VALUE
|
58
|
-
@port = nil if @port == UNSET_VALUE
|
59
|
-
@password = nil if @password == UNSET_VALUE
|
60
|
-
@private_key = nil if @private_key == UNSET_VALUE
|
61
|
-
@run_as = nil if @run_as == UNSET_VALUE
|
62
|
-
@ssl = nil if @ssl == UNSET_VALUE
|
63
|
-
@ssl_verify = nil if @ssl_verify == UNSET_VALUE
|
64
|
-
@sudo_password = nil if @sudo_password == UNSET_VALUE
|
65
|
-
@tmpdir = nil if @tmpdir == UNSET_VALUE
|
66
|
-
@user = nil if @user == UNSET_VALUE
|
67
|
-
@verbose = nil if @verbose == UNSET_VALUE
|
68
|
-
@debug = nil if @debug == UNSET_VALUE
|
69
|
-
|
71
|
+
super
|
70
72
|
@args = nil if @args == UNSET_VALUE
|
71
73
|
@name = nil if @name == UNSET_VALUE
|
72
74
|
@node_list = nil if @node_list == UNSET_VALUE
|
73
75
|
@params = nil if @params == UNSET_VALUE
|
74
76
|
@command = nil if @command == UNSET_VALUE
|
75
77
|
@noop = nil if @noop == UNSET_VALUE
|
78
|
+
# Use nodes if targets is not specified.
|
79
|
+
@targets = @nodes if @targets.empty?
|
80
|
+
@target_list = @node_list if (@target_list == UNSET_VALUE) || @target_list.nil?
|
76
81
|
end
|
77
82
|
|
78
83
|
def merge(other)
|
79
84
|
super.tap do |result|
|
80
85
|
new_excludes = (excludes + other.excludes.dup).flatten.uniq
|
81
86
|
result.instance_variable_set(:@excludes, new_excludes.to_a)
|
82
|
-
unless
|
83
|
-
|
84
|
-
result.instance_variable_set(:@
|
87
|
+
unless targets.to_s.casecmp("all").zero?
|
88
|
+
new_targets = (targets + other.targets.dup).flatten.uniq
|
89
|
+
result.instance_variable_set(:@targets, new_targets.to_a)
|
85
90
|
end
|
86
91
|
end
|
87
92
|
end
|
@@ -90,9 +95,9 @@ class VagrantBolt::Config::Bolt < VagrantBolt::Config::Global
|
|
90
95
|
errors = _detected_errors
|
91
96
|
errors << I18n.t('vagrant-bolt.config.bolt.errors.invalid_command', command: @command.to_s) if !@command.nil? && !['task', 'plan', 'command'].include?(@command.to_s)
|
92
97
|
|
93
|
-
if @
|
98
|
+
if @targets.nil? || (!(@targets.is_a? Array) && !@targets.to_s.casecmp("all").zero?)
|
94
99
|
errors << I18n.t('vagrant-bolt.config.bolt.errors.invalid_data_command',
|
95
|
-
item: '
|
100
|
+
item: 'targets',
|
96
101
|
command: 'array')
|
97
102
|
end
|
98
103
|
|
@@ -121,8 +126,10 @@ class VagrantBolt::Config::Bolt < VagrantBolt::Config::Global
|
|
121
126
|
def blacklist
|
122
127
|
[
|
123
128
|
'nodes',
|
129
|
+
'targets',
|
124
130
|
'excludes',
|
125
131
|
'node_list',
|
132
|
+
'target_list',
|
126
133
|
'bolt_exe',
|
127
134
|
'args',
|
128
135
|
'command',
|
@@ -130,6 +137,8 @@ class VagrantBolt::Config::Bolt < VagrantBolt::Config::Global
|
|
130
137
|
'vars',
|
131
138
|
'facts',
|
132
139
|
'features',
|
140
|
+
'boltdir',
|
141
|
+
'run_as',
|
133
142
|
]
|
134
143
|
end
|
135
144
|
end
|
@@ -6,7 +6,7 @@ class VagrantBolt::Config::Global < Vagrant.plugin('2', :config)
|
|
6
6
|
attr_accessor :bolt_exe
|
7
7
|
|
8
8
|
# @!attribute [rw] boltdir
|
9
|
-
# @return [String] The bolt working directory. Defaults to `.`
|
9
|
+
# @return [String] DEPRECATED use `project`. The bolt working directory. Defaults to `.`
|
10
10
|
attr_accessor :boltdir
|
11
11
|
|
12
12
|
# @!attribute [rw] host_key_check
|
@@ -17,6 +17,14 @@ class VagrantBolt::Config::Global < Vagrant.plugin('2', :config)
|
|
17
17
|
# @return [Boolean] If the connection should check the host key on the remote host (linux)
|
18
18
|
attr_accessor :host_key_check
|
19
19
|
|
20
|
+
# @!attribute [rw] machine_alias
|
21
|
+
# @return [String] The alias of the machine to set in the bolt inventory
|
22
|
+
attr_accessor :machine_alias
|
23
|
+
|
24
|
+
# @!attribute [rw] machine_name
|
25
|
+
# @return [String] The name of the machine to set in the bolt inventory
|
26
|
+
attr_accessor :machine_name
|
27
|
+
|
20
28
|
# @!attribute [rw] modulepath
|
21
29
|
# @return [String] The path to the modules.
|
22
30
|
attr_accessor :modulepath
|
@@ -37,6 +45,10 @@ class VagrantBolt::Config::Global < Vagrant.plugin('2', :config)
|
|
37
45
|
# @return [String] The path of the private_key to authenticate on the machine.
|
38
46
|
attr_accessor :private_key
|
39
47
|
|
48
|
+
# @!attribute [rw] project
|
49
|
+
# @return [String] The bolt project. Defaults to `.`
|
50
|
+
attr_accessor :project
|
51
|
+
|
40
52
|
# @!attribute [rw] run_as
|
41
53
|
# @return [String] User to run as using privilege escalation.
|
42
54
|
attr_accessor :run_as
|
@@ -82,10 +94,13 @@ class VagrantBolt::Config::Global < Vagrant.plugin('2', :config)
|
|
82
94
|
@boltdir = UNSET_VALUE
|
83
95
|
@connect_timeout = UNSET_VALUE
|
84
96
|
@host_key_check = UNSET_VALUE
|
97
|
+
@machine_alias = UNSET_VALUE
|
98
|
+
@machine_name = UNSET_VALUE
|
85
99
|
@modulepath = UNSET_VALUE
|
86
100
|
@password = UNSET_VALUE
|
87
101
|
@port = UNSET_VALUE
|
88
102
|
@private_key = UNSET_VALUE
|
103
|
+
@project = UNSET_VALUE
|
89
104
|
@run_as = UNSET_VALUE
|
90
105
|
@ssl = UNSET_VALUE
|
91
106
|
@ssl_verify = UNSET_VALUE
|
@@ -104,10 +119,13 @@ class VagrantBolt::Config::Global < Vagrant.plugin('2', :config)
|
|
104
119
|
@boltdir = '.' if @boltdir == UNSET_VALUE
|
105
120
|
@connect_timeout = nil if @connect_timeout == UNSET_VALUE
|
106
121
|
@host_key_check = nil if @host_key_check == UNSET_VALUE
|
122
|
+
@machine_alias = nil if @machine_alias == UNSET_VALUE
|
123
|
+
@machine_name = nil if @machine_name == UNSET_VALUE
|
107
124
|
@modulepath = nil if @modulepath == UNSET_VALUE
|
108
125
|
@port = nil if @port == UNSET_VALUE
|
109
126
|
@password = nil if @password == UNSET_VALUE
|
110
127
|
@private_key = nil if @private_key == UNSET_VALUE
|
128
|
+
@project = @boltdir if @project == UNSET_VALUE || @project.nil?
|
111
129
|
@run_as = nil if @run_as == UNSET_VALUE
|
112
130
|
@ssl = nil if @ssl == UNSET_VALUE
|
113
131
|
@ssl_verify = nil if @ssl_verify == UNSET_VALUE
|
@@ -124,9 +142,8 @@ class VagrantBolt::Config::Global < Vagrant.plugin('2', :config)
|
|
124
142
|
# Get the full path to the bolt executable
|
125
143
|
# @return [String] The path to the bolt exe
|
126
144
|
def bolt_exe_path
|
127
|
-
|
128
|
-
|
129
|
-
end
|
145
|
+
return '/opt/puppetlabs/bin/bolt' if !Vagrant::Util::Platform.windows? && File.file?('/opt/puppetlabs/bin/bolt')
|
146
|
+
|
130
147
|
Vagrant::Util::Which.which('bolt') || 'bolt'
|
131
148
|
end
|
132
149
|
|
@@ -146,6 +163,8 @@ class VagrantBolt::Config::Global < Vagrant.plugin('2', :config)
|
|
146
163
|
|
147
164
|
if group_objects.include?(key)
|
148
165
|
config[key] = value
|
166
|
+
elsif %r{machine_\w+}.match?(key)
|
167
|
+
config[key.sub('machine_', '')] = value
|
149
168
|
else
|
150
169
|
setting_map.each do |transport, settings|
|
151
170
|
next unless settings.include?(key)
|
@@ -177,7 +196,6 @@ class VagrantBolt::Config::Global < Vagrant.plugin('2', :config)
|
|
177
196
|
'winrm': [
|
178
197
|
'user',
|
179
198
|
'password',
|
180
|
-
'run_as',
|
181
199
|
'ssl',
|
182
200
|
'ssl_verify',
|
183
201
|
'port',
|
@@ -13,7 +13,7 @@ class VagrantBolt::ConfigBuilder::Config < ConfigBuilder::Model::Base
|
|
13
13
|
def_model_attribute :bolt_exe
|
14
14
|
|
15
15
|
# @!attribute [rw] boltdir
|
16
|
-
# @return [String] The bolt working directory. Defaults to `.`
|
16
|
+
# @return [String] DEPRECATED use `project`. The bolt working directory. Defaults to `.`
|
17
17
|
def_model_attribute :boltdir
|
18
18
|
|
19
19
|
# @!attribute [rw] debug
|
@@ -28,6 +28,14 @@ class VagrantBolt::ConfigBuilder::Config < ConfigBuilder::Model::Base
|
|
28
28
|
# @return [Boolean] If the connection should check the host key on the remote host (linux)
|
29
29
|
def_model_attribute :host_key_check
|
30
30
|
|
31
|
+
# @!attribute [rw] machine_alias
|
32
|
+
# @return [String] The alias of the machine to set in the bolt inventory
|
33
|
+
def_model_attribute :machine_alias
|
34
|
+
|
35
|
+
# @!attribute [rw] machine_name
|
36
|
+
# @return [String] The name of the machine to set in the bolt inventory
|
37
|
+
def_model_attribute :machine_name
|
38
|
+
|
31
39
|
# @!attribute [rw] modulepath
|
32
40
|
# @return [String] The path to the modules.
|
33
41
|
def_model_attribute :modulepath
|
@@ -37,21 +45,23 @@ class VagrantBolt::ConfigBuilder::Config < ConfigBuilder::Model::Base
|
|
37
45
|
def_model_attribute :name
|
38
46
|
|
39
47
|
# @!attribute [rw] nodes
|
48
|
+
# DEPRECATED. Use `targets` instead.
|
40
49
|
# Note: The `node_list` will override this setting.
|
41
50
|
# @return [Array<String, Symbol>, "ALL"] The nodes to run the task or plan on.
|
42
51
|
# Valid values are an array of machine names or the string "ALL".
|
43
52
|
def_model_attribute :nodes
|
44
53
|
|
45
54
|
# @!attribute [rw] excludes
|
46
|
-
# Note: The `
|
47
|
-
# Note: This will be merged with `
|
48
|
-
# @return [Array<String, Symbol>] The
|
55
|
+
# Note: The `target_list` will override this setting.
|
56
|
+
# Note: This will be merged with `targets`, with `excludes` taking precidence.
|
57
|
+
# @return [Array<String, Symbol>] The targets to exclude from running this task or plan on.
|
49
58
|
# Valid values are an array of machine names.
|
50
59
|
def_model_attribute :excludes
|
51
60
|
|
52
61
|
# @!attribute [rw] node_list
|
62
|
+
# DEPRECATED. Use `target_list` instead.
|
53
63
|
# This setting overrides `nodes` and needs to be in the `protocol://ipaddress:port` URI format
|
54
|
-
# @return [String] The bolt node list. This defaults to the
|
64
|
+
# @return [String] The bolt node list. This defaults to the current node.
|
55
65
|
def_model_attribute :node_list
|
56
66
|
|
57
67
|
# @!attribute [rw] noop
|
@@ -62,6 +72,10 @@ class VagrantBolt::ConfigBuilder::Config < ConfigBuilder::Model::Base
|
|
62
72
|
# @return [Hash] The paramater hash for the task or plan
|
63
73
|
def_model_attribute :params
|
64
74
|
|
75
|
+
# @!attribute [rw] project
|
76
|
+
# @return [String] The bolt working directory. Defaults to `.`
|
77
|
+
def_model_attribute :project
|
78
|
+
|
65
79
|
# @!attribute [rw] command
|
66
80
|
# @return [Symbol] Whether bolt should use a task or plan
|
67
81
|
def_model_attribute :command
|
@@ -98,6 +112,17 @@ class VagrantBolt::ConfigBuilder::Config < ConfigBuilder::Model::Base
|
|
98
112
|
# @return [Boolean] If the connection should verify SSL on with WinRM (Windows)
|
99
113
|
def_model_attribute :ssl_verify
|
100
114
|
|
115
|
+
# @!attribute [rw] targets
|
116
|
+
# Note: The `target_list` will override this setting.
|
117
|
+
# @return [Array<String, Symbol>, "ALL"] The targets to run the task or plan on.
|
118
|
+
# Valid values are an array of machine names or the string "ALL".
|
119
|
+
def_model_attribute :targets
|
120
|
+
|
121
|
+
# @!attribute [rw] target_list
|
122
|
+
# This setting overrides `targets` and needs to be in the `protocol://ipaddress:port` URI format
|
123
|
+
# @return [String] The bolt target list. This defaults to the current target.
|
124
|
+
def_model_attribute :target_list
|
125
|
+
|
101
126
|
# @!attribute [rw] tmpdir
|
102
127
|
# @return [String] The directory to upload and execute temporary files on the target
|
103
128
|
def_model_attribute :tmpdir
|
@@ -129,6 +154,8 @@ class VagrantBolt::ConfigBuilder::Config < ConfigBuilder::Model::Base
|
|
129
154
|
with_attr(:debug) { |val| bolt.debug = val }
|
130
155
|
with_attr(:connect_timeout) { |val| bolt.connect_timeout = val }
|
131
156
|
with_attr(:host_key_check) { |val| bolt.host_key_check = val }
|
157
|
+
with_attr(:machine_alias) { |val| bolt.machine_alias = val }
|
158
|
+
with_attr(:machine_name) { |val| bolt.machine_name = val }
|
132
159
|
with_attr(:modulepath) { |val| bolt.modulepath = val }
|
133
160
|
with_attr(:name) { |val| bolt.name = val }
|
134
161
|
with_attr(:nodes) { |val| bolt.nodes = val }
|
@@ -140,10 +167,13 @@ class VagrantBolt::ConfigBuilder::Config < ConfigBuilder::Model::Base
|
|
140
167
|
with_attr(:password) { |val| bolt.password = val }
|
141
168
|
with_attr(:port) { |val| bolt.port = val }
|
142
169
|
with_attr(:private_key) { |val| bolt.private_key = val }
|
170
|
+
with_attr(:project) { |val| bolt.project = val }
|
143
171
|
with_attr(:run_as) { |val| bolt.run_as = val }
|
144
172
|
with_attr(:sudo_password) { |val| bolt.sudo_password = val }
|
145
173
|
with_attr(:ssl) { |val| bolt.ssl = val }
|
146
174
|
with_attr(:ssl_verify) { |val| bolt.ssl_verify = val }
|
175
|
+
with_attr(:targets) { |val| bolt.targets = val }
|
176
|
+
with_attr(:target_list) { |val| bolt.target_list = val }
|
147
177
|
with_attr(:tmpdir) { |val| bolt.tmpdir = val }
|
148
178
|
with_attr(:verbose) { |val| bolt.verbose = val }
|
149
179
|
with_attr(:facts) { |val| bolt.facts = val }
|
@@ -29,7 +29,8 @@ module VagrantBolt::ConfigBuilder::MonkeyPatches
|
|
29
29
|
|
30
30
|
def eval_bolt_triggers_root(vm_root_config)
|
31
31
|
# Configure the vm bolt object if the options exist
|
32
|
-
triggers = attr(:bolt_triggers) || []
|
32
|
+
triggers = attr(:bolt_triggers) || []
|
33
|
+
|
33
34
|
triggers.each do |config|
|
34
35
|
f = VagrantBolt::ConfigBuilder::Triggers.new_from_hash(config)
|
35
36
|
f.call(vm_root_config)
|
@@ -13,7 +13,7 @@ class VagrantBolt::ConfigBuilder::Provisioner < ConfigBuilder::Model::Provisione
|
|
13
13
|
def_model_attribute :bolt_exe
|
14
14
|
|
15
15
|
# @!attribute [rw] boltdir
|
16
|
-
# @return [String] The bolt working directory. Defaults to `.`
|
16
|
+
# @return [String] DEPRECATED use `project`. The bolt working directory. Defaults to `.`
|
17
17
|
def_model_attribute :boltdir
|
18
18
|
|
19
19
|
# @!attribute [rw] debug
|
@@ -28,6 +28,14 @@ class VagrantBolt::ConfigBuilder::Provisioner < ConfigBuilder::Model::Provisione
|
|
28
28
|
# @return [Boolean] If the connection should check the host key on the remote host (linux)
|
29
29
|
def_model_attribute :host_key_check
|
30
30
|
|
31
|
+
# @!attribute [rw] machine_alias
|
32
|
+
# @return [String] The alias of the machine to set in the bolt inventory
|
33
|
+
def_model_attribute :machine_alias
|
34
|
+
|
35
|
+
# @!attribute [rw] machine_name
|
36
|
+
# @return [String] The name of the machine to set in the bolt inventory
|
37
|
+
def_model_attribute :machine_name
|
38
|
+
|
31
39
|
# @!attribute [rw] modulepath
|
32
40
|
# @return [String] The path to the modules.
|
33
41
|
def_model_attribute :modulepath
|
@@ -37,6 +45,7 @@ class VagrantBolt::ConfigBuilder::Provisioner < ConfigBuilder::Model::Provisione
|
|
37
45
|
def_model_attribute :name
|
38
46
|
|
39
47
|
# @!attribute [rw] nodes
|
48
|
+
# DEPRECATED. Use `targets` instead.
|
40
49
|
# Note: The `node_list` will override this setting.
|
41
50
|
# @return [Array<String, Symbol>, "ALL"] The nodes to run the task or plan on.
|
42
51
|
# Valid values are an array of machine names or the string "ALL".
|
@@ -47,9 +56,9 @@ class VagrantBolt::ConfigBuilder::Provisioner < ConfigBuilder::Model::Provisione
|
|
47
56
|
def_model_attribute :noop
|
48
57
|
|
49
58
|
# @!attribute [rw] excludes
|
50
|
-
# Note: The `
|
51
|
-
# Note: This will be merged with `
|
52
|
-
# @return [Array<String, Symbol>] The
|
59
|
+
# Note: The `target_list` will override this setting.
|
60
|
+
# Note: This will be merged with `targets`, with `excludes` taking precidence.
|
61
|
+
# @return [Array<String, Symbol>] The targets to exclude from running this task or plan on.
|
53
62
|
# Valid values are an array of machine names.
|
54
63
|
def_model_attribute :excludes
|
55
64
|
|
@@ -82,6 +91,10 @@ class VagrantBolt::ConfigBuilder::Provisioner < ConfigBuilder::Model::Provisione
|
|
82
91
|
# @return [String] The path of the private_key to authenticate on the machine.
|
83
92
|
def_model_attribute :private_key
|
84
93
|
|
94
|
+
# @!attribute [rw] project
|
95
|
+
# @return [String] The bolt working directory. Defaults to `.`
|
96
|
+
def_model_attribute :project
|
97
|
+
|
85
98
|
# @!attribute [rw] run_as
|
86
99
|
# @return [String] User to run as using privilege escalation.
|
87
100
|
def_model_attribute :run_as
|
@@ -98,6 +111,17 @@ class VagrantBolt::ConfigBuilder::Provisioner < ConfigBuilder::Model::Provisione
|
|
98
111
|
# @return [Boolean] If the connection should verify SSL on with WinRM (Windows)
|
99
112
|
def_model_attribute :ssl_verify
|
100
113
|
|
114
|
+
# @!attribute [rw] targets
|
115
|
+
# Note: The `target_list` will override this setting.
|
116
|
+
# @return [Array<String, Symbol>, "ALL"] The targets to run the task or plan on.
|
117
|
+
# Valid values are an array of machine names or the string "ALL".
|
118
|
+
def_model_attribute :targets
|
119
|
+
|
120
|
+
# @!attribute [rw] target_list
|
121
|
+
# This setting overrides `targets` and needs to be in the `protocol://ipaddress:port` URI format
|
122
|
+
# @return [String] The bolt target list. This defaults to the current target.
|
123
|
+
def_model_attribute :target_list
|
124
|
+
|
101
125
|
# @!attribute [rw] tmpdir
|
102
126
|
# @return [String] The directory to upload and execute temporary files on the target
|
103
127
|
def_model_attribute :tmpdir
|