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
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0e18fae2e9bc92dec9f02ffcfe99e50dcfdf70f02ef25868446f031b580687f1
|
4
|
+
data.tar.gz: a9990a2aad67e44d5ef23044a6f670eb53aec993d14d682b28b6283445976899
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7db61b05179dc83445106b6e0fdf3a0e8dafc6d4691a215e7ace0702fe6f37ec34736958e7342eeca655eeb2d3ebf5b7c6785dd27504de9bf7fc9f423fbd50af
|
7
|
+
data.tar.gz: b71aae81653b51f13af5ff054e87a29981f6856410633ec733d64eb69cdae3930c4d82ab9bf428e1559193bcf6b2251cc1c746c2bf389d36871349a0b5d24ea1
|
@@ -0,0 +1,71 @@
|
|
1
|
+
name: Spec and Lint
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches:
|
6
|
+
- master
|
7
|
+
pull_request:
|
8
|
+
branches:
|
9
|
+
- master
|
10
|
+
|
11
|
+
jobs:
|
12
|
+
spec:
|
13
|
+
runs-on: ubuntu-latest
|
14
|
+
strategy:
|
15
|
+
fail-fast: false
|
16
|
+
matrix:
|
17
|
+
include:
|
18
|
+
- vagrant: 'v2.2.1'
|
19
|
+
ruby: 2.5
|
20
|
+
- vagrant: 'v2.2.14'
|
21
|
+
ruby: 2.5
|
22
|
+
- vagrant: 'HEAD'
|
23
|
+
ruby: 2.6
|
24
|
+
- vagrant: 'HEAD'
|
25
|
+
ruby: 2.7
|
26
|
+
steps:
|
27
|
+
- name: Checkout Source
|
28
|
+
uses: actions/checkout@v2
|
29
|
+
|
30
|
+
- name: Setup Ruby ${{ matrix.ruby }}
|
31
|
+
uses: actions/setup-ruby@v1
|
32
|
+
with:
|
33
|
+
ruby-version: ${{ matrix.ruby }}
|
34
|
+
|
35
|
+
- name: Cache gems
|
36
|
+
uses: actions/cache@v2
|
37
|
+
with:
|
38
|
+
path: vendor/gems
|
39
|
+
key: ${{ runner.os }}-pr-${{ hashFiles('**/Gemfile') }}
|
40
|
+
restore-keys: |
|
41
|
+
${{ runner.os }}-pr-
|
42
|
+
${{ runner.os }}-
|
43
|
+
|
44
|
+
- name: Install gems
|
45
|
+
env:
|
46
|
+
TEST_VAGRANT_VERSION: ${{ matrix.vagrant }}
|
47
|
+
run: |
|
48
|
+
gem install bundler
|
49
|
+
bundle config path vendor/gems
|
50
|
+
bundle config jobs 8
|
51
|
+
bundle config retry 3
|
52
|
+
bundle install
|
53
|
+
bundle clean
|
54
|
+
|
55
|
+
- name: bundler environment
|
56
|
+
env:
|
57
|
+
TEST_VAGRANT_VERSION: ${{ matrix.vagrant }}
|
58
|
+
run: |
|
59
|
+
bundle env
|
60
|
+
|
61
|
+
- name: Rubocop
|
62
|
+
env:
|
63
|
+
TEST_VAGRANT_VERSION: ${{ matrix.vagrant }}
|
64
|
+
run: |
|
65
|
+
bundle exec rake rubocop
|
66
|
+
|
67
|
+
- name: Spec Tests
|
68
|
+
env:
|
69
|
+
TEST_VAGRANT_VERSION: ${{ matrix.vagrant }}
|
70
|
+
run: |
|
71
|
+
bundle exec rake spec
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
---
|
2
2
|
AllCops:
|
3
|
+
NewCops: disable
|
3
4
|
DisplayCopNames: true
|
4
5
|
TargetRubyVersion: '2.4'
|
5
6
|
Include:
|
@@ -96,14 +97,6 @@ Metrics/CyclomaticComplexity:
|
|
96
97
|
Enabled: false
|
97
98
|
Metrics/PerceivedComplexity:
|
98
99
|
Enabled: false
|
99
|
-
Metrics/MethodLength:
|
100
|
-
Enabled: true
|
101
|
-
ExcludedMethods:
|
102
|
-
- initialize
|
103
|
-
- finalize!
|
104
|
-
- validate
|
105
|
-
- to_proc
|
106
|
-
Max: 25
|
107
100
|
Metrics/ClassLength:
|
108
101
|
Enabled: false
|
109
102
|
Metrics/ModuleLength:
|
@@ -122,3 +115,5 @@ Metrics/BlockLength:
|
|
122
115
|
- "acceptance/**/*.rb"
|
123
116
|
Style/RescueStandardError:
|
124
117
|
EnforcedStyle: implicit
|
118
|
+
Lint/MissingSuper:
|
119
|
+
Enabled: false
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,68 @@
|
|
1
|
-
#
|
1
|
+
# Changelog
|
2
|
+
|
3
|
+
## [v0.4.1](https://github.com/oscar-stack/vagrant-bolt/tree/v0.4.1) (2021-03-15)
|
4
|
+
|
5
|
+
[Full Changelog](https://github.com/oscar-stack/vagrant-bolt/compare/v0.4.0...v0.4.1)
|
6
|
+
|
7
|
+
**Closed issues:**
|
8
|
+
|
9
|
+
- `config.bolt.debug = true` fails when running with Bolt 3.0 [\#19](https://github.com/oscar-stack/vagrant-bolt/issues/19)
|
10
|
+
|
11
|
+
**Merged pull requests:**
|
12
|
+
|
13
|
+
- Fix config.debug = true for Bolt 3.0 [\#20](https://github.com/oscar-stack/vagrant-bolt/pull/20) ([op-ct](https://github.com/op-ct))
|
14
|
+
|
15
|
+
## [v0.4.0](https://github.com/oscar-stack/vagrant-bolt/tree/v0.4.0) (2020-12-23)
|
16
|
+
|
17
|
+
[Full Changelog](https://github.com/oscar-stack/vagrant-bolt/compare/v0.3.0...v0.4.0)
|
18
|
+
|
19
|
+
**Merged pull requests:**
|
20
|
+
|
21
|
+
- \(maint\) Change to github actions from travis [\#18](https://github.com/oscar-stack/vagrant-bolt/pull/18) ([jarretlavallee](https://github.com/jarretlavallee))
|
22
|
+
- Remove deprecated Bolt features [\#17](https://github.com/oscar-stack/vagrant-bolt/pull/17) ([jarretlavallee](https://github.com/jarretlavallee))
|
23
|
+
|
24
|
+
**Changes**
|
25
|
+
|
26
|
+
- This release requires bolt 2.16.0+
|
27
|
+
- Several deprecated features have been removed such as the following
|
28
|
+
- `boltdir` has been changed to `project`. The `project` setting defaults to `boltdir` to avoid breaking changes
|
29
|
+
- `run-as` has been removed from the `winrm` settings hash in the inventory file
|
30
|
+
- `version` has been removed from the inventory file
|
31
|
+
- `run-as` has been removed from the command line as it was overridden by the inventory file
|
32
|
+
- Acceptance tests have been fixed to use the gem installation of bolt
|
33
|
+
- Travis-CI tests have been migrated to Github Actions
|
34
|
+
|
35
|
+
## [v0.3.0](https://github.com/oscar-stack/vagrant-bolt/tree/v0.3.0) (2020-06-02)
|
36
|
+
|
37
|
+
[Full Changelog](https://github.com/oscar-stack/vagrant-bolt/compare/v0.2.1...v0.3.0)
|
38
|
+
|
39
|
+
**Merged pull requests:**
|
40
|
+
|
41
|
+
- Update inventory naming [\#16](https://github.com/oscar-stack/vagrant-bolt/pull/16) ([jarretlavallee](https://github.com/jarretlavallee))
|
42
|
+
|
43
|
+
## [v0.2.1](https://github.com/oscar-stack/vagrant-bolt/tree/v0.2.1) (2020-03-23)
|
44
|
+
|
45
|
+
[Full Changelog](https://github.com/oscar-stack/vagrant-bolt/compare/v0.2.0...v0.2.1)
|
46
|
+
|
47
|
+
**Closed issues:**
|
48
|
+
|
49
|
+
- Replace bolt argument nodes with targets [\#13](https://github.com/oscar-stack/vagrant-bolt/issues/13)
|
50
|
+
|
51
|
+
**Merged pull requests:**
|
52
|
+
|
53
|
+
- Fix config builder role filtering [\#15](https://github.com/oscar-stack/vagrant-bolt/pull/15) ([jarretlavallee](https://github.com/jarretlavallee))
|
54
|
+
|
55
|
+
## [v0.2.0](https://github.com/oscar-stack/vagrant-bolt/tree/v0.2.0) (2020-02-26)
|
56
|
+
|
57
|
+
[Full Changelog](https://github.com/oscar-stack/vagrant-bolt/compare/v0.1.2...v0.2.0)
|
58
|
+
|
59
|
+
**Merged pull requests:**
|
60
|
+
|
61
|
+
- Change nodes to targets in config [\#14](https://github.com/oscar-stack/vagrant-bolt/pull/14) ([jarretlavallee](https://github.com/jarretlavallee))
|
62
|
+
- Update to Bolt inventory v2 [\#12](https://github.com/oscar-stack/vagrant-bolt/pull/12) ([jarretlavallee](https://github.com/jarretlavallee))
|
2
63
|
|
3
64
|
## [v0.1.2](https://github.com/oscar-stack/vagrant-bolt/tree/v0.1.2) (2019-10-17)
|
65
|
+
|
4
66
|
[Full Changelog](https://github.com/oscar-stack/vagrant-bolt/compare/v0.1.1...v0.1.2)
|
5
67
|
|
6
68
|
**Merged pull requests:**
|
@@ -9,6 +71,7 @@
|
|
9
71
|
- Fix changelog version tag [\#10](https://github.com/oscar-stack/vagrant-bolt/pull/10) ([jarretlavallee](https://github.com/jarretlavallee))
|
10
72
|
|
11
73
|
## [v0.1.1](https://github.com/oscar-stack/vagrant-bolt/tree/v0.1.1) (2019-07-01)
|
74
|
+
|
12
75
|
[Full Changelog](https://github.com/oscar-stack/vagrant-bolt/compare/v0.1.0...v0.1.1)
|
13
76
|
|
14
77
|
**Merged pull requests:**
|
@@ -18,6 +81,9 @@
|
|
18
81
|
- Add connect\_timeout option to inventory [\#7](https://github.com/oscar-stack/vagrant-bolt/pull/7) ([jarretlavallee](https://github.com/jarretlavallee))
|
19
82
|
|
20
83
|
## [v0.1.0](https://github.com/oscar-stack/vagrant-bolt/tree/v0.1.0) (2018-12-11)
|
84
|
+
|
85
|
+
[Full Changelog](https://github.com/oscar-stack/vagrant-bolt/compare/4574482459a0f320bb6b25557199a1612b19ea72...v0.1.0)
|
86
|
+
|
21
87
|
**Merged pull requests:**
|
22
88
|
|
23
89
|
- \(SUP-874\) Add a command line interface [\#6](https://github.com/oscar-stack/vagrant-bolt/pull/6) ([jarretlavallee](https://github.com/jarretlavallee))
|
@@ -29,4 +95,4 @@
|
|
29
95
|
|
30
96
|
|
31
97
|
|
32
|
-
\* *This
|
98
|
+
\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*
|
data/Gemfile
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
source 'https://rubygems.org'
|
4
4
|
require 'rubygems/version'
|
5
5
|
|
6
|
-
vagrant_branch = ENV['TEST_VAGRANT_VERSION'] || 'v2.2.
|
6
|
+
vagrant_branch = ENV['TEST_VAGRANT_VERSION'] || 'v2.2.9'
|
7
7
|
|
8
8
|
group :plugins do
|
9
9
|
gemspec
|
@@ -21,17 +21,18 @@ end
|
|
21
21
|
group :test do
|
22
22
|
if %r{head}i.match?(vagrant_branch)
|
23
23
|
gem 'vagrant', git: 'https://github.com/hashicorp/vagrant.git',
|
24
|
-
branch: '
|
24
|
+
branch: 'main'
|
25
25
|
else
|
26
26
|
gem 'vagrant', git: 'https://github.com/hashicorp/vagrant.git',
|
27
27
|
tag: vagrant_branch
|
28
28
|
end
|
29
29
|
|
30
|
-
gem 'vagrant-spec', git: 'https://github.com/hashicorp/vagrant-spec.git'
|
30
|
+
gem 'vagrant-spec', git: 'https://github.com/hashicorp/vagrant-spec.git',
|
31
|
+
branch: 'main'
|
31
32
|
end
|
32
33
|
|
33
34
|
group :system_tests do
|
34
|
-
gem 'bolt', "
|
35
|
+
gem 'bolt', "~> 2.36.0"
|
35
36
|
end
|
36
37
|
|
37
38
|
|
data/README.md
CHANGED
@@ -177,13 +177,13 @@ VagrantBolt.task('facts', env, machine, user: 'ubuntu', password: 'testpassword'
|
|
177
177
|
Run the `facts` plan on `server1` and `server2`.
|
178
178
|
|
179
179
|
~~~ruby
|
180
|
-
VagrantBolt.plan('facts', env, machine,
|
180
|
+
VagrantBolt.plan('facts', env, machine, targets: [:server1, :server2])
|
181
181
|
~~~
|
182
182
|
|
183
|
-
Run the `hostname` command on all
|
183
|
+
Run the `hostname` command on all targets.
|
184
184
|
|
185
185
|
~~~ruby
|
186
|
-
VagrantBolt.command('/bin/hostname', env, machine,
|
186
|
+
VagrantBolt.command('/bin/hostname', env, machine, targets: 'all')
|
187
187
|
~~~
|
188
188
|
|
189
189
|
Run the `service::linux` task as `root` to restart `cron` with a specific path to the bolt executable. This configuration specifies params for the `service::linux` task.
|
@@ -218,22 +218,26 @@ The settings available in the triggers and the provisioner are the same.
|
|
218
218
|
* Description: A string containing the full path to the bolt executable
|
219
219
|
* Default: `/opt/puppetlabs/bin/bolt` if it exists, else the first `bolt` in the PATH
|
220
220
|
* `boltdir`
|
221
|
+
* DEPRECATED use `project` instead
|
221
222
|
* Description: A string containing the bolt working directory
|
222
223
|
* Default: The vagrant root
|
223
|
-
* `
|
224
|
-
* Description: A string containing bolt
|
225
|
-
|
226
|
-
|
227
|
-
*
|
224
|
+
* `project`
|
225
|
+
* Description: A string containing the bolt project
|
226
|
+
* Default: The value of `boltdir` for backwards compatibilty
|
227
|
+
* `target_list`
|
228
|
+
* Description: A string containing bolt target list in URI format
|
229
|
+
* This will override `targets` and `excludes`
|
230
|
+
* Default: `%{protocol}://%{ssh_ip}:%{ssh_port}` if `targets` is not specified
|
231
|
+
* `targets`
|
228
232
|
* Description: An array of machine names to run the task or plan on
|
229
|
-
* The `
|
233
|
+
* The `target_list` will override this setting.
|
230
234
|
* A special `ALL` string can be used instead of an array to use all active machines in the environment
|
231
235
|
* Valid Values: An array of machine symbols or the string "ALL"
|
232
236
|
* Default: `[]`
|
233
237
|
* `excludes`
|
234
238
|
* Description: An array of machine names to not run the task on
|
235
|
-
* The `
|
236
|
-
* This setting will take precidence over `
|
239
|
+
* The `target_list` will override this setting.
|
240
|
+
* This setting will take precidence over `targets`
|
237
241
|
* Valid Values: An array of machine symbols
|
238
242
|
* Default: `[]`
|
239
243
|
* `params`
|
@@ -260,6 +264,10 @@ The settings available in the triggers and the provisioner are the same.
|
|
260
264
|
* Description: A boolean which controls if the connection should use SSL on with WinRM (Windows)
|
261
265
|
* `ssl_verify`
|
262
266
|
* Description: A boolean which controls if the connection should verify SSL on with WinRM (Windows)
|
267
|
+
* `machine_alias`
|
268
|
+
* Description: A string to use as the machine's alias in the bolt inventory file. Defaults to nil unless `machine_name` is configured in which case it defaults to the machine name.
|
269
|
+
* `machine_name`
|
270
|
+
* Description: A string to use as the machine's name in the bolt inventory file. Defaults to the machine name.
|
263
271
|
* `modulepath`
|
264
272
|
* Description: A string containing the path to bolt modules
|
265
273
|
* `tmpdir`
|
@@ -277,7 +285,14 @@ The settings available in the triggers and the provisioner are the same.
|
|
277
285
|
* `vars`
|
278
286
|
* Description: A hash containing arbitrary data that may be passed to run_* functions or used for logic in plans
|
279
287
|
* `facts`
|
280
|
-
* Description: A hash containing observed information about the
|
288
|
+
* Description: A hash containing observed information about the target including what can be collected by Facter
|
289
|
+
|
290
|
+
**Deprecated Parameters**
|
291
|
+
|
292
|
+
* `node_list`
|
293
|
+
* Replaced by `target_list`
|
294
|
+
* `nodes`
|
295
|
+
* Replaced by `targets`
|
281
296
|
|
282
297
|
Config Builder
|
283
298
|
--------------
|
@@ -373,7 +388,7 @@ The command can be used to deploy the Puppetfile, for example.
|
|
373
388
|
vagrant bolt puppetfile install
|
374
389
|
~~~
|
375
390
|
|
376
|
-
It can be used to run ad-hoc tasks on a
|
391
|
+
It can be used to run ad-hoc tasks on a target by specifying the target by its machine name.
|
377
392
|
|
378
393
|
~~~shell
|
379
394
|
vagrant bolt -u task run facts -n server
|
@@ -390,7 +405,7 @@ vagrant bolt command run 'date' -n agent,master
|
|
390
405
|
Other Use Cases
|
391
406
|
---------------
|
392
407
|
|
393
|
-
There are some other use cases for Vagrant Bolt. One of which is to not use the triggers or provisioning to run bolt commands on the
|
408
|
+
There are some other use cases for Vagrant Bolt. One of which is to not use the triggers or provisioning to run bolt commands on the targets, but to manage the inventory file for manual testing. This can easily be accomplished by using a trigger to manage the `inventory.yaml` file and specifying the configuration for the targets in the config based on the options above. Below is an example trigger that will manage a `./inventory.yaml` file for use with external bolt commands.
|
394
409
|
|
395
410
|
~~~ruby
|
396
411
|
require 'vagrant-bolt'
|
@@ -423,8 +438,8 @@ Requirements
|
|
423
438
|
------------
|
424
439
|
|
425
440
|
* Vagrant 2.2.0+ is required for this plugin.
|
426
|
-
* Bolt
|
427
|
-
* Ruby 2.
|
441
|
+
* Bolt 2.17+ needs to be installed on the platform machine and accessible on the path. Use the `bolt_exe` config parameter if it is not on the path.
|
442
|
+
* Ruby 2.5+
|
428
443
|
|
429
444
|
Known Issues
|
430
445
|
------------
|
@@ -7,6 +7,7 @@ shared_examples 'provider/virtualbox' do |provider, options|
|
|
7
7
|
before do
|
8
8
|
environment.skeleton('base')
|
9
9
|
assert_execute('vagrant', 'box', 'add', 'box', options[:box])
|
10
|
+
execute('bolt', '--project', '.', 'puppetfile', 'install')
|
10
11
|
end
|
11
12
|
|
12
13
|
after do
|
@@ -21,10 +22,10 @@ shared_examples 'provider/virtualbox' do |provider, options|
|
|
21
22
|
|
22
23
|
it 'runs a task, plan, and command' do
|
23
24
|
expect(@result.exit_code).to eq(0)
|
24
|
-
expect(@result.stdout).to match(%r{
|
25
|
-
expect(@result.stdout).to match(%r{
|
26
|
-
expect(@result.stdout).to match(%r{
|
27
|
-
expect(@result.stdout.scan(%r{Successful on 1
|
25
|
+
expect(@result.stdout).to match(%r{bolt task run 'facts'})
|
26
|
+
expect(@result.stdout).to match(%r{bolt plan run 'facts'})
|
27
|
+
expect(@result.stdout).to match(%r{bolt command run})
|
28
|
+
expect(@result.stdout.scan(%r{Successful on 1 target}).size).to eq(3)
|
28
29
|
end
|
29
30
|
end
|
30
31
|
|
@@ -36,10 +37,10 @@ shared_examples 'provider/virtualbox' do |provider, options|
|
|
36
37
|
|
37
38
|
it 'runs a task, plan, and command' do
|
38
39
|
expect(@result.exit_code).to eq(0)
|
39
|
-
expect(@result.stdout).to match(%r{
|
40
|
-
expect(@result.stdout).to match(%r{
|
41
|
-
expect(@result.stdout).to match(%r{
|
42
|
-
expect(@result.stdout.scan(%r{Successful on 1
|
40
|
+
expect(@result.stdout).to match(%r{bolt task run 'facts'})
|
41
|
+
expect(@result.stdout).to match(%r{bolt plan run 'facts'})
|
42
|
+
expect(@result.stdout).to match(%r{bolt command run})
|
43
|
+
expect(@result.stdout.scan(%r{Successful on 1 target}).size).to eq(3)
|
43
44
|
end
|
44
45
|
end
|
45
46
|
|
@@ -50,18 +51,18 @@ shared_examples 'provider/virtualbox' do |provider, options|
|
|
50
51
|
|
51
52
|
it 'runs a task, plan, and command' do
|
52
53
|
expect(@result.exit_code).to eq(0)
|
53
|
-
result = assert_execute('vagrant', 'bolt', 'task', 'run', 'facts', '-
|
54
|
+
result = assert_execute('vagrant', 'bolt', 'task', 'run', 'facts', '-t', 'server')
|
54
55
|
expect(result.exit_code).to eq(0)
|
55
|
-
expect(result.stdout).to match(%r{
|
56
|
-
expect(result.stdout.scan(%r{Successful on 1
|
57
|
-
result = assert_execute('vagrant', 'bolt', 'plan', 'run', 'facts', '-
|
56
|
+
expect(result.stdout).to match(%r{bolt 'task' 'run' 'facts'})
|
57
|
+
expect(result.stdout.scan(%r{Successful on 1 target}).size).to eq(1)
|
58
|
+
result = assert_execute('vagrant', 'bolt', 'plan', 'run', 'facts', '-t', 'server')
|
58
59
|
expect(result.exit_code).to eq(0)
|
59
|
-
expect(result.stdout).to match(%r{
|
60
|
-
expect(result.stdout.scan(%r{Successful on 1
|
61
|
-
result = assert_execute('vagrant', 'bolt', 'command', 'run', 'hostname', '-
|
60
|
+
expect(result.stdout).to match(%r{bolt 'plan' 'run' 'facts'})
|
61
|
+
expect(result.stdout.scan(%r{Successful on 1 target}).size).to eq(1)
|
62
|
+
result = assert_execute('vagrant', 'bolt', 'command', 'run', 'hostname', '-t', 'server')
|
62
63
|
expect(result.exit_code).to eq(0)
|
63
|
-
expect(result.stdout).to match(%r{
|
64
|
-
expect(result.stdout.scan(%r{Successful on 1
|
64
|
+
expect(result.stdout).to match(%r{bolt 'command' 'run'})
|
65
|
+
expect(result.stdout.scan(%r{Successful on 1 target}).size).to eq(1)
|
65
66
|
end
|
66
67
|
end
|
67
68
|
|
@@ -79,20 +80,18 @@ shared_examples 'provider/virtualbox' do |provider, options|
|
|
79
80
|
# Check for root level triggers
|
80
81
|
result = assert_execute('vagrant', 'provision')
|
81
82
|
expect(result.exit_code).to eq(0)
|
82
|
-
# Ensure that the trigger is run on both
|
83
|
+
# Ensure that the trigger is run on both targets
|
83
84
|
expect(result.stdout.scan(%r{server[12]:\s+allnodetest}).size).to eq(4)
|
84
|
-
# Ensure that '
|
85
|
-
expect(result.stdout).to match(%r{
|
86
|
-
# Ensure that the root level `run_as` is used
|
87
|
-
expect(result.stdout).to match(%r{
|
85
|
+
# Ensure that 'targets = all' includes both targets
|
86
|
+
expect(result.stdout).to match(%r{bolt command run[^\n]+allnodetest[^\n]+server[12],server[12]})
|
87
|
+
# Ensure that the root level `run_as` is not used
|
88
|
+
expect(result.stdout).to match(%r{bolt command run[^\n]+allnodetest})
|
88
89
|
## Configtest
|
89
|
-
# Ensure excludes overrides
|
90
|
-
expect(result.stdout).to match(%r{
|
90
|
+
# Ensure excludes overrides targets
|
91
|
+
expect(result.stdout).to match(%r{bolt command run[^\n]+configtest[^\n]+server2})
|
91
92
|
# Ensure verbose and debug flags are correctly handled
|
92
|
-
expect(result.stdout).to match(%r{
|
93
|
-
expect(result.stdout).not_to match(%r{
|
94
|
-
# Ensure run_as override
|
95
|
-
expect(result.stdout).to match(%r{Bolt: Running bolt command locally: \/[^\ ]+bolt command run[^\n]+configtest[^\n]+--run-as 'vagrant'})
|
93
|
+
expect(result.stdout).to match(%r{bolt command run[^\n]+configtest[^\n]+--verbose})
|
94
|
+
expect(result.stdout).not_to match(%r{bolt command run[^\n]+configtest[^\n]+--debug})
|
96
95
|
end
|
97
96
|
end
|
98
97
|
end
|