From 56d37dc542fb15ec0f1fa2a54b740a2b15bece9e Mon Sep 17 00:00:00 2001 From: Pierre-Louis Bonicoli Date: Mon, 20 Jul 2020 16:02:26 +0200 Subject: [PATCH] Use ansible_distribution* facts instead of ansible_lsb lsb_release executable might not be available. The following errors occur when lsb_release isn't available: TASK [ensure-docker : Sanity check for upstream install mirrors] ERROR { "msg": "The conditional check '(docker_mirror_base_url | length) < 1' failed. The error was: error while evaluating conditional ((docker_mirror_base_url | length) < 1): 'dict object' has no attribute 'id' [...]" } LOOP [ensure-package-repositories : Add apt repositories] ERROR { "msg": "'dict object' has no attribute 'codename'" } Change-Id: I93ea718f24bd7176dca9daa82fe5b2635e21d730 --- roles/ensure-docker/vars/debian.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/ensure-docker/vars/debian.yaml b/roles/ensure-docker/vars/debian.yaml index 1b0a50f74..32d6b2254 100644 --- a/roles/ensure-docker/vars/debian.yaml +++ b/roles/ensure-docker/vars/debian.yaml @@ -66,7 +66,7 @@ _docker_keys: -----END PGP PUBLIC KEY BLOCK----- _docker_repos: - - repo: "deb {{ docker_mirror_base_url }} {{ ansible_lsb.codename }} {{ docker_update_channel }}" + - repo: "deb {{ docker_mirror_base_url }} {{ ansible_distribution_release }} {{ docker_update_channel }}" _docker_distro_packages: - docker.io @@ -87,4 +87,4 @@ _docker_upstream_distro_remove_packages: docker_distro_vars_loaded: true -_docker_mirror_base_url: "https://{{ docker_download_fqdn }}/linux/{{ ansible_lsb.id | lower }}" +_docker_mirror_base_url: "https://{{ docker_download_fqdn }}/linux/{{ ansible_distribution | lower }}"