Skip to content

Commit adbccc2

Browse files
committed
Fix for the issue introduces with the change in elastic/ansible-elasticsearch#170
Changed debian repo from http to https, but exisiting http repos (from earlier runs) would persist and lead to an duplicate entry warning in apt. This PR will remove the old http repo, if present.
1 parent 38354cb commit adbccc2

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

defaults/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ es_version_lock: false
55
es_use_repository: true
66
es_apt_key: "https://packages.elasticsearch.org/GPG-KEY-elasticsearch"
77
es_apt_url: "deb https://packages.elastic.co/elasticsearch/{{ es_major_version }}/debian stable main"
8+
es_apt_url_old: "deb http://packages.elastic.co/elasticsearch/{{ es_major_version }}/debian stable main"
89
es_start_service: true
910
es_java_install: true
1011
update_java: false

tasks/elasticsearch-Debian.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@
1414
when: es_use_repository and es_apt_key
1515

1616
- name: Debian - Add elasticsearch repository
17-
apt_repository: repo="{{ es_apt_url }}" state=present
17+
apt_repository: repo={{ item.repo }} state={{ item.state}}
18+
with_items:
19+
- { repo: "{{ es_apt_url_old }}", state: "absent" }
20+
- { repo: "{{ es_apt_url }}", state: "present" }
1821
when: es_use_repository
1922

2023
- name: Debian - Include versionlock

0 commit comments

Comments
 (0)