Skip to content

Commit

Permalink
Merge pull request #18 from solarwinds/NH-62661_Add_supported_OS
Browse files Browse the repository at this point in the history
[NH-62661] Add supported operating systems
  • Loading branch information
ArkadiuszNitkaSWI authored Oct 20, 2023
2 parents 9afa54c + 66404e8 commit e195487
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
14 changes: 14 additions & 0 deletions tasks/os-support-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,20 @@
- ansible_facts.distribution == 'RedHat'
- ansible_facts.distribution_major_version|int < 7

- name: Check Amazon version
ansible.builtin.fail:
msg: 'Your RedHat version is not supported. The {{ product_name }} is supported on Amazon 2 and above.'
when:
- ansible_facts.distribution == 'Amazon'
- ansible_facts.distribution_major_version|int < 2

- name: Check Rocky version
ansible.builtin.fail:
msg: 'Your RedHat version is not supported. The {{ product_name }} is supported on Rocky 8 and above.'
when:
- ansible_facts.distribution == 'Rocky'
- ansible_facts.distribution_major_version|int < 8

- name: Check CentOS version
ansible.builtin.fail:
msg: 'Your CentOS version is not supported. The {{ product_name }} is supported on Centos 7 and above.'
Expand Down
11 changes: 3 additions & 8 deletions tasks/set-pkg-manager.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
---
- name: Check if package type is rpm
ansible.builtin.set_fact:
pkg_type: 'rpm'
when: ansible_facts.distribution in ['RedHat', 'CentOS', 'Fedora', 'OracleLinux']

- name: Check if package type is deb
ansible.builtin.set_fact:
pkg_type: 'deb'
Expand All @@ -14,11 +9,11 @@
- name: Check if package type is rpm
ansible.builtin.set_fact:
pkg_type: 'rpm'
when: ansible_facts.distribution in ['RedHat', 'CentOS', 'Fedora', 'OracleLinux']
when: ansible_facts.distribution in ['RedHat', 'CentOS', 'Fedora', 'OracleLinux', 'Amazon', 'Rocky']

- name: Fail if package type is not defined
ansible.builtin.fail:
msg: Coult not determin installation package type.
msg: Could not determine installation package manager.
when: pkg_type is undefined

- name: Check if package manager is dnf (for rpm)
Expand All @@ -35,7 +30,7 @@
pkg_manager: yum
command_if_uams_installed: yum list | grep uamsclient | awk '{print $2}' | cut -f1 -d-
when: pkg_type == 'rpm' and (
ansible_facts.distribution == 'OracleLinux'
ansible_facts.distribution in ['OracleLinux', 'Rocky', 'Amazon']
or (ansible_facts.distribution in ['CentOS', 'RedHat'] and ansible_facts.distribution_major_version | int < 8)
)

Expand Down

0 comments on commit e195487

Please sign in to comment.