default.rb
2.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#
# Author:: Earth U (<sysadmin@chromedia.com>)
# Cookbook Name:: backup-file2s3
# Attributes:: default
#
# Copyright 2016, Chromedia Far East, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Defaults if bucket and region are not included in the specifications
# for 'backups' or when using the 'aws_tar_extract' definition.
default['backup-file2s3']['bucket'] = nil
default['backup-file2s3']['region'] = nil
# Contains hashes with details of file/directories to be backed up to S3.
default['backup-file2s3']['backups'] = [
# {
# :script_name => 'default', # default: 'default', but only
# # one default can exist at a time
# :enable => true # default: true
# :bucket => nil, # default: node attribute
# :region => nil, # default: node attribute
# :paths => [
# {
# :path => '/my/dir',
# :bak_filename => 'dir', # default: basename of path
# :bak_encrypted => false, # default: false
# :bak_maxcopies => 30 # default: 30
# }
# ]
# }
]
# Encryption keys (string contents of the actual keys, if used)
default['backup-file2s3']['encrypt']['pub_key'] = nil
default['backup-file2s3']['encrypt']['priv_key'] = nil
default['backup-file2s3']['script_dir'] = '/etc/backup_file_to_s3'
default['backup-file2s3']['log_dir'] = '/var/log/backup_file_to_s3'
default['backup-file2s3']['tmp_dir'] = '/tmp/backup_files'
# Basic options for cron
default['backup-file2s3']['cron']['sched'] = '0 0 * * *'
default['backup-file2s3']['cron']['mailto'] = "''"
# Basic options for logrotate
default['backup-file2s3']['logrotate']['conf_dir'] = '/etc/logrotate.d'
default['backup-file2s3']['logrotate']['options'] = %w{
weekly
rotate\ 12
missingok
compress
notifempty
}
# Constants
default['backup-file2s3']['tar_bin'] = '/bin/tar'
default['backup-file2s3']['aws_bin'] = value_for_platform(
'ubuntu' => { 'default' => '/usr/local/bin/aws' },
'default' => '/usr/local/bin/aws' # haven't tested on other platforms yet
)