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

bin/plugin is used insead of bin/elasticsearch-plugin on the first run #1228

Open
viliusgec opened this issue Jun 26, 2024 · 0 comments
Open

Comments

@viliusgec
Copy link

viliusgec commented Jun 26, 2024

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 6.x
  • Ruby: 2.4
  • Distribution: CentOS Linux 7
  • Module version: v8.1.0

How to reproduce (e.g Puppet code you use)

Initialize elasticsearch class and try adding plugins on the same puppet run:

 class { 'elasticsearch':
 ...
 }

 $plugins.each |String $name, Hash $config| {
   elasticsearch::plugin { $name:
     *         => $config,
   }
 }

What are you seeing

If we try installing plugins on the same run as elasticsearch class is initialized - it uses bin/plugin instead of bin/elasticsearch-plugin
Puppet::Type::Elasticsearch_plugin::ProviderElasticsearch_plugin: file /usr/share/elasticsearch/bin/plugin does not exist
On the second puppet run it does use bin/elasticsearch-plugin

What behavior did you expect instead

/usr/share/elasticsearch/bin/elasticsearch-plugin should be used instead of /usr/share/elasticsearch/bin/plugin

Any additional information you'd like to impart

It looks like this code checks if file exists before puppet run (so before elasticsearch is installed) and will determine to use bin/plugin even when elasticsearch will be installed and elasticsearch-plugin will be added. On the second run it will evaluate again and see that elasticsearch-plugin does exist.

 case Facter.value('osfamily')
  when 'OpenBSD'
    ...
  else
    if File.exist? '/usr/share/elasticsearch/bin/elasticsearch-plugin'
      commands plugin: '/usr/share/elasticsearch/bin/elasticsearch-plugin'
    else
      commands plugin: '/usr/share/elasticsearch/bin/plugin'
     ...

Also using workaround mentioned in this (creating a symlink) issue returns this: CliToolProvider [asticsearch/bin/plugin] not found, available names are [node, shard, plugin, sync-plugins] error. It tries to execute asticsearch/bin/plugin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant