Add option for disable the addition of official repository

This commit is contained in:
Kevin Tibi 2019-06-24 11:32:27 +02:00
parent 5b1d028bd2
commit 812faf9596
4 changed files with 6 additions and 3 deletions

View file

@ -43,12 +43,13 @@
apt_key:
url: '{{ es_apt_key }}'
state: present
when: es_apt_key | string
when: es_add_repository and es_apt_key | string
- name: Debian - Add elasticsearch repository
apt_repository:
repo: '{{ item.repo }}'
state: '{{ item.state }}'
when: es_add_repository
with_items:
- { repo: "{{ es_apt_url_old }}", state: "absent" }
- { repo: "{{ es_apt_url }}", state: "present" }

View file

@ -16,7 +16,7 @@
template:
src: 'elasticsearch.repo'
dest: '/etc/yum.repos.d/elasticsearch-{{ es_repo_name }}.repo'
when: es_use_repository
when: es_use_repository and es_add_repository
- name: RedHat - remove unused Elasticsearch repo
become: yes