---
# This role contains common plays that will run on all nodes.

- name: Install python bindings for SE Linux
  yum: name={{ item }} state=present
  with_items:
   - libselinux-python
   - libsemanage-python

- name: install epel
  yum: name=epel-release state=present
  
- name: install some useful nagios plugins
  yum: name={{ item }} state=present
  with_items:
   - nagios-nrpe
   - nagios-plugins-swap
   - nagios-plugins-users
   - nagios-plugins-procs
   - nagios-plugins-load
   - nagios-plugins-disk

- name: Install ntp
  yum: name=ntp state=present
  tags: ntp

- name: Configure ntp file
  template: src=ntp.conf.j2 dest=/etc/ntp.conf
  tags: ntp
  notify: restart ntp

- name: Start the ntp service
  service: name=ntpd state=started enabled=yes
  tags: ntp

# work around RHEL 7, for now
- name: insert iptables template
  template: src=iptables.j2 dest=/etc/sysconfig/iptables
  when: ansible_distribution_major_version != '7'
  notify: restart iptables

- name: test to see if selinux is running
  command: getenforce
  register: sestatus
  changed_when: false

---
# This role contains common plays that will run on all nodes.

- name: Install python bindings for SE Linux
  yum: name={{ item }} state=present
  with_items:
   - libselinux-python
   - libsemanage-python

- name: install epel
  yum: name=epel-release state=present
  
- name: install some useful nagios plugins
  yum: name={{ item }} state=present
  with_items:
   - nagios-nrpe
   - nagios-plugins-swap
   - nagios-plugins-users
   - nagios-plugins-procs
   - nagios-plugins-load
   - nagios-plugins-disk
   - nagios-plugins-http
   - nagios-plugins-ssh
   - nagios-plugins-ping

- name: Install ntp
  yum: name=ntp state=present
  tags: ntp

- name: Configure ntp file
  template: src=ntp.conf.j2 dest=/etc/ntp.conf
  tags: ntp
  notify: restart ntp

- name: Start the ntp service
  service: name=ntpd state=started enabled=yes
  tags: ntp

# work around RHEL 7, for now
- name: insert iptables template
  template: src=iptables.j2 dest=/etc/sysconfig/iptables
  when: ansible_distribution_major_version != '7'
  notify: restart iptables

- name: test to see if selinux is running
  command: getenforce
  register: sestatus
  changed_when: false

Add check_http, ping, and ssh nagios plugins
Add check_http, ping, and ssh nagios plugins
