Expose apt repo configuration

Currently one can not override the apt repository used for ELK stack
package installation due to variable precedence as the repo info is
defined in vars rather than defaults. To be able to do so is
particularly useful in the case that on wishes to specify alternative
mirrors to use. This commit optionally exposes the remote apt
configuration in the elastic_repoitory role defaults so that the user
can modify it in order to redirect to a mirror. The default
configuration is unchanged.

Change-Id: I6459bd8b1b55253a869b018d187c7ec29957a3c1
This commit is contained in:
Duncan Walker 2020-02-24 14:34:54 +00:00 committed by Duncan Martin Walker
parent 1ba435f78e
commit 80e8bedcf0
2 changed files with 9 additions and 1 deletions

View File

@ -18,3 +18,9 @@ elastic_repo_ppas: []
# List of packages to install
elastic_repo_distro_packages: []
# Elasticsearch apt repo to use for package install. Uncomment to change, e.g. for mirror usage
# elastic_apt_repo:
# repo: 'deb https://artifacts.elastic.co/packages/7.x/apt stable main'
# state: "{{ ((elk_package_state | default('present')) == 'absent') | ternary('absent', 'present') }}"
# key_url: "https://artifacts.elastic.co/GPG-KEY-elasticsearch"

View File

@ -17,7 +17,9 @@ elastic_repo_distro_packages:
- apt-transport-https
# elk apt repo
elastic_repo:
_elastic_repo:
repo: 'deb https://artifacts.elastic.co/packages/7.x/apt stable main'
state: "{{ ((elk_package_state | default('present')) == 'absent') | ternary('absent', 'present') }}"
key_url: "https://artifacts.elastic.co/GPG-KEY-elasticsearch"
elastic_repo: "{{ elastic_apt_repo | default(_elastic_repo) }}"