Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- whyrun_safe_ruby_block 'validate foo config' do
- block do
- node['apache']['virtual_hosts'].to_hash.each do |name, config|
- # Everyone has to have a ServerName
- fail "#{name} missing ServerName" unless config['ServerName']
- # You also have to have a ServerAdmin, but we can
- # build it for you.
- node.default['apache']['virtual_hosts'][name]['ServerAdmin'] =
- "webmaster@#{config['ServerName']}" unless config['ServerAdmin']
- end
- end
- end
- template '/etc/apache/virtualhosts.conf' do
- owner 'root'
- group 'root'
- mode '0644'
- end
Add Comment
Please, Sign In to add comment