Monday 15 June 2015

Chef and ruby: how to convert a array into a set -


I have an array that looks like this:

  nodes = ['server 1 '' server1 ',' server2 ']   

In a chef recipe, I have to convert the set before going to a template ARB. How do i do this

This works with pattern set, matrix, JSON etc; This is the first try.

  'Set' nodes are required [['server1', 'server1', 'server2'] p nodes.to_set # # & lt; Set: {"server1", "server2"} & gt;    

No comments:

Post a Comment