Sha256: 8f2b7e388f328a58b09b5ebdc1a76cfbbef20a4f1596a50c2e672b544f7dc1cb

Contents?: true

Size: 1.39 KB

Versions: 44

Compression:

Stored size: 1.39 KB

Contents

#
# Cookbook Name:: mu-glusterfs
# Recipe:: client
#
# Copyright 2014, eGlobalTech
#
# All rights reserved - Do Not Redistribute
#


case node['platform']
  when "centos"
    include_recipe "mu-glusterfs"

    %w{glusterfs glusterfs-fuse}.each do |pkg|
      package pkg
    end

    include_recipe 'mu-firewall'

    node['glusterfs']['fw'].each { |rule|
      firewall_rule "Allow glusterfs #{rule['usage']}" do
        port rule['port_range']
      end
    }

    directory node['glusterfs']['client']['mount_path'] do
      recursive true
      mode "0755"
    end

    if node['glusterfs']['discovery'] == 'groupname'
      gluster_servers = search(
          :node,
          "glusterfs_is_server:true AND glusterfs_groupname:#{node['glusterfs_groupname']}"
      )
    end rescue NoMethodError
    if gluster_servers.nil?
      gluster_servers = search(
          :node,
          "glusterfs_is_server:true AND chef_environment:#{node.chef_environment}"
      )
    end

    template "/etc/init.d/mu-gluster-client" do
      source "mu-gluster-client.erb"
      variables(
          :servers => gluster_servers,
          :path => node['glusterfs']['client']['mount_path'],
          :volume => node['glusterfs']['server']['volume']
      )
      mode 0755
    end

    service "mu-gluster-client" do
      action [:enable, :start]
    end

  else
    Chef::Log.info("Unsupported platform #{node['platform']}")
end

Version data entries

44 entries across 44 versions & 1 rubygems

Version Path
cloud-mu-3.6.10 cookbooks/mu-glusterfs/recipes/client.rb
cloud-mu-3.6.9 cookbooks/mu-glusterfs/recipes/client.rb
cloud-mu-3.6.8 cookbooks/mu-glusterfs/recipes/client.rb
cloud-mu-3.6.7 cookbooks/mu-glusterfs/recipes/client.rb
cloud-mu-3.6.5 cookbooks/mu-glusterfs/recipes/client.rb
cloud-mu-3.6.4 cookbooks/mu-glusterfs/recipes/client.rb
cloud-mu-3.6.3 cookbooks/mu-glusterfs/recipes/client.rb
cloud-mu-3.5.1 cookbooks/mu-glusterfs/recipes/client.rb
cloud-mu-3.5.0 cookbooks/mu-glusterfs/recipes/client.rb
cloud-mu-3.4.0 cookbooks/mu-glusterfs/recipes/client.rb
cloud-mu-3.3.2 cookbooks/mu-glusterfs/recipes/client.rb
cloud-mu-3.3.1 cookbooks/mu-glusterfs/recipes/client.rb
cloud-mu-3.3.0 cookbooks/mu-glusterfs/recipes/client.rb
cloud-mu-3.2.0 cookbooks/mu-glusterfs/recipes/client.rb
cloud-mu-3.1.6 cookbooks/mu-glusterfs/recipes/client.rb
cloud-mu-3.1.5 cookbooks/mu-glusterfs/recipes/client.rb
cloud-mu-3.1.4 cookbooks/mu-glusterfs/recipes/client.rb
cloud-mu-3.1.3 cookbooks/mu-glusterfs/recipes/client.rb
cloud-mu-3.1.2 cookbooks/mu-glusterfs/recipes/client.rb
cloud-mu-3.1.2beta2 cookbooks/mu-glusterfs/recipes/client.rb