2020-11-01 07:25:28 +00:00
|
|
|
package 'lsyncd'
|
|
|
|
|
|
|
|
# Create /etc/sudoers.d/
|
|
|
|
%w( /etc/lsyncd /var/log/lsyncd ).each do |d|
|
|
|
|
directory d do
|
|
|
|
owner 'root'
|
|
|
|
group 'root'
|
|
|
|
mode '755'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
directory '/root/.ssh/' do
|
|
|
|
owner 'root'
|
|
|
|
group 'root'
|
|
|
|
mode '0700'
|
|
|
|
end
|
|
|
|
|
|
|
|
%w(id_rsa known_hosts).each do |f|
|
2020-11-01 16:04:19 +00:00
|
|
|
encrypted_remote_file "/root/.ssh/#{f}" do
|
2020-11-01 07:25:28 +00:00
|
|
|
owner 'root'
|
|
|
|
group 'root'
|
|
|
|
mode '600'
|
2020-11-01 16:04:19 +00:00
|
|
|
|
|
|
|
source "files/root/.ssh/#{f}"
|
|
|
|
|
|
|
|
password ENV['ITAMAE_PASSWORD']
|
2020-11-12 06:53:49 +00:00
|
|
|
|
|
|
|
# Do not overwrite:
|
|
|
|
not_if "test -e /root/.ssh/#{f}"
|
2020-11-01 07:25:28 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
remote_file '/etc/logrotate.d/lsyncd' do
|
|
|
|
owner 'root'
|
|
|
|
group 'root'
|
|
|
|
mode '644'
|
|
|
|
end
|