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"
|
selection: "hold"
|
||||||
when: es_version_lock
|
when: es_version_lock
|
||||||
|
|
||||||
- name: Debian - Download elasticsearch from url
|
# workaround due to https://github.com/ansible/ansible/issues/66977
|
||||||
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
|
- set_fact:
|
||||||
when: not es_use_repository
|
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
|
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
|
when: not es_use_repository
|
||||||
register: elasticsearch_install_from_package
|
register: elasticsearch_install_from_package
|
||||||
notify: restart elasticsearch
|
notify: restart elasticsearch
|
||||||
|
|
|
||||||
|
|
@ -54,9 +54,15 @@
|
||||||
environment:
|
environment:
|
||||||
ES_PATH_CONF: "{{ es_conf_dir }}"
|
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
|
- name: RedHat - Install Elasticsearch from url
|
||||||
become: yes
|
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
|
when: not es_use_repository
|
||||||
register: elasticsearch_install_from_package
|
register: elasticsearch_install_from_package
|
||||||
notify: restart elasticsearch
|
notify: restart elasticsearch
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
---
|
---
|
||||||
java: "{{ es_java | default('java-1.8.0-openjdk.x86_64') }}"
|
java: "{{ es_java | default('java-1.8.0-openjdk.x86_64') }}"
|
||||||
default_file: "/etc/sysconfig/elasticsearch"
|
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