From d99c0c86c50b1c3212ff5763d14c3828ca81317b Mon Sep 17 00:00:00 2001 From: SuRaMoN Date: Mon, 29 Jun 2020 13:46:51 +0200 Subject: [PATCH] Fixed running ansible in check mode (#701) Co-authored-by: Julien Mailleret <8582351+jmlrt@users.noreply.github.com> --- tasks/elasticsearch-RedHat.yml | 2 +- tasks/elasticsearch-parameters.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tasks/elasticsearch-RedHat.yml b/tasks/elasticsearch-RedHat.yml index a7b974d3..f3ebc1ed 100644 --- a/tasks/elasticsearch-RedHat.yml +++ b/tasks/elasticsearch-RedHat.yml @@ -45,7 +45,7 @@ state: present update_cache: yes allow_downgrade: '{{ allow_downgrade }}' - when: es_use_repository + when: es_use_repository and not ansible_check_mode register: redhat_elasticsearch_install_from_repo notify: restart elasticsearch until: redhat_elasticsearch_install_from_repo.rc == 0 diff --git a/tasks/elasticsearch-parameters.yml b/tasks/elasticsearch-parameters.yml index e41423a8..63693fc7 100644 --- a/tasks/elasticsearch-parameters.yml +++ b/tasks/elasticsearch-parameters.yml @@ -12,7 +12,7 @@ #If the user attempts to lock memory they must specify a heap size - name: fail when heap size is not specified when using memory lock fail: msg="If locking memory with bootstrap.memory_lock a heap size must be specified" - when: es_config['bootstrap.memory_lock'] is defined and es_config['bootstrap.memory_lock'] == True and es_heap_size is not defined + when: es_config['bootstrap.memory_lock'] is defined and es_config['bootstrap.memory_lock'] == True and es_heap_size is not defined and not ansible_check_mode #Check if working with security we have an es_api_basic_auth_username and es_api_basic_auth_username - otherwise any http calls wont work - name: fail when api credentials are not declared when using security