1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-08-24 17:49:28 +03:00

M #-: DDC put host config into ONE host template (#4682)

This commit is contained in:
Alejandro Huertas Herrero
2020-05-18 13:47:48 +02:00
committed by GitHub
parent dfee994096
commit 441861c4cc

View File

@ -345,6 +345,8 @@ module OneProvision
ssh_key = try_read_file(host['connection']['public_key'])
config = Base64.strict_encode64(host['configuration'].to_yaml)
reject = %w[im_mad vm_mad provision connection configuration]
Nokogiri::XML::Builder.new do |xml|
xml.HOST do
xml.NAME "provision-#{SecureRandom.hex(24)}"
@ -379,6 +381,10 @@ module OneProvision
end
end
end
host.each do |key, value|
xml.send(key.upcase, value) unless reject.include?(key)
end
end
end
end.doc.root