Changed behavior of installing with ninor version supplied or not supplied to work with one task instead of two

This commit is contained in:
Jakob Reiter 2015-07-14 11:08:17 +02:00
parent 73962c3ce6
commit 0de743b843

View file

@ -4,13 +4,8 @@
when: ( ansible_distribution == "CentOS" ) and ( ansible_distribution_major_version == "6" ) when: ( ansible_distribution == "CentOS" ) and ( ansible_distribution_major_version == "6" )
- name: RedHat - add Elasticsearch repo - name: RedHat - add Elasticsearch repo
template: src=elasticsearch.repo dest=/etc/yum.repos.d/elasticsearch-{{ es_major_version }}.repo template: src=elasticsearch.repo dest=/etc/yum.repos.d/elasticsearch-{{ es_major_version }}.repo
- name: RedHat - Install Elasticsearch with minor version supplied - name: RedHat - Install Elasticsearch
when: es_version != "" yum: name=elasticsearch{% if es_version is defined and es_version != "" %}-{{ es_version }}{% endif %} state=present update_cache=yes
yum: name=elasticsearch-{{ es_version }} state=present update_cache=yes
register: elasticsearch_install
- name: RedHat - Install Elasticsearch without minor version supplied
when: es_version == ""
yum: name=elasticsearch state=present update_cache=yes
register: elasticsearch_install register: elasticsearch_install
- name: RedHat - configure memory - name: RedHat - configure memory