Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

elasticsearch::script doesn't work #1079

Open
icalvete opened this issue Mar 19, 2020 · 3 comments
Open

elasticsearch::script doesn't work #1079

icalvete opened this issue Mar 19, 2020 · 3 comments
Labels

Comments

@icalvete
Copy link

icalvete commented Mar 19, 2020

  • 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?

@icalvete
Copy link
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
Copy link
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
Copy link
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
Labels
Projects
None yet
Development

No branches or pull requests

2 participants