Generate a GUID in Chef with Ruby

When you need a unique string to name a resource in your Chef scrip, generate a GUID with

SecureRandom.uuid

To make sure the resource always gets a unique name:

log "#{SecureRandom.uuid}" do
  message 'My message'
  level :info
 end

Leave a Reply