Open worwoods opened 5 years ago
Hmm, as far as I'm aware, the module should be passing through the requisite environment variables to make this work. Out of curiousity, which version of Elasticsearch is this for? In addition, performing a puppet run in which one of these plugins needs to be installed (by first, for example, uninstalling the plugin) and running the manifest application with --debug
should also expose the command that Puppet executes, which should be defining -Dhttp.proxyHost
and similar arguments.
I'm seeing the following:
Debug: Elasticsearch_plugin[ingest-geoip](provider=elasticsearch_plugin): Commands: ["install", "--batch", "ingest-geoip"]
Debug: Executing: '/usr/share/elasticsearch/bin/elasticsearch-plugin install --batch ingest-geoip'
Debug: Elasticsearch_plugin[ingest-geoip](provider=elasticsearch_plugin): Failed to install plugin. Retrying... 1 of 3
Debug: Executing: '/usr/share/elasticsearch/bin/elasticsearch-plugin install --batch ingest-geoip'
Debug: Elasticsearch_plugin[ingest-geoip](provider=elasticsearch_plugin): Failed to install plugin. Retrying... 2 of 3
Debug: Executing: '/usr/share/elasticsearch/bin/elasticsearch-plugin install --batch ingest-geoip'
Debug: Elasticsearch_plugin[ingest-geoip](provider=elasticsearch_plugin): Failed to install plugin. Retrying... 3 of 3
Error: Could not set 'present' on ensure: Failed to install plugin. Received error: #<Puppet::ExecutionFailure: Execution of '/usr/share/elasticsearch/bin/elasticsearch-plugin install --batch ingest-geoip' returned 64: A tool for managing installed elasticsearch plugins
Commands
--------
list - Lists installed elasticsearch plugins
install - Install a plugin
remove - removes a plugin from Elasticsearch
Non-option arguments:
command
Option Description
------ -----------
-h, --help show help
-s, --silent show minimal output
-v, --verbose show verbose output
ERROR: Unknown plugin ingest-geoip> (file: /home/ec2-user/.puppetlabs/etc/code/modules/elasticsearch/manifests/plugin.pp, line: 134)
Error: Could not set 'present' on ensure: Failed to install plugin. Received error: #<Puppet::ExecutionFailure: Execution of '/usr/share/elasticsearch/bin/elasticsearch-plugin install --batch ingest-geoip' returned 64: A tool for managing installed elasticsearch plugins
Commands
--------
list - Lists installed elasticsearch plugins
install - Install a plugin
remove - removes a plugin from Elasticsearch
Non-option arguments:
command
Option Description
------ -----------
-h, --help show help
-s, --silent show minimal output
-v, --verbose show verbose output
ERROR: Unknown plugin ingest-geoip> (file: /home/ec2-user/.puppetlabs/etc/code/modules/elasticsearch/manifests/plugin.pp, line: 134)
Wrapped exception:
Failed to install plugin. Received error: #<Puppet::ExecutionFailure: Execution of '/usr/share/elasticsearch/bin/elasticsearch-plugin install --batch ingest-geoip' returned 64: A tool for managing installed elasticsearch plugins
Commands
--------
list - Lists installed elasticsearch plugins
install - Install a plugin
remove - removes a plugin from Elasticsearch
Non-option arguments:
command
Option Description
------ -----------
-h, --help show help
-s, --silent show minimal output
-v, --verbose show verbose output
ERROR: Unknown plugin ingest-geoip>
Error: /Stage[main]/Main/Elasticsearch::Plugin[ingest-geoip]/Elasticsearch_plugin[ingest-geoip]/ensure: change from 'absent' to 'present' failed: Could not set 'present' on ensure: Failed to install plugin. Received error: #<Puppet::ExecutionFailure: Execution of '/usr/share/elasticsearch/bin/elasticsearch-plugin install --batch ingest-geoip' returned 64: A tool for managing installed elasticsearch plugins
Commands
--------
list - Lists installed elasticsearch plugins
install - Install a plugin
remove - removes a plugin from Elasticsearch
Non-option arguments:
command
Option Description
------ -----------
-h, --help show help
-s, --silent show minimal output
-v, --verbose show verbose output
ERROR: Unknown plugin ingest-geoip> (file: /home/ec2-user/.puppetlabs/etc/code/modules/elasticsearch/manifests/plugin.pp, line: 134)
Notice: /Stage[main]/Main/Elasticsearch::Plugin[ingest-geoip]/File[/usr/share/elasticsearch/plugins/ingest-geoip]: Dependency Elasticsearch_plugin[ingest-geoip] has failures: true
Warning: /Stage[main]/Main/Elasticsearch::Plugin[ingest-geoip]/File[/usr/share/elasticsearch/plugins/ingest-geoip]: Skipping because of failed dependencies
Debug: /Stage[main]/Main/Elasticsearch
Thanks @RichardWorwood, that's helpful. Could you next:
--debug
in the same way you did previously:
diff --git a/lib/puppet/provider/elastic_plugin.rb b/lib/puppet/provider/elastic_plugin.rb
index 07fa44e..0855d2a 100644
--- a/lib/puppet/provider/elastic_plugin.rb
+++ b/lib/puppet/provider/elastic_plugin.rb
@@ -135,6 +135,7 @@ class Puppet::Provider::ElasticPlugin < Puppet::Provider
retry_times = 0
begin
with_environment do
+ debug("$ES_JAVA_OPTS: #{ENV['ES_JAVA_OPTS']}")
plugin(commands)
end
rescue Puppet::ExecutionFailure => e
Bug description
When attempting to install plugins through a proxy the proxy does not appear to be utilised.