Fix for the issue introduces with the change in https://github.com/elastic/ansible-elasticsearch/pull/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.
This commit is contained in:
Jakob Reiter 2016-10-28 17:36:57 +02:00
parent 38354cb0bb
commit adbccc215d
2 changed files with 5 additions and 1 deletions

View file

@ -5,6 +5,7 @@ es_version_lock: false
es_use_repository: true
es_apt_key: "https://packages.elasticsearch.org/GPG-KEY-elasticsearch"
es_apt_url: "deb https://packages.elastic.co/elasticsearch/{{ es_major_version }}/debian stable main"
es_apt_url_old: "deb http://packages.elastic.co/elasticsearch/{{ es_major_version }}/debian stable main"
es_start_service: true
es_java_install: true
update_java: false

View file

@ -14,7 +14,10 @@
when: es_use_repository and es_apt_key
- name: Debian - Add elasticsearch repository
apt_repository: repo="{{ es_apt_url }}" state=present
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: Debian - Include versionlock