Commit eeeef16e authored by Tim Smith's avatar Tim Smith
Browse files

Merge pull request #60 from tas50/master

Fix service names on Debian and misc fixes
parents 917cf627 102991b6
......@@ -2,7 +2,7 @@
# Cookbook Name:: ossec
# Attributes:: default
#
# Copyright 2010-2015, Chef Software, Inc.
# Copyright 2010-2016, Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
......
......@@ -2,7 +2,7 @@
# Cookbook Name:: ossec
# Recipe:: agent
#
# Copyright 2010-2015, Chef Software, Inc.
# Copyright 2010-2016, Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
......
......@@ -2,7 +2,7 @@
# Cookbook Name:: ossec
# Recipe:: client
#
# Copyright 2010-2015, Chef Software, Inc.
# Copyright 2010-2016, Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
......@@ -45,21 +45,21 @@ ossec_key = if node['ossec']['data_bag']['encrypted']
directory "#{node['ossec']['dir']}/.ssh" do
owner 'ossec'
group 'ossec'
mode 0750
mode '0750'
end
template "#{node['ossec']['dir']}/.ssh/authorized_keys" do
source 'ssh_key.erb'
owner 'ossec'
group 'ossec'
mode 0600
mode '0600'
variables(key: ossec_key['pubkey'])
end
file "#{node['ossec']['dir']}/etc/client.keys" do
owner 'ossec'
group 'ossec'
mode 0660
mode '0660'
end
include_recipe 'ossec::common'
......@@ -88,7 +88,7 @@ end
# abort immediately. Explicitly stopping the service here after
# installation allows Chef to start it when client.keys has content.
service 'stop ossec' do
service_name 'ossec-hids' unless platform_family?('debian')
service_name platform_family?('debian') ? 'ossec' : 'ossec-hids'
action :nothing
%w( disable stop ).each do |action|
......@@ -97,7 +97,7 @@ service 'stop ossec' do
end
service 'ossec' do
service_name 'ossec-hids' unless platform_family?('debian')
service_name platform_family?('debian') ? 'ossec' : 'ossec-hids'
supports status: true, restart: true
action [:enable, :start]
......
......@@ -2,7 +2,7 @@
# Cookbook Name:: ossec
# Recipe:: default
#
# Copyright 2010-2015, Chef Software, Inc.
# Copyright 2010-2016, Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
......
......@@ -2,7 +2,7 @@
# Cookbook Name:: ossec
# Recipe:: server
#
# Copyright 2010-2015, Chef Software, Inc.
# Copyright 2010-2016, Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
......@@ -53,14 +53,14 @@ ossec_key = if node['ossec']['data_bag']['encrypted']
directory "#{node['ossec']['dir']}/.ssh" do
owner 'root'
group 'ossec'
mode 0750
mode '0750'
end
template "#{node['ossec']['dir']}/.ssh/id_rsa" do
source 'ssh_key.erb'
owner 'root'
group 'ossec'
mode 0600
mode '0600'
variables(key: ossec_key['privkey'])
end
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment