Skip to content

elasticsearch::script doesn't work #1079

@icalvete

Description

@icalvete
  • Module version: commit 278f0c5
  • Puppet version: 6.8.1
  • OS and version: ubuntu 16.04
  • EL 7.6.1

Bug description

I have this into my manifest

   elasticsearch::script { 'my_script':
      ensure =>  'present',
      source =>  'puppet:///modules/common/elastisearch/my_script'
    }   

After repuppet, I have the script on many locations on one of my 4 nodes

root@thorin:/# find / -name "my_script"
./etc/elasticsearch/thorin/scripts/my_script
./etc/elasticsearch/scripts/my_script
./usr/share/elasticsearch/scripts/my_script

But I can't list those scripts ussing...

GET _cluster/state/metadata?pretty&filter_path=**.stored_scripts

I have tried to restart the node but scripts doesn't be loaded.

I'm doing something wrong?

Activity

icalvete

icalvete commented on Mar 20, 2020

@icalvete
Author

Since file scripts are deprecated (elastic/elasticsearch#24552 & elastic/elasticsearch#24555) this aproach is not going to work anymore.

API it's the only way.

icalvete

icalvete commented on Mar 20, 2020

@icalvete
Author

I'm thinking about rewrite this define using a type and provider (and default provider 'puppet/provider/elastic_rest') to call the Elasticsearch API

Some clue?

fatmcgav

fatmcgav commented on Mar 20, 2020

@fatmcgav
Contributor

@icalvete As you've spotted, file-based scripts have now been deprecated, and replaced by Stored scripts

Adding an elasticsearch_script type & provider is the best approach to leveraging the new API based functionality.

The API is very simple - GET, POST and DELETE.
Therefore modelling on the existing elasticsearch_pipeline type and provider should get things working pretty quickly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @fatmcgav@icalvete

        Issue actions

          elasticsearch::script doesn't work · Issue #1079 · voxpupuli/puppet-elasticsearch