Skip to content

Commit

Permalink
Merge pull request jloh#8 from Mooash/per-server-plugins
Browse files Browse the repository at this point in the history
Closes jloh#4 - Adding the ability to deploy per-server plugins
  • Loading branch information
James committed Apr 15, 2015
2 parents 2a84d61 + 051030c commit b2f2d89
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 4 deletions.
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,24 @@
Nagios NRPE Server Config
=========

A Ansible role to handle the installation and rollout of the Nagios NRPE Daemon.
[![Build Status](https://travis-ci.org/Mooash/nagios-nrpe-server.svg?branch=master)](https://travis-ci.org/Mooash/nagios-nrpe-server)

I've only selected certain platforms that I know this 100% works on, but it will work on any platform that NRPE can be installed on.
An Ansible role to handle the installation and rollout of the Nagios NRPE Daemon.

I've only selected certain platforms that I know this 100% works on, but it should work on any platform that NRPE can be installed on.

Requirements
------------

RedHat based OS's must have the EPEL repo.

Role Information
--------------

This role gives you the ability to deploy plugins on a global and per-server basis. This can be done by putting plugins into [`files/plugins/global`](files/plugins/global) or by creating a folder in `files/plugins/` that is the servers [FQDN](http://en.wikipedia.org/wiki/Fully_qualified_domain_name).

You can find out your servers FQDN by running the [Ansible Setup](http://docs.ansible.com/setup_module.html) module.

Role Variables
--------------

Expand Down
3 changes: 3 additions & 0 deletions files/plugins/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Place plugin files here so that they're deployed by Ansible.

Files in the `files/plugins/global/` folder will be deployed to all systems, files in `files/plugins/{{ ansible_fqdn }}/` will only be deployed to the server that has that FQDN.
1 change: 1 addition & 0 deletions files/plugins/global/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This is just a placeholder so that git doesn't ignore this folder
14 changes: 12 additions & 2 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,24 @@
notify: restart nagios-nrpe-server

# Sync our plugins
- name: Install plugins
- name: Install global plugins
sudo: true
copy: >
src="{{ item }}"
dest="{{ nagios_nrpe_server_plugins_dir }}/"
owner=root group=root mode=0755
with_fileglob:
- plugins/*
- plugins/global/*

# Install per-server plugins
- name: Install per-server plugins
sudo: true
copy: >
src="{{ item }}"
dest="{{ nagios_nrpe_server_plugins_dir }}/"
owner=root group=root mode=0755
with_fileglob:
- "plugins/{{ ansible_fqdn }}/*"

# Ensure NRPE server is running and will start at boot
- name: Ensure NRPE server is running
Expand Down

0 comments on commit b2f2d89

Please sign in to comment.