Sha256: 387132018e73f288c690463986d40ffaf9c70bd4d497a09fb96c956d18355792
Contents?: true
Size: 1.05 KB
Versions: 9
Compression:
Stored size: 1.05 KB
Contents
#!/usr/bin/env ruby require 'fileutils' # Create directory structure %w(bin config modules).each do |dir| FileUtils.mkdir_p dir end # Copy config files src = File.expand_path(File.join(File.dirname(__FILE__), '..')) %w(config_header.txt kafo.yaml.example).each do |file| FileUtils.cp src + "/config/#{file}", 'config/' end script_name = "kafo-configure" # Optional configure script if ARGV.size > 0 name = ARGV[0] script_name = "bin/#{name}" puts "... creating #{script_name}" content = <<EOS #!/usr/bin/env ruby require 'rubygems' require 'kafo' CONFIG_FILE = "/etc/#{name}/#{name}.yaml" result = Kafo::KafoConfigure.run exit result.nil? ? 0 : result.exit_code EOS File.open(script_name, 'w') { |file| file.write(content) } FileUtils.chmod 0755, script_name end puts "Your directory was kafofied" puts "Now you should:" puts " 1. upload your puppet modules to modules directory (you can use librarian-puppet project)" puts " 2. create default config/answers.yaml or modify config/kafo.yaml to laod another answer file" puts " 3. run #{script_name}"
Version data entries
9 entries across 9 versions & 1 rubygems