# Install and Configure a Kerberos client
- name: Install Kerberos Packages (RedHat)
- yum:
+ package:
name: krb5-workstation
state: present
when: ansible_os_family == 'RedHat'
# configure things specific to yum systems
- import_tasks: yum_systems.yml
- when: ansible_pkg_mgr == "yum"
+ when: ansible_os_family == "RedHat"
# configure things specific to apt systems
- import_tasks: apt_systems.yml
- monitoring-scripts
- nagios
-# configure nagios
+# configure nagios (Except OpenSUSE and RHEL8)
- import_tasks: nagios.yml
- when: ansible_pkg_mgr != "zypper"
+ when:
+ - ansible_pkg_mgr != "zypper"
+ - not (ansible_distribution == "RedHat" and ansible_distribution_major_version == "8")
tags:
- nagios
# configure selinux for nagios
- import_tasks: nrpe-selinux.yml
when: ansible_os_family == "RedHat" and
+ ansible_distribution_major_version != "8" and
(selinux_status is defined and selinux_status.stdout != "Disabled")
tags:
- nagios
- name: Include yum_systems vars
include_vars: yum_systems.yml
- when: ansible_pkg_mgr == "yum"
+ when: ansible_os_family == "RedHat"
# Returns 0 if found and 1 if not found
# Task fails if not found. Hence ignore_errors: true
register: have_epel
no_log: true
ignore_errors: true
- when: ansible_pkg_mgr == "yum"
+ when: ansible_os_family == "RedHat"
# This task is only run when epel isn't present
- name: Install nrpe without epel
- yum:
+ package:
name: "{{ item }}"
state: present
with_items:
- http://{{ mirror_host }}/lab-extras/rhel7/x86_64/nrpe-2.15-7.el7.x86_64.rpm
- http://{{ mirror_host }}/lab-extras/rhel7/x86_64/nagios-plugins-2.0.3-3.el7.x86_64.rpm
- http://{{ mirror_host }}/lab-extras/rhel7/x86_64/nagios-plugins-load-2.0.3-3.el7.x86_64.rpm
- when: ansible_pkg_mgr == "yum" and
- have_epel.rc == 1
+ when:
+ - ansible_os_family == "RedHat"
+ - ansible_distribution_major_version <= 7
+ - have_epel.rc == 1
- name: Install nrpe package and dependencies (RHEL/CentOS)
- yum:
+ package:
name: "{{ item }}"
state: latest
enablerepo: epel
with_items: "{{ nrpe_packages }}"
- when: ansible_pkg_mgr == "yum" and
- have_epel.rc == 0
+ when:
+ - ansible_os_family == "RedHat"
+ - ansible_distribution_major_version <= 7
+ - have_epel.rc == 0
- name: Install nrpe package and dependencies (Ubuntu)
- apt:
+ package:
name: "{{ item }}"
state: latest
with_items: "{{ nrpe_packages }}"
dest: /etc/sysconfig/{{ nrpe_service_name }}
regexp: "^NRPE_SSL_OPT"
line: "NRPE_SSL_OPT=\"-n\""
- when: ansible_pkg_mgr == "yum"
+ when: ansible_os_family == "RedHat"
- name: Check firewalld status
command: systemctl status firewalld
register: firewalld
ignore_errors: true
no_log: true
- when: ansible_pkg_mgr == "yum"
+ when: ansible_os_family == "RedHat"
- name: Open nrpe port if firewalld enabled
firewalld:
state: enabled
permanent: yes
immediate: yes
- when: ansible_pkg_mgr == "yum" and (firewalld is defined and firewalld.stdout.find('running') != -1)
+ when: ansible_os_family == "RedHat" and (firewalld is defined and firewalld.stdout.find('running') != -1)
- name: Upload nagios nrpe config.
template:
until: entitled|success
retries: 5
delay: 10
+ failed_when:
+ - entitled.rc != 0
+ - '"Beta" not in ansible_lsb.description'
- name: Set rhsm_registered if we just registered
set_fact:
shell: "subscription-manager release --list | grep -E '[0-9]'"
register: rhsm_release_list
changed_when: false
- failed_when: rhsm_release_list.rc != 0 and "Beta" not in ansible_lsb.description
+ failed_when:
+ - rhsm_release_list.rc != 0
+ - ansible_lsb.description is defined
+ - '"Beta" not in ansible_lsb.description'
# We don't need to be registered to CDN since there's no packages available
# for this Beta/Alpha/RC installation
- name: Get the current timezone (RHEL/CentOS 7)
shell: 'timedatectl | grep -E "Time ?zone" | sed -e "s/.*: \(.*\) (.*/\1/"'
- when: ansible_distribution_major_version == "7"
+ when: ansible_distribution_major_version >= "7"
register: current_tz
changed_when: false
tags:
tags:
- timezone
-- name: Set the timezone (RHEL/CentOS 7)
+- name: Set the timezone (RHEL/CentOS >= 7)
command: timedatectl set-timezone {{ timezone }}
# Default is used below to avoid breaking check mode
- when: ansible_distribution_major_version == "7" and current_tz.stdout|default("") != timezone
+ when: ansible_distribution_major_version >= "7" and current_tz.stdout|default("") != timezone
tags:
- timezone
--- /dev/null
+---
+# RHEL8 repos are not yet available via RHSM
+rhsm_repos: []
+
+# Don't use satellite until RHEL8 is GAed
+use_satellite: false
+
+# These are temporary until RHEL8 is GAed
+beta_repos:
+ rhel-beta-baseos:
+ name: "RHEL {{ ansible_distribution_version }} BaseOS (RPMs)"
+ baseurl: "https://downloads.redhat.com/redhat/rhel/rhel-8-beta/baseos/x86_64/"
+ enabled: 1
+ gpgcheck: 0
+ rhel-beta-appstream:
+ name: "RHEL {{ ansible_distribution_version }} AppStream (RPMs)"
+ baseurl: "https://downloads.redhat.com/redhat/rhel/rhel-8-beta/appstream/x86_64/"
+ enabled: 1
+ gpgcheck: 0