#
# Cookbook:: irrigate-apache
# Recipe:: default
#
# Author:: Russell de Moose (<rdemoose@theorchard.com>)
# Copyright:: The Orchard
#

if platform_family?('rhel')
  # Change SELinux to permissive until we decide on particular ports
  template '/etc/selinux/config' do
    source 'selinux.erb'
    mode '644'
  end
end

# Make sure the firewall is installed and enabled
firewall 'default' do
  log_level :high
  action :install
end

firewall_rule 'http' do
  port 80
  protocol :tcp
  position 1
  command :allow
end

firewall_rule 'https' do
  port 443
  protocol :tcp
  position 2
  command :allow
end

firewall_rule 'ssh' do
  port 22
  protocol :tcp
  position 3
  command :allow
end

# Wrap the apache cookbook, and include attributes in roles.
include_recipe 'apache2'
