vagrant-bolt 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +15 -0
  3. data/.rspec +2 -0
  4. data/.rubocop.yml +124 -0
  5. data/.travis.yml +28 -0
  6. data/.yardopts +1 -0
  7. data/Gemfile +37 -0
  8. data/LICENSE +12 -0
  9. data/Puppetfile +7 -0
  10. data/README.md +431 -0
  11. data/Rakefile +19 -0
  12. data/Vagrantfile +47 -0
  13. data/acceptance/artifacts/.keep +0 -0
  14. data/acceptance/components/bolt_spec.rb +98 -0
  15. data/acceptance/skeletons/advanced/Vagrantfile +26 -0
  16. data/acceptance/skeletons/base/Vagrantfile +11 -0
  17. data/acceptance/skeletons/base/modules/facts/CHANGELOG.md +26 -0
  18. data/acceptance/skeletons/base/modules/facts/CONTRIBUTING.md +279 -0
  19. data/acceptance/skeletons/base/modules/facts/Gemfile +98 -0
  20. data/acceptance/skeletons/base/modules/facts/LICENSE +201 -0
  21. data/acceptance/skeletons/base/modules/facts/README.md +45 -0
  22. data/acceptance/skeletons/base/modules/facts/Rakefile +8 -0
  23. data/acceptance/skeletons/base/modules/facts/checksums.json +42 -0
  24. data/acceptance/skeletons/base/modules/facts/lib/puppet/functions/facts/group_by.rb +14 -0
  25. data/acceptance/skeletons/base/modules/facts/metadata.json +62 -0
  26. data/acceptance/skeletons/base/modules/facts/plans/info.pp +16 -0
  27. data/acceptance/skeletons/base/modules/facts/plans/init.pp +13 -0
  28. data/acceptance/skeletons/base/modules/facts/tasks/bash.json +5 -0
  29. data/acceptance/skeletons/base/modules/facts/tasks/bash.sh +93 -0
  30. data/acceptance/skeletons/base/modules/facts/tasks/init.json +10 -0
  31. data/acceptance/skeletons/base/modules/facts/tasks/powershell.json +4 -0
  32. data/acceptance/skeletons/base/modules/facts/tasks/powershell.ps1 +56 -0
  33. data/acceptance/skeletons/base/modules/facts/tasks/ruby.json +4 -0
  34. data/acceptance/skeletons/base/modules/facts/tasks/ruby.rb +40 -0
  35. data/acceptance/skeletons/provisioner/Vagrantfile +19 -0
  36. data/acceptance/skeletons/trigger/Vagrantfile +22 -0
  37. data/acceptance/vagrant-spec.config.rb +22 -0
  38. data/lib/vagrant-bolt.rb +57 -0
  39. data/lib/vagrant-bolt/command.rb +65 -0
  40. data/lib/vagrant-bolt/config.rb +6 -0
  41. data/lib/vagrant-bolt/config/bolt.rb +135 -0
  42. data/lib/vagrant-bolt/config/global.rb +172 -0
  43. data/lib/vagrant-bolt/config_builder.rb +11 -0
  44. data/lib/vagrant-bolt/config_builder/config.rb +150 -0
  45. data/lib/vagrant-bolt/config_builder/monkey_patches.rb +71 -0
  46. data/lib/vagrant-bolt/config_builder/provisioner.rb +106 -0
  47. data/lib/vagrant-bolt/config_builder/triggers.rb +29 -0
  48. data/lib/vagrant-bolt/plugin.rb +39 -0
  49. data/lib/vagrant-bolt/provisioner.rb +18 -0
  50. data/lib/vagrant-bolt/runner.rb +88 -0
  51. data/lib/vagrant-bolt/util/bolt.rb +139 -0
  52. data/lib/vagrant-bolt/util/config.rb +43 -0
  53. data/lib/vagrant-bolt/util/machine.rb +73 -0
  54. data/lib/vagrant-bolt/version.rb +5 -0
  55. data/spec/spec_helper.rb +12 -0
  56. data/spec/unit/config/bolt_spec.rb +150 -0
  57. data/spec/unit/config/global_spec.rb +95 -0
  58. data/spec/unit/provisioner/bolt_spec.rb +39 -0
  59. data/spec/unit/runner/runner_spec.rb +122 -0
  60. data/spec/unit/util/bolt_spec.rb +148 -0
  61. data/spec/unit/util/config_spec.rb +53 -0
  62. data/spec/unit/vagrant_spec.rb +9 -0
  63. data/tasks/acceptance.rake +45 -0
  64. data/tasks/spec.rake +5 -0
  65. data/templates/locales/en.yml +24 -0
  66. data/vagrant-bolt.gemspec +24 -0
  67. metadata +109 -0
