Skip to content

Commit

Permalink
rollback
Browse files Browse the repository at this point in the history
  • Loading branch information
stjmt committed Jul 30, 2024
1 parent d603a5d commit eecc314
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 14 deletions.
14 changes: 0 additions & 14 deletions lib/puppet/provider/elasticsearch_license/ruby.rb

This file was deleted.

32 changes: 32 additions & 0 deletions lib/puppet/provider/elasticsearch_license/xpack.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# frozen_string_literal: true

require 'puppet/provider/elastic_rest'

Puppet::Type.type(:elasticsearch_license).provide(
:ruby,
parent: Puppet::Provider::ElasticREST,
metadata: :content,
metadata_pipeline: [
->(data) { Puppet_X::Elastic.deep_to_s data },
->(data) { Puppet_X::Elastic.deep_to_i data }
],
api_uri: '_license',
query_string: {
'acknowledge' => 'true'
}
) do
desc 'A REST API based provider to manage Elasticsearch licenses.'

mk_resource_methods

def self.process_body(body)
JSON.parse(body).map do |object_name, api_object|
{
:name => object_name,
:ensure => :present,
metadata => { 'licenses' => process_metadata(api_object) },
:provider => name
}
end
end
end

0 comments on commit eecc314

Please sign in to comment.