From 80e8bedcf0e0c18ae812fa18d26a2db8c417cf3a Mon Sep 17 00:00:00 2001 From: Duncan Walker Date: Mon, 24 Feb 2020 14:34:54 +0000 Subject: [PATCH] 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 --- elk_metrics_7x/roles/elastic_repositories/defaults/main.yml | 6 ++++++ elk_metrics_7x/roles/elastic_repositories/vars/ubuntu.yml | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/elk_metrics_7x/roles/elastic_repositories/defaults/main.yml b/elk_metrics_7x/roles/elastic_repositories/defaults/main.yml index 8448bf56..aaf44ae2 100644 --- a/elk_metrics_7x/roles/elastic_repositories/defaults/main.yml +++ b/elk_metrics_7x/roles/elastic_repositories/defaults/main.yml @@ -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" diff --git a/elk_metrics_7x/roles/elastic_repositories/vars/ubuntu.yml b/elk_metrics_7x/roles/elastic_repositories/vars/ubuntu.yml index a1716e26..2542fecd 100644 --- a/elk_metrics_7x/roles/elastic_repositories/vars/ubuntu.yml +++ b/elk_metrics_7x/roles/elastic_repositories/vars/ubuntu.yml @@ -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) }}"