Method: Beaker::DSL::InstallUtils#configure_puppet_on
- Defined in:
- lib/beaker/dsl/install_utils.rb
#configure_puppet_on(host, opts = {}) ⇒ Object
Configure puppet.conf on the given host based upon a provided hash
771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 |
# File 'lib/beaker/dsl/install_utils.rb', line 771 def configure_puppet_on(host, opts = {}) if host['platform'] =~ /windows/ puppet_conf = host.puppet['config'] conf_data = '' opts.each do |section,| conf_data << "[#{section}]`n" .each do |option,value| conf_data << "#{option}=#{value}`n" end conf_data << "`n" end on host, powershell("\$text = \\\"#{conf_data}\\\"; Set-Content -path '#{puppet_conf}' -value \$text") else puppet_conf = host.puppet['config'] conf_data = '' opts.each do |section,| conf_data << "[#{section}]\n" .each do |option,value| conf_data << "#{option}=#{value}\n" end conf_data << "\n" end on host, "echo \"#{conf_data}\" > #{puppet_conf}" end end |