Skip to content
This repository has been archived by the owner on Jun 24, 2022. It is now read-only.

Commit

Permalink
Switch to using dpkg-query since failed_when: False also always sets the
Browse files Browse the repository at this point in the history
rc code to 0
  • Loading branch information
Crazybus committed Jun 18, 2018
1 parent 0fb83fa commit 0822460
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tasks/elasticsearch-Debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@
when: es_use_repository

- name: Check if the elasticsearch package is installed
command: dpkg -l elasticsearch
command: dpkg-query --show --showformat='${db:Status-Status}' 'elasticsearch'
register: elasticsearch_package
failed_when: False
changed_when: False

- name: Gracefully stop and remove elasticsearch if we are switching to the oss version
when:
- es_package_name == 'elasticsearch-oss'
- elasticsearch_package.rc == 0
- elasticsearch_package.stdout == 'installed'
block:
- name: stop elasticsearch
become: yes
Expand Down

0 comments on commit 0822460

Please # to comment.