Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

check for host resolution with Ruby Stdlb's Resolv

This is more portable across platforms as some minimal installs (CentOS)
do not include the `host` command.
  • Loading branch information...
commit 8f8d3558abe7b5e70cc45c940d7ef05dac96f233 1 parent 4696436
@schisamo schisamo authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  recipes/default.rb
View
3  recipes/default.rb
@@ -13,6 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+require 'resolv'
require 'chef/util/file_edit'
# Acquire the chef-server Omnibus package
@@ -88,5 +89,5 @@
"127.0.0.1 #{node['chef-server']['api_fqdn']}")
fe.write_file
end
- not_if "host #{node['chef-server']['api_fqdn']}" # host resolves
+ not_if { Resolv.getaddress(node['chef-server']['api_fqdn']) rescue false } # host resolves
end
Please sign in to comment.
Something went wrong with that request. Please try again.