aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/roles/docker/tasks
diff options
context:
space:
mode:
authorEgor Tensin <egor@tensin.name>2024-03-17 15:26:51 +0100
committerEgor Tensin <egor@tensin.name>2024-03-17 15:26:58 +0100
commit45d559454357adb56a21743d8ab958c30a3ab847 (patch)
tree5a52d490a3f35f4a2975d091d683107588d20dec /roles/docker/tasks
parentv2.0.4 (diff)
downloadinfra-ansible-45d559454357adb56a21743d8ab958c30a3ab847.tar.gz
infra-ansible-45d559454357adb56a21743d8ab958c30a3ab847.zip
make the mechanism of inclusion of platform-specific vars more uniform
Diffstat (limited to 'roles/docker/tasks')
-rw-r--r--roles/docker/tasks/main.yml12
1 files changed, 9 insertions, 3 deletions
diff --git a/roles/docker/tasks/main.yml b/roles/docker/tasks/main.yml
index a5327e0..26089f3 100644
--- a/roles/docker/tasks/main.yml
+++ b/roles/docker/tasks/main.yml
@@ -1,14 +1,20 @@
-- name: Ensure ansible_facts used by role
+- name: Get host distro
ansible.builtin.setup:
- gather_subset: os_family
+ gather_subset:
+ - distribution
+ - distribution_major_version
+ - distribution_release
+ - os_family
- name: Set platform-specific variables
ansible.builtin.include_vars: "{{ __docker_vars_file }}"
loop:
- "{{ ansible_facts['os_family'] }}.yml"
+ - "{{ ansible_facts['distribution'] }}.yml"
+ - "{{ ansible_facts['distribution'] }}_{{ ansible_facts['distribution_major_version'] }}.yml"
vars:
__docker_vars_file: "{{ role_path }}/vars/{{ item }}"
- when: __docker_vars_file is file
+ when: __docker_vars_file is exists
- name: Configure Docker logging driver
when: docker_logging_driver is defined and docker_logging_driver