jetty_base="/var/lib/jetty"

if !ENV['FE_URL'].nil?
    fe_url="#{ENV['FE_URL']}"
elsif  node['disableHttp']
    fe_url="https://#{node['Nodes']['FE']}:#{node['FE'][:https_port]}"
else
    fe_url="http://#{node['Nodes']['FE']}:#{node['FE'][:http_port]}"
end


template "webseal.conf" do
   path "#{jetty_base}/config/sdc-simulator/webseal.conf"
   source "SDC-Simulator-webseal.conf.erb"
   owner "jetty"
   group "jetty"
   mode "0755"
   variables({
      :fe_url  =>"#{fe_url}"
   })
end
