From d48b52f2909e574bc921d5785f638146b678ff92 Mon Sep 17 00:00:00 2001 From: Jan Dreyer Date: Tue, 13 Nov 2018 16:39:20 +0100 Subject: [PATCH 1/4] * don't fetch APT key if existent --- tasks/elasticsearch-Debian.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/elasticsearch-Debian.yml b/tasks/elasticsearch-Debian.yml index eec8be8..f0943b8 100644 --- a/tasks/elasticsearch-Debian.yml +++ b/tasks/elasticsearch-Debian.yml @@ -14,7 +14,7 @@ - name: Debian - Add Elasticsearch repository key become: yes - apt_key: url="{{ es_apt_key }}" state=present + apt_key: url="{{ es_apt_key }}" id=46095ACC8548582C1A2699A9D27D666CD88E42B4 state=present when: es_use_repository and es_apt_key - name: Debian - Add elasticsearch repository From 212c4e13897fb6fb168d0a51a3fd5ba70aa4846d Mon Sep 17 00:00:00 2001 From: VerboEse Date: Sat, 21 Sep 2019 23:31:30 +0200 Subject: [PATCH 2/4] make repository key id configurable via variable --- tasks/elasticsearch-Debian.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/elasticsearch-Debian.yml b/tasks/elasticsearch-Debian.yml index f0943b8..7b14866 100644 --- a/tasks/elasticsearch-Debian.yml +++ b/tasks/elasticsearch-Debian.yml @@ -14,7 +14,7 @@ - name: Debian - Add Elasticsearch repository key become: yes - apt_key: url="{{ es_apt_key }}" id=46095ACC8548582C1A2699A9D27D666CD88E42B4 state=present + apt_key: url="{{ es_apt_key }}" id="{{ es_apt_key_id }}" state=present when: es_use_repository and es_apt_key - name: Debian - Add elasticsearch repository From d04905e75f27c70f13df46bc490191cfd4115422 Mon Sep 17 00:00:00 2001 From: Jan Dreyer Date: Sat, 21 Sep 2019 23:41:37 +0200 Subject: [PATCH 3/4] removing duplicate stuff moving es_apt_key_id to correct position --- tasks/elasticsearch-Debian.yml | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/tasks/elasticsearch-Debian.yml b/tasks/elasticsearch-Debian.yml index 66d0a14..50e1ae7 100644 --- a/tasks/elasticsearch-Debian.yml +++ b/tasks/elasticsearch-Debian.yml @@ -9,26 +9,6 @@ - name: Gracefully stop and remove elasticsearch package if switching between OSS and standard become: yes - apt: name=apt-transport-https state=present - when: es_use_repository - -- name: Debian - Add Elasticsearch repository key - become: yes - apt_key: url="{{ es_apt_key }}" id="{{ es_apt_key_id }}" state=present - when: es_use_repository and es_apt_key - -- name: Debian - Add elasticsearch repository - become: yes - apt_repository: repo={{ item.repo }} state={{ item.state}} - with_items: - - { repo: "{{ es_apt_url_old }}", state: "absent" } - - { repo: "{{ es_apt_url }}", state: "present" } - when: es_use_repository - - -- name: Gracefully stop and remove elasticsearch if we are switching to the oss version - when: - - es_package_name == 'elasticsearch-oss' block: - name: Check if the elasticsearch package is installed shell: "dpkg-query -W -f'${Status}' {{ es_other_package_name }}" @@ -69,6 +49,7 @@ - name: Debian - Add Elasticsearch repository key apt_key: url: '{{ es_apt_key }}' + id: '{{ es_apt_key_id }}' state: present when: es_add_repository and es_apt_key | string From b52a570b9ecd048740b9af28001bcb84f5ce6ce1 Mon Sep 17 00:00:00 2001 From: Jan Dreyer Date: Sat, 21 Sep 2019 23:54:11 +0200 Subject: [PATCH 4/4] adding es_apt_key_id to var declaration for Debian --- vars/Debian.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/vars/Debian.yml b/vars/Debian.yml index 071736e..9d9bdff 100644 --- a/vars/Debian.yml +++ b/vars/Debian.yml @@ -2,3 +2,4 @@ java: "{% if es_java is defined %}{{es_java}}{% else %}openjdk-8-jre-headless{% endif %}" default_file: "/etc/default/elasticsearch" es_home: "/usr/share/elasticsearch" +es_apt_key_id: "46095ACC8548582C1A2699A9D27D666CD88E42B4"