#
# Cookbook:: kosmos_rsk
# Recipe:: rskj
#

group 'rsk' do
  gid 888
end

user 'rsk' do
  uid 888
  gid 888
  home '/var/lib/rsk'
  shell '/sbin/nologin'
end

apt_repository 'rskj' do
  uri 'ppa:rsksmart/rskj'
  key '5EED9995C84A49BC02D4F507DF10691F518C7BEA'
end

apt_package 'rskj' do
  response_file 'rskj-preseed.cfg.erb'
  response_file_variables network: node['rskj']['network']
  options '--assume-yes'
  version node['rskj']['version']
end

service "rsk" do
  action [:enable, :start]
end

include_recipe 'kosmos_rsk::firewall'
