cnnodes.each do |n|
mess = <<EOH
#{n}:
:roles:
- console
EOH
node.set["node_properties"] = messHello Everybody!
I’m writing a recipe (for Windows nodes) that I want to help populate a properties.yml file so I can use it with some serverspec tests that I want to run once the Chef run has completed.
I can get hold of the attributes required and dump them into a file, but it’s saving this file on the nodes in question, whereas I need it on the Chef Server itself.
Is this even possible to do? Minitest handler is out of the question as there is no support for Windows, any suggestions?
Currently I am using:
“ruby_block "nodes for serverspec" do
block do
if ::File.exist?('properties.yml') then
::File.delete('properties.yml')
end
cnnodes.each do |n|
mess = <<EOH
#{n}:
:roles:
- console
EOH
::File.open('properties.yml', "a") { |f| f.write(mess)}
end
end
end”
Where cnnodes is an array of the node names for a particular server role.
Thanks
Chris
Archive powered by MHonArc 2.6.16.