Sha256: 4071b775ae604fd2be12e541b650552168ad07c04c06ef78faac3e1f33b2f111

Contents?: true

Size: 914 Bytes

Versions: 1

Compression:

Stored size: 914 Bytes

Contents

module VagrantPlugins
  module Cachier
    module Cap
      module Linux
        module ChefFileCachePath
          def self.chef_provisioner?(machine)
            provisioners = machine.config.vm.provisioners
            chef_provisioners = [:chef_solo, :chef_client, :chef_zero]
            compat_provisioners = provisioners.select { |p| chef_provisioners.include? p.name || p.type }

            if compat_provisioners.size > 1
              raise "One machine is using multiple chef provisioners, which is unsupported."
            end

            using_chef = compat_provisioners.empty? ? false : true

            using_chef
          end

          def self.chef_file_cache_path(machine)
            chef_file_cache_path = nil
            chef_file_cache_path = '/var/chef/cache' if chef_provisioner?(machine)

            return chef_file_cache_path
          end
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
vagrant-cachier-1.2.1 lib/vagrant-cachier/cap/linux/chef_file_cache_path.rb