From 237f666ade538e4195664de4eff1fa8a2d9454ce Mon Sep 17 00:00:00 2001 From: L3D Date: Mon, 2 Mar 2020 21:16:03 +0100 Subject: [PATCH 1/3] make sure it will war you if you use a not supported OS --- tasks/main.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tasks/main.yml b/tasks/main.yml index 325df61..3bd75af 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -20,6 +20,9 @@ state: present fingerprint: "{{ epel_repo['fingerprint'][ ansible_distribution_major_version ] }}" become: true + when: + - ansible_os_family == 'RedHat' + - ansible_distribution != 'Fedorra' - name: Install EPEL repo become: true @@ -29,3 +32,10 @@ register: result until: result is succeeded retries: 3 + when: + - ansible_os_family == 'RedHat' + - ansible_distribution != 'Fedorra' + +- name: info for fedora and non RHEL + pause: + prompt: "Please notice this role is designed to work only with RHEL/CentOS 6,7 and 8" From d4614888a53b9d24fe4670b00ff760c6ffebba5c Mon Sep 17 00:00:00 2001 From: L3D Date: Mon, 2 Mar 2020 21:16:16 +0100 Subject: [PATCH 2/3] Finalize docs --- README.md | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/README.md b/README.md index 784fd5a..4b75c6f 100644 --- a/README.md +++ b/README.md @@ -69,27 +69,10 @@ This role is tested with [these github-action](https://github.com/search?q=topic If you want to find out more about our tests, please have a look at the github marketplace. | test status | Github Marketplace | -| :---------: | :----------------: | +| :--------- | :---------------- | | [![Travis Build Status](https://travis-ci.org/roles-ansible/role_install-epel-release.svg?branch=master)](https://travis-ci.org/roles-ansible/role_install-epel-release) | [.travis.yml](https://github.com/roles-ansible/role_install-epel-release/blob/master/.travis.yml) | | [![Ansible check centos:latest](https://github.com/roles-ansible/role_install-epel-release/workflows/Ansible%20check%20centos:latest/badge.svg)](https://github.com/roles-ansible/role_install-epel-release/actions?query=workflow%3A%22Ansible+check+centos%3Alatest%22) | [ansible test with centos:latest](https://github.com/roles-ansible/role_install-epel-release/blob/master/.travis.yml) | [ansible test with centos latest](https://github.com/marketplace/actions/check-ansible-centos-latest) | | [![Ansible check centos:centos8](https://github.com/roles-ansible/role_install-epel-release/workflows/Ansible%20check%20centos:centos8/badge.svg)](https://github.com/roles-ansible/role_install-epel-release/actions?query=workflow%3A%22Ansible+check+centos%3Acentos8%22) | [ansible test with centos 8](https://github.com/marketplace/actions/check-ansible-centos-centos8) | | [![Ansible check centos:centos7](https://github.com/roles-ansible/role_install-epel-release/workflows/Ansible%20check%20centos:centos7/badge.svg)](https://github.com/roles-ansible/role_install-epel-release/actions?query=workflow%3A%22Ansible+check+centos%3Acentos7%22) | [ansible test with centos 7](https://github.com/marketplace/actions/check-ansible-centos-centos7) | | [![Ansible check centos:centos6](https://github.com/roles-ansible/role_install-epel-release/workflows/Ansible%20check%20centos:centos6/badge.svg)](https://github.com/roles-ansible/role_install-epel-release/actions?query=workflow%3A%22Ansible+check+centos%3Acentos6%22) | [ansible test with centos 6](https://github.com/marketplace/actions/check-ansible-centos-centos6) | | [![Ansible Lint check](https://github.com/roles-ansible/role_install-epel-release/workflows/Ansible%20Lint%20check/badge.svg)](https://github.com/roles-ansible/role_install-epel-release/actions?query=workflow%3A%22Ansible+Lint+check%22) | [ansible linting test](https://github.com/marketplace/actions/ansible-lint) | - - -WIP ----- - -``` -WORK IN PROGRESS - -missing: -- os detection (RHEL) - -working: -- docs -- epel install on centos 7 -- github-actions -- vars -``` From a4410fac66967e4ad40190fd2abb535f90aa863c Mon Sep 17 00:00:00 2001 From: L3D Date: Mon, 2 Mar 2020 21:19:49 +0100 Subject: [PATCH 3/3] Add condition for OS warning --- tasks/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/tasks/main.yml b/tasks/main.yml index 3bd75af..7a31f09 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -39,3 +39,4 @@ - name: info for fedora and non RHEL pause: prompt: "Please notice this role is designed to work only with RHEL/CentOS 6,7 and 8" + when: ansible_os_family != 'RedHat' or ansible_distribution == 'Fedorra'