puppet-resource_api 1.8.18 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +18 -5
- data/lib/puppet/resource_api/type_definition.rb +1 -1
- data/lib/puppet/resource_api/version.rb +1 -1
- data/lib/puppet/resource_api.rb +17 -0
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1e25dec4ab50e8a0f4bb3bb3979c13df63857a092b5c9a7a1ef9f71f85c7f518
|
|
4
|
+
data.tar.gz: 01b32be4792de2f82eb78b91066a6f2bb740b49a620a92f50653fe9031e10026
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e9845b10a4d1997ebfda6094c3a61012a4b55659b4870e966ca516b03c52e47a20b061bd47581ca0e67bb4976f797d6b271634ff761743c5b842f718fa26f630
|
|
7
|
+
data.tar.gz: 8387c57e4a46044c6fe301275b41856d1ce87ab0219b62bdfb5c6622593f5bfdc582ebf35cda2dfb0c2f4bb36f1b9b0075604a2baae5d53a33e14aac89c16d7d
|
data/CHANGELOG.md
CHANGED
|
@@ -3,18 +3,31 @@
|
|
|
3
3
|
All significant changes to this repo will be summarized in this file.
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
## [1.
|
|
6
|
+
## [1.9.0](https://github.com/puppetlabs/puppet-resource_api/tree/1.9.0) (2023-08-08)
|
|
7
|
+
|
|
8
|
+
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/1.8.18...1.9.0)
|
|
9
|
+
|
|
10
|
+
**Implemented enhancements:**
|
|
11
|
+
|
|
12
|
+
- \(CAT-761\) Add custom\_generate as a feature [\#316](https://github.com/puppetlabs/puppet-resource_api/pull/316) ([david22swan](https://github.com/david22swan))
|
|
13
|
+
|
|
14
|
+
## [1.8.18](https://github.com/puppetlabs/puppet-resource_api/tree/1.8.18) (2023-07-21)
|
|
7
15
|
|
|
8
16
|
[Full Changelog](https://github.com/puppetlabs/puppet-resource_api/compare/1.8.16...1.8.18)
|
|
9
17
|
|
|
10
18
|
**Merged pull requests:**
|
|
11
19
|
|
|
12
|
-
- \(PA-5641\)
|
|
13
|
-
-
|
|
20
|
+
- \(PA-5641\) Release only to rubygems, do not bump and release [\#326](https://github.com/puppetlabs/puppet-resource_api/pull/326) ([tvpartytonight](https://github.com/tvpartytonight))
|
|
21
|
+
- \(PA-5641\) Prep for 1.8.18 release [\#324](https://github.com/puppetlabs/puppet-resource_api/pull/324) ([tvpartytonight](https://github.com/tvpartytonight))
|
|
22
|
+
- \(PA-5641\) Use new organizational token for rubygem pushing [\#323](https://github.com/puppetlabs/puppet-resource_api/pull/323) ([tvpartytonight](https://github.com/tvpartytonight))
|
|
23
|
+
- \(PA-5641\) prefer auto-generated GITHUB\_TOKEN [\#322](https://github.com/puppetlabs/puppet-resource_api/pull/322) ([tvpartytonight](https://github.com/tvpartytonight))
|
|
24
|
+
- \(PA-5641\) Add release job via PR [\#321](https://github.com/puppetlabs/puppet-resource_api/pull/321) ([tvpartytonight](https://github.com/tvpartytonight))
|
|
25
|
+
- \(maint\) Remove old Ruby logic from Gemfile [\#320](https://github.com/puppetlabs/puppet-resource_api/pull/320) ([mhashizume](https://github.com/mhashizume))
|
|
14
26
|
- \(PA-4639\) Migrate away from AppVeyor [\#319](https://github.com/puppetlabs/puppet-resource_api/pull/319) ([mhashizume](https://github.com/mhashizume))
|
|
15
|
-
- Don't require git [\#318](https://github.com/puppetlabs/puppet-resource_api/pull/318) ([joshcooper](https://github.com/joshcooper))
|
|
27
|
+
- \(maint\) Don't require git [\#318](https://github.com/puppetlabs/puppet-resource_api/pull/318) ([joshcooper](https://github.com/joshcooper))
|
|
16
28
|
- \(PA-5641\) Update rspec tests with modern Ruby [\#317](https://github.com/puppetlabs/puppet-resource_api/pull/317) ([mhashizume](https://github.com/mhashizume))
|
|
17
|
-
- Update to Mend [\#311](https://github.com/puppetlabs/puppet-resource_api/pull/311) ([cthorn42](https://github.com/cthorn42))
|
|
29
|
+
- \(maint\) Update to Mend [\#311](https://github.com/puppetlabs/puppet-resource_api/pull/311) ([cthorn42](https://github.com/cthorn42))
|
|
30
|
+
- \(packaging\) Bump to version '1.8.17' \[no-promote\] [\#301](https://github.com/puppetlabs/puppet-resource_api/pull/301) ([tvpartytonight](https://github.com/tvpartytonight))
|
|
18
31
|
|
|
19
32
|
## [1.8.16](https://github.com/puppetlabs/puppet-resource_api/tree/1.8.16) (2022-10-03)
|
|
20
33
|
|
|
@@ -36,7 +36,7 @@ module Puppet::ResourceApi
|
|
|
36
36
|
Puppet::ResourceApi::DataTypeHandling.validate_ensure(definition)
|
|
37
37
|
|
|
38
38
|
definition[:features] ||= []
|
|
39
|
-
supported_features = %w[supports_noop canonicalize custom_insync remote_resource simple_get_filter].freeze
|
|
39
|
+
supported_features = %w[supports_noop canonicalize custom_insync remote_resource simple_get_filter custom_generate].freeze
|
|
40
40
|
unknown_features = definition[:features] - supported_features
|
|
41
41
|
Puppet.warning("Unknown feature detected: #{unknown_features.inspect}") unless unknown_features.empty?
|
|
42
42
|
end
|
data/lib/puppet/resource_api.rb
CHANGED
|
@@ -136,6 +136,23 @@ module Puppet::ResourceApi
|
|
|
136
136
|
@rsapi_canonicalized_target_state
|
|
137
137
|
end
|
|
138
138
|
|
|
139
|
+
# Method is used to custom generate resources which are then applied by Puppet
|
|
140
|
+
def generate
|
|
141
|
+
# If feature `custom_generate` has been set then call the generate function within the provider and return the given results
|
|
142
|
+
return unless type_definition&.feature?('custom_generate')
|
|
143
|
+
should_hash = rsapi_canonicalized_target_state
|
|
144
|
+
is_hash = rsapi_current_state
|
|
145
|
+
title = rsapi_title
|
|
146
|
+
|
|
147
|
+
# Ensure that a custom `generate` method has been created within the provider
|
|
148
|
+
raise(Puppet::DevError, 'No generate method found within the types provider') unless my_provider.respond_to?(:generate)
|
|
149
|
+
# Call the providers custom `generate` method
|
|
150
|
+
rules_resources = my_provider.generate(context, title, is_hash, should_hash)
|
|
151
|
+
|
|
152
|
+
# Return array of resources
|
|
153
|
+
rules_resources
|
|
154
|
+
end
|
|
155
|
+
|
|
139
156
|
def rsapi_current_state
|
|
140
157
|
refresh_current_state unless @rsapi_current_state
|
|
141
158
|
@rsapi_current_state
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: puppet-resource_api
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.9.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- David Schmitt
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2023-
|
|
11
|
+
date: 2023-08-11 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: hocon
|