#
# Cookbook:: irrigate-chef-ci
# Recipe:: default
#
# Copyright (C) 2017 The Orchard
#

# Saving node merged attributes to the file for integration tests
ruby_block "Save node attributes" do
  block do
    if Dir::exist?('/tmp/kitchen')
      IO.write("/tmp/kitchen/node_attributes.json", node.to_json)
    end
  end
end

# Adding kitchen to sudoers with NOPASSWORD
file "/etc/sudoers.d/kitchen" do
  content 'kitchen  ALL=(ALL) NOPASSWD: ALL'
  owner 'root'
  group 'root'
  mode '0440'
end
