Remove references to unsupported operating systems

All references to Gentoo, SUSE, Debian stretch and Centos-7  are removed.
Conditional tasks, ternary operators and variables are simplified where possible
OS specific variables files are generalised where possible

Change-Id: I8224deceba331d9fbca64c151b27430530a18528
This commit is contained in:
Jonathan Rosser 2021-03-16 08:30:29 +00:00
parent c843d1cd96
commit f2093a18ed
2 changed files with 7 additions and 10 deletions

View File

@ -22,17 +22,14 @@ galaxy_info:
platforms: platforms:
- name: Debian - name: Debian
versions: versions:
- stretch - buster
- name: Ubuntu - name: Ubuntu
versions: versions:
- xenial
- bionic - bionic
- focal
- name: EL - name: EL
versions: versions:
- 7 - 8
- name: opensuse
versions:
- 15
categories: categories:
- cloud - cloud
- python - python

View File

@ -39,7 +39,7 @@
key: "http://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-7" key: "http://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-7"
state: present state: present
when: when:
- ansible_facts['pkg_mgr'] in ['yum', 'dnf'] - ansible_facts['pkg_mgr'] == 'dnf'
register: _add_yum_keys register: _add_yum_keys
until: _add_yum_keys is success until: _add_yum_keys is success
retries: 5 retries: 5
@ -48,14 +48,14 @@
- name: Install the EPEL repository - name: Install the EPEL repository
yum_repository: yum_repository:
name: epel-nginx name: epel-nginx
baseurl: "{{ (centos_epel_mirror | default ('http://download.fedoraproject.org/pub/epel')) ~ '/' ~ ansible_facts['distribution_major_version'] ~ ((ansible_facts['distribution_major_version'] is version('8', '<')) | ternary('/', '/Everything/')) ~ ansible_facts['architecture'] }}" baseurl: "{{ (centos_epel_mirror | default ('http://download.fedoraproject.org/pub/epel')) ~ '/' ~ ansible_facts['distribution_major_version'] ~ '/Everything/' ~ ansible_facts['architecture'] }}"
description: 'Extra Packages for Enterprise Linux - $basearch' description: 'Extra Packages for Enterprise Linux - $basearch'
gpgcheck: yes gpgcheck: yes
enabled: yes enabled: yes
state: present state: present
includepkgs: 'nginx*' includepkgs: 'nginx*'
when: when:
- ansible_facts['pkg_mgr'] in ['yum', 'dnf'] - ansible_facts['pkg_mgr'] == 'dnf'
register: install_epel_repo register: install_epel_repo
until: install_epel_repo is success until: install_epel_repo is success
retries: 5 retries: 5
@ -64,7 +64,7 @@
- name: Install distro packages - name: Install distro packages
package: package:
name: "nginx" name: "nginx"
update_cache: "{{ (ansible_facts['pkg_mgr'] in ['apt', 'zypper']) | ternary('yes', omit) }}" update_cache: "{{ (ansible_facts['pkg_mgr'] == 'apt') | ternary('yes', omit) }}"
register: install register: install
until: install is success until: install is success
retries: 5 retries: 5