Skip to content

Instantly share code, notes, and snippets.

@ctgswallow
Created February 24, 2012 19:17
Show Gist options
  • Save ctgswallow/1903085 to your computer and use it in GitHub Desktop.
Save ctgswallow/1903085 to your computer and use it in GitHub Desktop.
pentaho::nfs_mount
#
# Cookbook Name:: pentaho
# Recipe:: default
#
provide_service("nfs-client-for-pentaho")
searchenv = node[:pentaho][:nfs_environment] ? node[:pentaho][:nfs_environment] : nil
wait_for_service("nfs-server-for-pentaho", 1, 5, true, searchenv)
nfs_server = provider_for_service("nfs-server-for-pentaho", true, searchenv)
nfs_server['nfs']['exports'].each do |k, v|
host = nfs_server[:clustered_lvm][:ctdb_virtual_ips] ? nfs_server[:clustered_lvm][:ctdb_virtual_ips].first : nfs_server[:fqdn]
if (v.allowed ~ /#{node.ipaddress}/ || v.allowed ~ /*/) then
Chef::Log.info "Will mount #{host}:#{k} at node[:pentaho][:install_dir]"
nfs_mount "#{host}:#{k}" do
mount_point node[:pentaho][:install_dir]
options "soft,fg"
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment