Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
ansible-playbooks
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
github-mirror
ansible-playbooks
Commits
fd72c7d8
Commit
fd72c7d8
authored
Mar 14, 2018
by
Assaf Flatto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix nrpe configuration - allowed hosts IP detection
parent
f9d8d51e
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
29 additions
and
12 deletions
+29
-12
icinga2-ansible-add-hosts/defaults/main.yml
icinga2-ansible-add-hosts/defaults/main.yml
+1
-1
icinga2-ansible-add-hosts/tasks/main.yml
icinga2-ansible-add-hosts/tasks/main.yml
+9
-0
icinga2-nrpe-agent/defaults/main.yml
icinga2-nrpe-agent/defaults/main.yml
+2
-0
icinga2-nrpe-agent/tasks/icinga2_nrpe_agent_Debian.yml
icinga2-nrpe-agent/tasks/icinga2_nrpe_agent_Debian.yml
+12
-10
icinga2-nrpe-agent/tasks/main.yml
icinga2-nrpe-agent/tasks/main.yml
+4
-0
icinga2-nrpe-agent/templates/nrpe.cfg.j2
icinga2-nrpe-agent/templates/nrpe.cfg.j2
+1
-1
No files found.
icinga2-ansible-add-hosts/defaults/main.yml
View file @
fd72c7d8
---
# defaults file for icinga2-ansible-add-hosts
icinga2_hosts_dir
:
"
/etc/icinga2/conf.d/"
icinga2_hosts_dir
:
"
/etc/icinga2/conf.d/
hosts
"
host_address
:
"
{{
hostvars[item]['ansible_default_ipv4']['address']
}}"
host_attributes
:
"
none"
host_checks
:
"
none"
icinga2-ansible-add-hosts/tasks/main.yml
View file @
fd72c7d8
---
# tasks file for icinga2-ansible-add-hosts
-
name
:
create Autogenerated host directory
file
:
path
:
"
{{
icinga2_hosts_dir
}}"
owner
:
icinga
group
:
icinga
mode
:
0755
state
:
directory
recurse
:
yes
-
import_tasks
:
icinga2_add_hosts.yml
icinga2-nrpe-agent/defaults/main.yml
View file @
fd72c7d8
...
...
@@ -24,6 +24,8 @@ nrpe_agent_plugins_x86_64: "/usr/lib64/nagios/plugins"
nrpe_agent_check_mem
:
"
https://raw.githubusercontent.com/zwindler/check_mem_ng/master/check_mem_ng.sh"
ssh_port
:
22
# Sample NRPE check commands
nrpe_check_commands
:
check_load
:
...
...
icinga2-nrpe-agent/tasks/icinga2_nrpe_agent_Debian.yml
View file @
fd72c7d8
---
-
name
:
Install Nrpe and Plugins
apt
:
pkg={{ item }}
state=latest
update_cache=yes
install_recommends=no
package
:
name
:
"
{{
item
}}"
state
:
latest
update_cache
:
yes
install_recommends
:
no
with_items
:
"
{{
nrpe_agent_Debian
}}"
tags
:
-
nrpe_agent_install
-
name
:
Copy Nrpe Configuration
template
:
src=nrpe.cfg.j2
dest={{ nrpe_agent_config }}
owner=root
group=root
mode=0644
backup=yes
template
:
src
:
nrpe.cfg.j2
dest
:
"
{{
nrpe_agent_config
}}"
owner
:
root
group
:
root
mode
:
0644
backup
:
yes
notify
:
-
restart nagios-nrpe-server
tags
:
...
...
icinga2-nrpe-agent/tasks/main.yml
View file @
fd72c7d8
---
# tasks file for icinga2-nrpe-agent
-
set_fact
:
allowed_hosts
:
"
{{
hostvars[item]['ansible_default_ipv4']['address']
}}"
with_inventory_hostnames
:
monitoring_servers
-
include_tasks
:
icinga2_nrpe_agent_RedHat.yml
when
:
ansible_os_family == 'RedHat' and 'monitoring_servers' not in group_names
# NRPE Agent will be installed on clients only
...
...
icinga2-nrpe-agent/templates/nrpe.cfg.j2
View file @
fd72c7d8
# {{ ansible_managed }}
allowed_hosts={{
nrpe_allowed_hosts
}}
allowed_hosts={{
allowed_hosts | default('nrpe_allowed_hosts')
}}
{{ nrpe_configuration }}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment