Sha256: 14b34ae05b56b39bdc72954e413db7e32fff7b15e5973751c91633ed9723892a

Contents?: true

Size: 951 Bytes

Versions: 4

Compression:

Stored size: 951 Bytes

Contents

require 'chef/knife'

class Chef
  class Knife
    class Kitchen < Knife
      include FileUtils

      banner "knife kitchen NAME or initialize current directory with '.'"

      def run
        name = @name_args.first
        mkdir name if name != '.'
        %w(nodes roles data_bags site-cookbooks cookbooks).each do |dir|
          mkdir name + "/#{dir}"
          touch name + "/#{dir}/.gitkeep"
        end
        File.open(name + "/solo.rb", 'w') do |f|
          f << <<-RUBY.gsub(/^ {12}/, '')
            file_cache_path           "/tmp/chef-solo"
            data_bag_path             "/tmp/chef-solo/data_bags"
            encrypted_data_bag_secret "/tmp/chef-solo/data_bag_key"
            cookbook_path             [ "/tmp/chef-solo/site-cookbooks",
                                        "/tmp/chef-solo/cookbooks" ]
            role_path                 "/tmp/chef-solo/roles"
          RUBY
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
knife-solo-0.0.14 lib/chef/knife/kitchen.rb
knife-solo-0.0.13 lib/chef/knife/kitchen.rb
knife-solo-0.0.12 lib/chef/knife/kitchen.rb
knife-solo-0.0.11 lib/chef/knife/kitchen.rb