Sha256: 72ad599aae585b002ef7448e6b77326e0d73107d18658da18b5a36729add5fd3

Contents?: true

Size: 809 Bytes

Versions: 6

Compression:

Stored size: 809 Bytes

Contents

require 'chef/provider/lwrp_base'

class Chef::Provider::VagrantCluster < Chef::Provider::LWRPBase

  use_inline_resources

  def whyrun_supported?
    true
  end

  action :create do
    the_base_path = new_resource.path
    ChefMetal.inline_resource(self) do
      directory the_base_path
      file ::File.join(the_base_path, 'Vagrantfile') do
        content <<EOM
Dir.glob('#{::File.join(the_base_path, '*.vm')}') do |vm_file|
  eval(IO.read(vm_file), nil, vm_file)
end
EOM
      end
    end
  end

  action :delete do
    the_base_path = new_resource.path
    ChefMetal.inline_resource(self) do
      file ::File.join(the_base_path, 'Vagrantfile') do
        action :delete
      end
      directory the_base_path do
        action :delete
      end
    end
  end

  def load_current_resource
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
chef-metal-0.4 lib/chef/provider/vagrant_cluster.rb
chef-metal-0.3.1 lib/chef/provider/vagrant_cluster.rb
chef-metal-0.3 lib/chef/provider/vagrant_cluster.rb
chef-metal-0.2.1 lib/chef/provider/vagrant_cluster.rb
chef-metal-0.2 lib/chef/provider/vagrant_cluster.rb
chef-metal-0.1 lib/chef/provider/vagrant_cluster.rb