Stop plugin install to fail in check mode (#787)

In check mode Ansible is actually not going to execute the command.
Therefore, the return code is not defined making the role fail when
execute in Ansible check mode.

Co-authored-by: Julien Mailleret <8582351+jmlrt@users.noreply.github.com>
This commit is contained in:
Tobias Huste 2021-04-12 14:25:04 +02:00 committed by GitHub
parent 1d3be6dc6c
commit 25ae51e393
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -67,7 +67,7 @@
become: yes
command: "{{es_home}}/bin/elasticsearch-plugin install {{ item.url | default(item.plugin) }} --batch --silent"
register: plugin_installed
changed_when: plugin_installed.rc == 0
changed_when: plugin_installed.rc|default(0) == 0
with_items: "{{ es_plugins }}"
when: item.plugin in plugins_to_install
notify: restart elasticsearch
@ -75,6 +75,6 @@
CONF_DIR: "{{ es_conf_dir }}"
ES_PATH_CONF: "{{ es_conf_dir }}"
ES_INCLUDE: "{{ default_file }}"
until: plugin_installed.rc == 0
until: plugin_installed.rc|default(0) == 0
retries: 5
delay: 5