default.rb 2.28 KB
#
# 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.
#

default['backup-file2s3']['bucket'] = 'bucketname'
default['backup-file2s3']['region'] = 'us-east-1'

# 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
#    :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
)