lib/bolt/module_installer/puppetfile.rb
# Writes a Puppetfile that includes specifications for each of the
# modules.
#
Writes a Puppetfile that includes specifications for each of the
modules.
Writes a Puppetfile that includes specifications for each of the modules .
def write(path, moduledir = nil)
        File.open(path, 'w') do |file|
          if moduledir
            file.puts "# This Puppetfile is managed by Bolt. Do not edit."
            file.puts "# For more information, see https://pup.pt/bolt-modules"
            file.puts
            file.puts "# The following directive installs modules to the managed moduledir."
            file.puts "moduledir '#{moduledir.basename}'"
            file.puts
          end
          @modules.each { |mod| file.puts mod.to_spec }
        end
      rescue SystemCallError => e
        raise Bolt::FileError.new(
          "#{e.message}: unable to write Puppetfile.",
          path
        )
      end
def write ( path , moduledir = nil ) File . open ( path , 'w' ) do | file | if moduledir file . puts "# This Puppetfile is managed by Bolt. Do not edit." file . puts "# For more information, see https://pup.pt/bolt-modules" file . puts file . puts "# The following directive installs modules to the managed moduledir." file . puts "moduledir '#{moduledir.basename}'" file . puts end @modules . each { | mod | file . puts mod . to_spec } end rescue SystemCallError => e raise Bolt :: FileError . new ( "#{e.message}: unable to write Puppetfile." , path ) end
Writes a Puppetfile that includes specifications for each of the
modules.
Writes a Puppetfile that includes specifications for each of the modules .
path
<not_specific>
moduledir
<not_specific>