Installing plugin through shell script without prompt

Hi

I want to include the plugin installation as part of automation scripts which will install the elastic nodes & install the plugins.

In the ES documentation, I dont see any option for forcing to accept "y" or dont prompt for y/n or by default install it.

root@ip-205-2-40:/usr/share/elasticsearch/plugins# sh /tmp/install_s3rep.sh
-> Downloading file:///root/repository-s3-5.2.2.zip
[=================================================] 100%
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: plugin requires additional permissions @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

Continue with installation? [y/N]

====

root@ip-205-2-40:/usr/share/elasticsearch/plugins# /usr/share/elasticsearch/bin/elasticsearch-plugin --help
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
root@ip-205-2-40:/usr/share/elasticsearch/plugins#

I don't want it to be prompted for y/n input from user. Is there any parameter I shall pass it in command line?

1 Like

You can pass the --batch flag.

6 Likes

Thanks. It worked with the --batch flag. It will be nice if they update in the documentation.

1 Like

It is documented if you ask for help from the install command:

$ elasticsearch-plugin install --help
Install a plugin

The following official plugins may be installed by name:
  analysis-icu
  analysis-kuromoji
  analysis-phonetic
  analysis-smartcn
  analysis-stempel
  analysis-ukrainian
  discovery-azure-classic
  discovery-ec2
  discovery-file
  discovery-gce
  ingest-attachment
  ingest-geoip
  ingest-user-agent
  mapper-murmur3
  mapper-size
  repository-azure
  repository-gcs
  repository-hdfs
  repository-s3
  store-smb
  x-pack

Non-option arguments:
plugin id            

Option             Description                                            
------             -----------                                            
-E <KeyValuePair>  Configure a setting                                    
-b, --batch        Enable batch mode explicitly, automatic confirmation of
                     security permission                                  
-h, --help         show help                                              
-s, --silent       show minimal output                                    
-v, --verbose      show verbose output  

Thanks.

I meant, in the documentation where they given information about installing plugin i.e at https://www.elastic.co/guide/en/elasticsearch/plugins/current/repository-s3.html

As per the plugin help o/p there is no information about help on command too..

Syntax should have been
elasticsearch-plugin [command] --help|plugin-name

root@ip-205-2-40:/usr/share/elasticsearch/bin# ./elasticsearch-plugin --help
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
root@ip-205-2-40:/usr/share/elasticsearch/bin#

thanks anyways for the information.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.