Fix deb and rpm url (#788)
* Fix commit fix the deb package url for Elasticsearch 6.x * Fix commit fix the rpm package url for Elasticsearch 6.x and 7.x * Download deb package directly using apt module * Use new ansible syntax
This commit is contained in:
parent
4f01bc74a0
commit
3904913be5
3 changed files with 15 additions and 7 deletions
|
|
@ -102,13 +102,15 @@
|
|||
selection: "hold"
|
||||
when: es_version_lock
|
||||
|
||||
- name: Debian - Download elasticsearch from url
|
||||
get_url: url={% if es_custom_package_url is defined %}{{ es_custom_package_url }}{% else %}{{ es_package_url }}-{{ es_version }}-amd64.deb{% endif %} dest=/tmp/elasticsearch-{{ es_version }}.deb validate_certs=no
|
||||
when: not es_use_repository
|
||||
# workaround due to https://github.com/ansible/ansible/issues/66977
|
||||
- set_fact:
|
||||
es_deb_url: "{% if es_version is version('7.0.0', '>=') %}{{ es_package_url }}-{{ es_version }}-amd64.deb{% else %}{{ es_package_url }}-{{ es_version }}.deb{% endif %}"
|
||||
|
||||
- name: Debian - Ensure elasticsearch is installed from downloaded package
|
||||
- name: Debian - Install Elasticsearch from url
|
||||
become: yes
|
||||
apt: deb=/tmp/elasticsearch-{{ es_version }}.deb
|
||||
apt:
|
||||
deb: "{% if es_custom_package_url is defined %}{{ es_custom_package_url }}{% else %}{{ es_deb_url }}{% endif %}"
|
||||
state: present
|
||||
when: not es_use_repository
|
||||
register: elasticsearch_install_from_package
|
||||
notify: restart elasticsearch
|
||||
|
|
|
|||
|
|
@ -54,9 +54,15 @@
|
|||
environment:
|
||||
ES_PATH_CONF: "{{ es_conf_dir }}"
|
||||
|
||||
# workaround due to https://github.com/ansible/ansible/issues/66977
|
||||
- set_fact:
|
||||
es_rpm_url: "{% if es_version is version('7.0.0', '>=') %}{{ es_package_url }}-{{ es_version }}-x86_64.rpm{% else %}{{ es_package_url }}-{{ es_version }}.rpm{% endif %}"
|
||||
|
||||
- name: RedHat - Install Elasticsearch from url
|
||||
become: yes
|
||||
yum: name={% if es_custom_package_url is defined %}{{ es_custom_package_url }}{% else %}{{ es_package_url }}-{{ es_version }}.noarch.rpm{% endif %} state=present
|
||||
yum:
|
||||
name: '{% if es_custom_package_url is defined %}{{ es_custom_package_url }}{% else %}{{ es_rpm_url }}{% endif %}'
|
||||
state: present
|
||||
when: not es_use_repository
|
||||
register: elasticsearch_install_from_package
|
||||
notify: restart elasticsearch
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
---
|
||||
java: "{{ es_java | default('java-1.8.0-openjdk.x86_64') }}"
|
||||
default_file: "/etc/sysconfig/elasticsearch"
|
||||
es_home: "/usr/share/elasticsearch"
|
||||
es_home: "/usr/share/elasticsearch"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue