add more flexible versioning logic

This commit is contained in:
ace
2024-01-04 13:54:34 +03:00
parent 255166ae26
commit 3caa5a2049
4 changed files with 16 additions and 4 deletions

View File

@ -1,5 +1,5 @@
---
- name: Ensure podman version {{ podman_version }} installed
- name: Ensure {{ podman_package }} installed
yum:
name: "podman-{{ podman_version }}"
state: present
name: "{{ podman_package }}"
state: "{{ 'latest' if podman_version == 'latest' else 'present' }}"

View File

@ -1,3 +1,13 @@
---
- name: Load a variable file based on the OS type
include_vars: "{{ lookup('first_found', params) }}"
vars:
params:
files:
- "{{ ansible_facts['distribution'] }}.yaml"
- "{{ ansible_facts['os_family'] }}.yaml"
paths:
- "vars"
- name: Include podman install
include_tasks: "{{ ansible_facts['os_family'] }}.yaml"