#
# Cookbook:: irrigate-orchard_base
# Recipe:: journald
#
# Copyright: The Orchard
#

if platform_family?('rhel', 'debian', 'amazon')

  if node['platform_version'].start_with?('2', '7')

    packages = %w(
      systemd
    )

    # Install packages
    packages.each do |name|
      package name
    end

    template '/etc/systemd/journald.conf' do
      source 'journald.conf.erb'
      mode '0644'
      notifies :restart, 'service[systemd-journald]', :immediately
    end

    service 'systemd-journald' do
      supports restart: true, status: true, reload: false
      action [:enable, :start]
    end
  end

end