@@ -0,0 +1,98 @@
1
+ # frozen_string_literal: true
2
+
3
+ source ENV['GEM_SOURCE'] || 'https://rubygems.org'
4
+
5
+ def location_for(place_or_version, fake_version = nil)
6
+ if place_or_version =~ /\A(git[:@][^#]*)#(.*)/
7
+ [fake_version, { git: Regexp.last_match(1), branch: Regexp.last_match(2), require: false }].compact
8
+ elsif place_or_version =~ %r{\Afile:\/\/(.*)}
9
+ ['>= 0', { path: File.expand_path(Regexp.last_match(1)), require: false }]
10
+ else
11
+ [place_or_version, { require: false }]
12
+ end
13
+ end
14
+
15
+ ruby_version_segments = Gem::Version.new(RUBY_VERSION.dup).segments
16
+ minor_version = ruby_version_segments[0..1].join('.')
17
+
18
+ group :development do
19
+ if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.1.0')
20
+ gem "fast_gettext", '1.1.0', require: false
21
+ elsif Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.1.0')
22
+ gem "fast_gettext", require: false
23
+ end
24
+ if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.0.0')
25
+ gem "json_pure", '<= 2.0.1', require: false
26
+ end
27
+ if Gem::Version.new(RUBY_VERSION.dup) == Gem::Version.new('2.1.9')
28
+ gem "json", '= 1.8.1', require: false
29
+ end
30
+ if Gem::Version.new(RUBY_VERSION.dup) == Gem::Version.new('2.4.4')
31
+ gem "json", '<= 2.0.4', require: false
32
+ end
33
+ gem "puppet-module-posix-default-r#{minor_version}",
34
+ require: false, platforms: [:ruby]
35
+ gem "puppet-module-posix-dev-r#{minor_version}",
36
+ require: false, platforms: [:ruby]
37
+ gem "puppet-module-win-default-r#{minor_version}",
38
+ require: false, platforms: %i[mswin mingw x64_mingw]
39
+ gem "puppet-module-win-dev-r#{minor_version}",
40
+ require: false, platforms: %i[mswin mingw x64_mingw]
41
+ gem "puppet-blacksmith", '~> 3.4',
42
+ require: false, platforms: [:ruby]
43
+ end
44
+
45
+ group :system_tests do
46
+ gem "puppet-module-posix-system-r#{minor_version}",
47
+ require: false, platforms: [:ruby]
48
+ gem "puppet-module-win-system-r#{minor_version}",
49
+ require: false, platforms: %i[mswin mingw x64_mingw]
50
+ gem "beaker", *location_for(ENV['BEAKER_VERSION'] || '~> 3.13')
51
+ gem "beaker-abs", *location_for(ENV['BEAKER_ABS_VERSION'] || '~> 0.1')
52
+ gem "beaker-hostgenerator"
53
+ gem "beaker-pe",
54
+ require: false
55
+ gem "beaker-rspec"
56
+ end
57
+
58
+ # Temporarily pin to Puppet 6. 6.0.1 introduces a change in behavior that
59
+ # will require a newer release of Bolt for bolt_spec to work.
60
+ puppet_version = ENV['PUPPET_GEM_VERSION'] || '= 6.0.0'
61
+ facter_version = ENV['FACTER_GEM_VERSION']
62
+ hiera_version = ENV['HIERA_GEM_VERSION']
63
+
64
+ gems = {}
65
+
66
+ # If facter or hiera versions have been specified via the environment
67
+ # variables
68
+
69
+ gems['facter'] = location_for(facter_version) if facter_version
70
+ gems['hiera'] = location_for(hiera_version) if hiera_version
71
+ gems['puppet'] = location_for(puppet_version) if puppet_version
72
+ gem 'bolt', '~> 0.23.0'
73
+
74
+ if Gem.win_platform? && puppet_version =~ %r{^(file:///|git://)}
75
+ # If we're using a Puppet gem on Windows which handles its own win32-xxx gem
76
+ # dependencies (>= 3.5.0), set the maximum versions (see PUP-6445).
77
+ gems['win32-dir'] = ['<= 0.4.9', require: false]
78
+ gems['win32-eventlog'] = ['<= 0.6.5', require: false]
79
+ gems['win32-process'] = ['<= 0.7.5', require: false]
80
+ gems['win32-security'] = ['<= 0.2.5', require: false]
81
+ gems['win32-service'] = ['0.8.8', require: false]
82
+ end
83
+
84
+ gems.each do |gem_name, gem_params|
85
+ gem gem_name, *gem_params
86
+ end
87
+
88
+ # Evaluate Gemfile.local and ~/.gemfile if they exist
89
+ extra_gemfiles = ["#{__FILE__}.local", File.join(Dir.home, '.gemfile')]
90
+
91
+ extra_gemfiles.each do |gemfile|
92
+ # rubocop:disable Security/Eval
93
+ if File.file?(gemfile) && File.readable?(gemfile)
94
+ eval(File.read(gemfile), binding)
95
+ end
96
+ # rubocop:enable Security/Eval
97
+ end
98
+ # vim: syntax=ruby
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,45 @@
1
+ # facts
2
+
3
+ #### Table of Contents
4
+
5
+ 1. [Description](#description)
6
+ 2. [Requirements](#requirements)
7
+ 3. [Usage](#usage)
8
+ 4. [Reference - An under-the-hood peek at what the module is doing and how](#reference)
9
+
10
+ ## Description
11
+
12
+ This module provides a collection of facts tasks and plans all of which retrieve facts from the specified nodes but each of them processes the retrieved facts differently. The provided plans are:
13
+ * `facts` - retrieves the facts and then stores them in the inventory, returns a result set wrapping result objects for each specified node which in turn wrap the retrieved facts
14
+ * `facts::info` - retrieves the facts and returns information about each node's OS compiled from the `os` fact value retrieved from that node
15
+
16
+ The provided tasks:
17
+ * `facts` - retrieves the facts and without further processing returns a result set wrapping result objects for each specified node which in turn wrap the retrieved facts (this task is used by the above plans). This task relies on cross-platform task support; if unavailable, the individual implementations can be used instead.
18
+ * `facts::bash` - bash implementation of fact gathering, used by the `facts` task.
19
+ * `facts::powershell` - powershell implementation of fact gathering, used by the `facts` task.
20
+ * `facts::ruby` - ruby implementation of fact gathering, used by the `facts` task.
21
+
22
+ ## Requirements
23
+
24
+ This module is compatible with the version of Puppet Bolt it ships with.
25
+
26
+ ## Usage
27
+
28
+ To run the facts plan run
29
+
30
+ ```
31
+ bolt plan run facts --nodes node1.example.com,node2.example.com
32
+ ```
33
+
34
+ ### Parameters
35
+
36
+ All plans have only one parameter:
37
+
38
+ * **nodes** - The nodes to retrieve the facts from.
39
+
40
+ ## Reference
41
+
42
+ The core functionality is implemented in the `facts` task, which provides implementations
43
+ for the `shell`, `powershell`, and `puppet-agent` features. The tasks run `facter --json`
44
+ if facter is available on the target or - as a fallback - compile and return information
45
+ mimicking that provided by facter's `os` fact.
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'puppetlabs_spec_helper/rake_tasks'
4
+ require 'puppet-syntax/tasks/puppet-syntax'
5
+ require 'puppet_blacksmith/rake_tasks' if Bundler.rubygems.find_name('puppet-blacksmith').any?
6
+ require 'puppet-lint/tasks/puppet-lint'
7
+
8
+ PuppetLint.configuration.send('disable_relative')
@@ -0,0 +1,42 @@
1
+ {
2
+ "CHANGELOG.md": "38df9dfb5726e77f9db80adfb22f9eac",
3
+ "CONTRIBUTING.md": "f4016d06deb58c557a3b9da1197e06e7",
4
+ "Gemfile": "ab85e3e87ea316ff44bc9208534adc69",
5
+ "LICENSE": "86d3f3a95c324c9479bd8986968f4327",
6
+ "README.md": "a1cd11b63dfffaa41c08021bbf96d6ef",
7
+ "Rakefile": "bff4086985f50ba3c169cdd409cd4142",
8
+ "lib/puppet/functions/facts/group_by.rb": "684c78363ea8d4eccf49098dd6132c8f",
9
+ "metadata.json": "98db2b1f8b476f9c57ab719a2e4758ce",
10
+ "plans/info.pp": "7b0f3ea1993c1276aa23d56958c3137e",
11
+ "plans/init.pp": "f91b3e648da866edd43640f71f81187c",
12
+ "spec/acceptance/init_spec.rb": "9b515c8706e73e358c803096b2a63f40",
13
+ "spec/acceptance/nodesets/centos-7-x64.yml": "a713f3abd3657f0ae2878829badd23cd",
14
+ "spec/acceptance/nodesets/centos7-pooler.yml": "1c7cf0da5f81343715acf56b1ee03355",
15
+ "spec/acceptance/nodesets/debian-8-x64.yml": "d2d2977900989f30086ad251a14a1f39",
16
+ "spec/acceptance/nodesets/default.yml": "549c468454650afa7e510d09fa9edb1e",
17
+ "spec/acceptance/nodesets/docker/centos-7.yml": "8a3892807bdd62306ae4774f41ba11ae",
18
+ "spec/acceptance/nodesets/docker/debian-8.yml": "ac8e871d1068c96de5e85a89daaec6df",
19
+ "spec/acceptance/nodesets/docker/ubuntu-14.04.yml": "dc42ee922a96908d85b8f0f08203ce58",
20
+ "spec/acceptance/nodesets/windows32-pooler.yml": "a78222e3b0c022664f4b61a803a79f78",
21
+ "spec/default_facts.yml": "4de3cb611af6981a6d22bc77d7dd6f6f",
22
+ "spec/fixtures/configs/empty.yml": "6105347ebb9825ac754615ca55ff3b0c",
23
+ "spec/fixtures/configs/invalid.yml": "1f2aaef07c9e9ab52497f0e8a9bb7149",
24
+ "spec/fixtures/configs/puppetdb.yml": "3be9bcf5919b82e2050590c1c311880e",
25
+ "spec/fixtures/inventory/empty.yml": "6105347ebb9825ac754615ca55ff3b0c",
26
+ "spec/fixtures/inventory/invalid.yml": "1f2aaef07c9e9ab52497f0e8a9bb7149",
27
+ "spec/fixtures/keys/id_rsa": "4d4567b6a8116b736e4294726b9df071",
28
+ "spec/fixtures/keys/id_rsa.pub": "f298f0901636a877ef84b1fedb75fb9f",
29
+ "spec/fixtures/scripts/success.sh": "0a08b835341133f7738cc32e3cd43c6c",
30
+ "spec/functions/group_by_spec.rb": "dd60e20a61bfcfb16d5023027d7435c6",
31
+ "spec/plans/info_spec.rb": "0cef33fc100eb4457b233d9d6b163dfb",
32
+ "spec/plans/init_spec.rb": "1b85a1a4cae4b1274975ffb4f915e20f",
33
+ "spec/spec_helper.rb": "2a69ebf9ece229e56657bfcd827a42a5",
34
+ "spec/spec_helper_acceptance.rb": "284e24db3e4b739fe14fada7809378a8",
35
+ "tasks/bash.json": "ba2b85269632c30a8022132c8cd52e9a",
36
+ "tasks/bash.sh": "cd4c27d6d5bee7fda7f4f64e4ad50044",
37
+ "tasks/init.json": "7fd933a5fe813889ccf1f8efd024c98e",
38
+ "tasks/powershell.json": "eed5ef9bd7f6c6a83361ec3b51346d36",
39
+ "tasks/powershell.ps1": "9125c59f9961743e3c0c175c9e6189f0",
40
+ "tasks/ruby.json": "4f3314365d1d1760bdaa6e5ddd90eb16",
41
+ "tasks/ruby.rb": "43c98c7024fb0c72ca7229ca96c810fb"
42
+ }
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ # A simple wrapper of the ruby's group_by function.
4
+ Puppet::Functions.create_function(:'facts::group_by') do
5
+ dispatch :native_group_by do
6
+ param 'Iterable', :collection
7
+ block_param
8
+ return_type 'Hash'
9
+ end
10
+
11
+ def native_group_by(collection, &block)
12
+ collection.group_by(&block)
13
+ end
14
+ end
@@ -0,0 +1,62 @@
1
+ {
2
+ "name": "puppetlabs-facts",
3
+ "version": "0.3.1",
4
+ "author": "puppet",
5
+ "summary": "Tasks that inspect the value of system facts",
6
+ "license": "Apache-2.0",
7
+ "source": "https://github.com/puppetlabs/puppetlabs-facts",
8
+ "project_page": "https://github.com/puppetlabs/puppetlabs-facts",
9
+ "issues_url": "https://github.com/puppetlabs/puppetlabs-facts/issues",
10
+ "dependencies": [
11
+
12
+ ],
13
+ "data_provider": null,
14
+ "operatingsystem_support": [
15
+ {
16
+ "operatingsystem": "Debian",
17
+ "operatingsystemrelease": [
18
+ "8",
19
+ "9"
20
+ ]
21
+ },
22
+ {
23
+ "operatingsystem": "RedHat",
24
+ "operatingsystemrelease": [
25
+ "6",
26
+ "7"
27
+ ]
28
+ },
29
+ {
30
+ "operatingsystem": "Ubuntu",
31
+ "operatingsystemrelease": [
32
+ "16.04",
33
+ "18.04"
34
+ ]
35
+ },
36
+ {
37
+ "operatingsystem": "windows",
38
+ "operatingsystemrelease": [
39
+ "Server 2012 R2",
40
+ "Server 2016",
41
+ "10"
42
+ ]
43
+ },
44
+ {
45
+ "operatingsystem": "OSX",
46
+ "operatingsystemrelease": [
47
+ "10.12",
48
+ "10.13"
49
+ ]
50
+ }
51
+ ],
52
+ "requirements": [
53
+ {
54
+ "name": "puppet",
55
+ "version_requirement": ">= 5.1.0 < 7.0.0"
56
+ }
57
+ ],
58
+ "description": "Tasks that inspect the value of system facts",
59
+ "pdk-version": "1.5.0",
60
+ "template-url": "https://github.com/puppetlabs/pdk-templates",
61
+ "template-ref": "heads/master-0-g34e3266"
62
+ }