-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* WIP * Do it CircleCI! * WIP [skip ci] * Moved circleci config to root. Not currently doing any other script includes etc. [skip ci] * awslogsd their python setup sucks! [skip ci] * awslogsd their python setup sucks! [skip ci] * 2.2.0 - Read Changelog * 2.2.0 - Read Changelog * 2.2.0 - Read Changelog
- Loading branch information
1 parent
d8ba2ec
commit 681bb0e
Showing
22 changed files
with
625 additions
and
275 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
default['bonusbits_base']['backups'].tap do |backups| | ||
backups['configure'] = false | ||
|
||
# Paths | ||
backups['local_tmp_path'] = '/tmp/backups' | ||
# Array of Paths to backup | ||
backups['backup_paths'] = %w(/etc /opt) | ||
backups['script_filename'] = 'backup_to_s3.rb' | ||
backups['script_fullname'] = "/usr/bin/#{node['bonusbits_base']['backups']['script_filename']}" | ||
script_fullname = node['bonusbits_base']['backups']['script_fullname'] | ||
backups['cron_command'] = | ||
if ::File.exist?('/opt/chef/embedded/bin/ruby') | ||
"/opt/chef/embedded/bin/ruby #{script_fullname}" | ||
elsif ::File.exist?('/opt/chefdk/embedded/bin/ruby') | ||
"/opt/chefdk/embedded/bin/ruby #{script_fullname}" | ||
elsif ::File.exist?('/usr/bin/ruby') | ||
"/usr/bin/ruby #{script_fullname}" | ||
else | ||
raise 'ERROR: Ruby Path Not Found!' | ||
end | ||
|
||
# Filename | ||
backups['filename'] = | ||
if node['bonusbits_base']['aws']['inside'] | ||
"#{node['ec2']['instance_id']}-backup.tar.gz" | ||
else | ||
'backups.tar.gz' | ||
end | ||
|
||
# S3 | ||
## Recommended to turn on Versioning and add Lifecycle to bucket | ||
backups['s3_bucket_name'] = 'backup_bucket' # !! Required Override !! | ||
filename = node['bonusbits_base']['backups']['filename'] | ||
env = run_state['detected_environment'] | ||
s3_backup_bucket = node['bonusbits_base']['backups']['s3_bucket_name'] | ||
backups['s3_full_path'] = "#{s3_backup_bucket}/backups/#{env}/#{filename}" | ||
|
||
# Cron | ||
## Default is Daily at 11PM Server Time | ||
backups['minutes'] = '0' | ||
backups['hours'] = '23' | ||
backups['days'] = '*' | ||
backups['month'] = '*' | ||
backups['weekday'] = '*' | ||
|
||
# Backup Logs | ||
backups['configure_log_rotate'] = true | ||
backups['log_path'] = '/var/log/backups.log' | ||
end | ||
|
||
# Debug | ||
message_list = [ | ||
'', | ||
'** Backups **', | ||
"Configure (#{node['bonusbits_base']['backups']['configure']})", | ||
"Backup Filename (#{node['bonusbits_base']['backups']['filename']})", | ||
"Script Filename (#{node['bonusbits_base']['backups']['script_filename']})", | ||
"Script Fullname (#{node['bonusbits_base']['backups']['script_fullname']})", | ||
"Local Temp Path (#{node['bonusbits_base']['backups']['local_tmp_path']})", | ||
"S3 Full Path (#{node['bonusbits_base']['backups']['s3_full_path']})", | ||
"Config Log Rotate (#{node['bonusbits_base']['backups']['configure_log_rotate']})", | ||
"Log Path (#{node['bonusbits_base']['backups']['log_path']})" | ||
] | ||
message_list.each do |message| | ||
Chef::Log.warn(message) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
default['bonusbits_base']['cloudwatch'].tap do |cloudwatch| | ||
cloudwatch['configure'] = true | ||
|
||
# Monitoring Scripts (AWS Examples Default) | ||
cloudwatch['zip_filename'] = 'CloudWatchMonitoringScripts-1.2.1.zip' | ||
zip_filename = node['bonusbits_base']['cloudwatch']['zip_filename'] | ||
cloudwatch['scripts_url'] = | ||
"http://aws-cloudwatch.s3.amazonaws.com/downloads/#{zip_filename}" | ||
cloudwatch['zip_fullname'] = "#{node['bonusbits_base']['local_file_cache']}/#{zip_filename}" | ||
|
||
# Cron | ||
cloudwatch['cron_command'] = '/opt/aws-scripts-mon/mon-put-instance-data.pl' | ||
cloudwatch['cron_command'] += ' --mem-util --mem-used' | ||
cloudwatch['cron_command'] += ' --mem-avail --disk-space-util' | ||
cloudwatch['cron_command'] += ' --disk-path=/ --from-cron' | ||
end | ||
|
||
# Debug | ||
message_list = [ | ||
'', | ||
'** CloudWatch Monitoring **', | ||
"Configure (#{node['bonusbits_base']['cloudwatch']['configure']})", | ||
"Zip Filename (#{node['bonusbits_base']['cloudwatch']['zip_filename']})", | ||
"Zip Fullname (#{node['bonusbits_base']['cloudwatch']['zip_fullname']})", | ||
"Scripts URL (#{node['bonusbits_base']['cloudwatch']['scripts_url']})", | ||
"Cron Command (#{node['bonusbits_base']['cloudwatch']['cron_command']})" | ||
] | ||
message_list.each do |message| | ||
Chef::Log.warn(message) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.