diff --git a/tasks/repo-RedHat.yml b/tasks/repo-RedHat.yml index c8ace74..d3d1681 100644 --- a/tasks/repo-RedHat.yml +++ b/tasks/repo-RedHat.yml @@ -1,26 +1,24 @@ --- - - block: - - - name: Install epel-release on CentOS - yum: - name: epel-release - state: present - when: ansible_distribution in [ 'CentOS', 'Rocky', 'AlmaLinux' ] - - - name: Install epel-release on RHEL - package: - name: "https://dl.fedoraproject.org/pub/epel/epel-release-latest-{{ ansible_distribution_major_version }}.noarch.rpm" - state: present - when: ansible_distribution in [ 'RedHat' ] - - - name: Install epel-release and hostname on OracleLinux - package: - name: - - "oracle-epel-release-el{{ ansible_distribution_major_version }}" - - hostname - state: present - when: ansible_distribution in [ 'OracleLinux' ] + - name: Install epel-release on CentOS + yum: + name: epel-release + state: present + when: ansible_distribution in [ 'CentOS', 'Rocky', 'AlmaLinux' ] + + - name: Install epel-release on RHEL + package: + name: "https://dl.fedoraproject.org/pub/epel/epel-release-latest-{{ ansible_distribution_major_version }}.noarch.rpm" + state: present + when: ansible_distribution in [ 'RedHat' ] + + - name: Install epel-release and hostname on OracleLinux + package: + name: + - "oracle-epel-release-el{{ ansible_distribution_major_version }}" + - hostname + state: present + when: ansible_distribution in [ 'OracleLinux' ] when: pdns_install_epel @@ -32,6 +30,14 @@ - ansible_distribution in [ 'CentOS', 'Rocky', 'AlmaLinux' ] - ansible_distribution_major_version | int < 8 +- name: Install policycoreutils-python-utils to manage an SELinux environment. + package: + name: policycoreutils-python-utils + state: present + when: + - ansible_distribution in [ 'RedHat' 'CentOS', 'Rocky', 'AlmaLinux' ] + - ansible_distribution_major_version | int > 9 + - name: Add the PowerDNS YUM Repository yum_repository: name: "{{ pdns_install_repo['name'] }}"