# Define variables needed
packages = node['alfresco']['packages']

# Install RPMs, if needed
packages.each do |package|
  package package do
    action :install
  end
end

include_recipe 'alfresco::default'

template '/usr/local/bin/alfresco-create-user.sh' do
  source 'scripts/alfresco-create-user.sh'
  mode 0755
end
template '/usr/local/bin/jod-restart.sh' do
  source 'scripts/jod-restart.sh'
  mode 0755
end

# Add marketo extension
cookbook_file '/usr/share/tomcat/shared/lib/marketoext.jar' do
  source 'alfresco-lib/marketoext.jar'
end

template '/usr/local/bin/monitor-services.sh' do
  source 'scripts/monitoring-services.sh.erb'
  owner 'root'
  group 'root'
  mode 00744
end
