Created
January 30, 2013 01:43
-
-
Save maplebed/4669873 to your computer and use it in GitHub Desktop.
possible patch for COOK-2257?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/templates/default/hosts.cfg.erb b/templates/default/hosts.cfg.erb | |
index 3868fba..5f0f20c 100644 | |
--- a/templates/default/hosts.cfg.erb | |
+++ b/templates/default/hosts.cfg.erb | |
@@ -24,7 +24,12 @@ define host { | |
ip = n['cloud']['public_ipv4'] | |
else | |
ip = n['ipaddress'] | |
- end %> | |
+ end | |
+ if ip =~ /^ *$/ | |
+ # ERROR! ip address shouldn't be empty. but to avoid a nagios syntax error, replace with 127.0.0.1 | |
+ # can we spew this into the chef log as a non-fatal WARNING from within the template? | |
+ ip = "127.0.0.1" | |
+ end%> | |
address <%= ip %> | |
host_name <%= n[node['nagios']['host_name_attribute']] %> | |
<% if node['nagios']['multi_environment_monitoring'] -%> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment