Guest User

Untitled

a guest
Dec 17th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. whyrun_safe_ruby_block 'validate foo config' do
  2. block do
  3. node['apache']['virtual_hosts'].to_hash.each do |name, config|
  4. # Everyone has to have a ServerName
  5. fail "#{name} missing ServerName" unless config['ServerName']
  6. # You also have to have a ServerAdmin, but we can
  7. # build it for you.
  8. node.default['apache']['virtual_hosts'][name]['ServerAdmin'] =
  9. "webmaster@#{config['ServerName']}" unless config['ServerAdmin']
  10. end
  11. end
  12. end
  13.  
  14. template '/etc/apache/virtualhosts.conf' do
  15. owner 'root'
  16. group 'root'
  17. mode '0644'
  18. end
Add Comment
Please, Sign In to add comment