--- # Copyright 2018, Rackspace US, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - name: Remove plugins command: "/usr/share/elasticsearch/bin/elasticsearch-plugin remove --verbose {{ item.name }}" failed_when: false changed_when: - remove_plugin.rc == 0 register: remove_plugin with_items: "{{ elastic_plugins }}" - name: Install plugins command: "/usr/share/elasticsearch/bin/elasticsearch-plugin install --batch --verbose {{ item.remote | default(item.name) }}" with_items: "{{ elastic_plugins }}" when: proxy_env_url is not defined - name: Install plugins via proxy command: "/usr/share/elasticsearch/bin/elasticsearch-plugin install --batch --verbose {{ item.remote | default(item.name) }}" environment: ES_JAVA_OPTS: "-Dhttp.proxyHost={{ proxy_env_url | urlsplit('hostname') }} -Dhttp.proxyPort={{ proxy_env_url | urlsplit('port') }} -Dhttps.proxyHost={{ proxy_env_url | urlsplit('hostname') }} -Dhttps.proxyPort={{ proxy_env_url | urlsplit('port') }}" with_items: "{{ elastic_plugins }}" when: proxy_env_url is defined