From af2148f603f128d26dd78357d59e0498e492994f Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Tue, 19 Oct 2021 22:24:05 +0200 Subject: [PATCH] use appstream package on rocky8 --- defaults/main.yml | 7 ++++--- molecule/rocky8/converge.yml | 4 ---- tasks/main.yml | 13 +++++++++++++ tasks/overwrites.yml | 5 +++++ vars/redhat-7.yml | 3 +++ vars/redhat-8.yml | 3 +++ 6 files changed, 28 insertions(+), 7 deletions(-) create mode 100644 tasks/overwrites.yml create mode 100644 vars/redhat-7.yml create mode 100644 vars/redhat-8.yml diff --git a/defaults/main.yml b/defaults/main.yml index 250a8db..b5316a5 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,7 +1,8 @@ --- -# @var redis_packages:description: Define a list of packages to install. -redis_packages: - - redis5 +# @var redis_packages:description: > +# Define a list of packages to install. The default packages depend on the OS version. +# @end +# @var redis_packages:default: $ "_unset_" # @var redis_packages_extra:description: Can be used to install other dependency packages. redis_packages_extra: [] diff --git a/molecule/rocky8/converge.yml b/molecule/rocky8/converge.yml index 26c16d1..2b6715f 100644 --- a/molecule/rocky8/converge.yml +++ b/molecule/rocky8/converge.yml @@ -1,9 +1,5 @@ --- - name: Converge hosts: all - vars: - redis_packages_extra: - - https://repo.ius.io/ius-release-el7.rpm - - https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm roles: - role: xoxys.redis diff --git a/tasks/main.yml b/tasks/main.yml index 1f69f7a..b86f8ff 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,2 +1,15 @@ --- +- include_vars: "{{ var_files }}" + vars: + var_files: "{{ lookup('first_found', params, errors='ignore') }}" + params: + files: + - "{{ ansible_lsb.id | default('') | lower }}.yml" + - "{{ ansible_os_family | lower }}-{{ ansible_distribution_major_version }}.yml" + - "{{ ansible_os_family | lower }}.yml" + paths: + - "vars" + when: var_files + +- include_tasks: overwrites.yml - include_tasks: setup.yml diff --git a/tasks/overwrites.yml b/tasks/overwrites.yml new file mode 100644 index 0000000..49dd07b --- /dev/null +++ b/tasks/overwrites.yml @@ -0,0 +1,5 @@ +--- +- name: Define redis_packages + set_fact: + redis_packages: "{{ __redis_packages | list }}" + when: redis_packages is not defined diff --git a/vars/redhat-7.yml b/vars/redhat-7.yml new file mode 100644 index 0000000..a2a85ad --- /dev/null +++ b/vars/redhat-7.yml @@ -0,0 +1,3 @@ +--- +__redis_packages: + - redis5 diff --git a/vars/redhat-8.yml b/vars/redhat-8.yml new file mode 100644 index 0000000..fc755e8 --- /dev/null +++ b/vars/redhat-8.yml @@ -0,0 +1,3 @@ +--- +__redis_packages: + - "@redis:6"