chef_backup 0.0.1.dev.4 → 0.2.0.pre1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/chef_backup/config.rb +22 -12
- data/lib/chef_backup/data_map.rb +18 -12
- data/lib/chef_backup/deep_merge.rb +145 -0
- data/lib/chef_backup/helpers.rb +154 -28
- data/lib/chef_backup/logger.rb +11 -6
- data/lib/chef_backup/mash.rb +226 -0
- data/lib/chef_backup/runner.rb +24 -21
- data/lib/chef_backup/strategy/backup/custom.rb +1 -2
- data/lib/chef_backup/strategy/backup/ebs.rb +3 -6
- data/lib/chef_backup/strategy/backup/lvm.rb +2 -4
- data/lib/chef_backup/strategy/backup/object.rb +2 -4
- data/lib/chef_backup/strategy/backup/tar.rb +96 -40
- data/lib/chef_backup/strategy/restore/tar.rb +81 -51
- data/lib/chef_backup/strategy.rb +10 -10
- data/lib/chef_backup/version.rb +1 -1
- data/lib/chef_backup.rb +8 -8
- metadata +21 -162
- data/.gitignore +0 -23
- data/.kitchen.yml +0 -30
- data/.rubocop.yml +0 -21
- data/.travis.yml +0 -6
- data/Gemfile +0 -4
- data/Guardfile +0 -22
- data/README.md +0 -21
- data/Rakefile +0 -44
- data/chef_backup.gemspec +0 -33
- data/spec/fixtures/chef-server-running.json +0 -589
- data/spec/spec_helper.rb +0 -103
- data/spec/unit/data_map_spec.rb +0 -59
- data/spec/unit/helpers_spec.rb +0 -88
- data/spec/unit/runner_spec.rb +0 -185
- data/spec/unit/shared_examples/helpers.rb +0 -20
- data/spec/unit/strategy/backup/lvm_spec.rb +0 -0
- data/spec/unit/strategy/backup/shared_examples/backup.rb +0 -92
- data/spec/unit/strategy/backup/tar_spec.rb +0 -294
- data/spec/unit/strategy/restore/lvm_spec.rb +0 -0
- data/spec/unit/strategy/restore/shared_examples/restore.rb +0 -84
- data/spec/unit/strategy/restore/tar_spec.rb +0 -238
- data/spec/unit/strategy_spec.rb +0 -36
@@ -1,7 +1,7 @@
|
|
1
|
-
require
|
2
|
-
require
|
3
|
-
require
|
4
|
-
require
|
1
|
+
require "fileutils" unless defined?(FileUtils)
|
2
|
+
require "pathname" unless defined?(Pathname)
|
3
|
+
require "forwardable" unless defined?(Forwardable)
|
4
|
+
require "chef_backup/deep_merge"
|
5
5
|
|
6
6
|
# rubocop:disable IndentationWidth
|
7
7
|
module ChefBackup
|
@@ -11,23 +11,26 @@ class TarRestore
|
|
11
11
|
# rubocop:enable IndentationWidth
|
12
12
|
include ChefBackup::Helpers
|
13
13
|
include ChefBackup::Exceptions
|
14
|
-
include
|
14
|
+
include ChefBackup::Mixin::DeepMerge
|
15
15
|
extend Forwardable
|
16
16
|
|
17
17
|
attr_accessor :tarball_path
|
18
|
+
attr_writer :manifest
|
18
19
|
|
19
20
|
def_delegators :@log, :log
|
20
21
|
|
21
22
|
def initialize(path)
|
22
23
|
@tarball_path = path
|
23
|
-
@log = ChefBackup::Logger.logger(
|
24
|
+
@log = ChefBackup::Logger.logger(service_config["backup"]["logfile"] || nil)
|
24
25
|
end
|
25
26
|
|
26
27
|
def restore
|
27
|
-
log
|
28
|
-
|
29
|
-
|
30
|
-
|
28
|
+
log "Restoring Chef Server from backup"
|
29
|
+
return unless check_manifest_version
|
30
|
+
|
31
|
+
cleanse_chef_server(config["agree_to_cleanse"])
|
32
|
+
if ha?
|
33
|
+
log "Performing HA restore - please ensure that keepalived is not running on the standby host"
|
31
34
|
fix_ha_plugins
|
32
35
|
check_ha_volume
|
33
36
|
touch_drbd_ready
|
@@ -35,69 +38,71 @@ class TarRestore
|
|
35
38
|
restore_configs
|
36
39
|
restore_services unless frontend?
|
37
40
|
touch_sentinel
|
41
|
+
reconfigure_marketplace if marketplace?
|
38
42
|
reconfigure_server
|
39
43
|
update_config
|
40
44
|
import_db if restore_db_dump?
|
41
45
|
start_chef_server
|
46
|
+
reconfigure_add_ons
|
47
|
+
restart_add_ons
|
42
48
|
cleanup
|
43
|
-
log
|
49
|
+
log "Restoration Completed!"
|
44
50
|
end
|
45
51
|
|
46
52
|
def manifest
|
47
53
|
@manifest ||= begin
|
48
|
-
manifest = File.expand_path(File.join(ChefBackup::Config[
|
49
|
-
|
54
|
+
manifest = File.expand_path(File.join(ChefBackup::Config["restore_dir"],
|
55
|
+
"manifest.json"))
|
50
56
|
ensure_file!(manifest, InvalidManifest, "#{manifest} not found")
|
51
57
|
JSON.parse(File.read(manifest))
|
52
58
|
end
|
53
59
|
end
|
54
60
|
|
55
61
|
def restore_db_dump?
|
56
|
-
manifest[
|
62
|
+
manifest["services"]["postgresql"]["pg_dump_success"] && !frontend?
|
57
63
|
rescue NoMethodError
|
58
64
|
false
|
59
65
|
end
|
60
66
|
|
61
67
|
def import_db
|
62
|
-
start_service(
|
63
|
-
sql_file = File.join(ChefBackup::Config[
|
64
|
-
|
68
|
+
start_service("postgresql")
|
69
|
+
sql_file = File.join(ChefBackup::Config["restore_dir"],
|
70
|
+
"chef_backup-#{manifest["backup_time"]}.sql")
|
65
71
|
ensure_file!(sql_file, InvalidDatabaseDump, "#{sql_file} not found")
|
66
72
|
|
67
|
-
cmd = [
|
68
|
-
"-u #{manifest[
|
69
|
-
|
70
|
-
"-U #{manifest[
|
71
|
-
|
72
|
-
"< #{sql_file}"
|
73
|
-
|
74
|
-
|
75
|
-
shell_out!(cmd)
|
73
|
+
cmd = [chpst,
|
74
|
+
"-u #{manifest["services"]["postgresql"]["username"]}",
|
75
|
+
pgsql,
|
76
|
+
"-U #{manifest["services"]["postgresql"]["username"]}",
|
77
|
+
"-d #{database_name}",
|
78
|
+
"< #{sql_file}"].join(" ")
|
79
|
+
log "Importing Database dump"
|
80
|
+
shell_out!(cmd, env: ["PGOPTIONS=#{pg_options}"])
|
76
81
|
end
|
77
82
|
|
78
83
|
def restore_services
|
79
|
-
manifest.key?(
|
84
|
+
manifest.key?("services") && manifest["services"].keys.each do |service|
|
80
85
|
restore_data(:services, service)
|
81
86
|
end
|
82
87
|
end
|
83
88
|
|
84
89
|
def restore_configs
|
85
|
-
manifest.key?(
|
90
|
+
manifest.key?("configs") && manifest["configs"].keys.each do |config|
|
86
91
|
restore_data(:configs, config)
|
87
92
|
end
|
88
93
|
end
|
89
94
|
|
90
95
|
def touch_sentinel
|
91
|
-
dir =
|
92
|
-
sentinel = File.join(dir,
|
96
|
+
dir = "/var/opt/opscode"
|
97
|
+
sentinel = File.join(dir, "bootstrapped")
|
93
98
|
FileUtils.mkdir_p(dir) unless File.directory?(dir)
|
94
|
-
File.open(sentinel,
|
99
|
+
File.open(sentinel, "w") { |file| file.write "bootstrapped!" }
|
95
100
|
end
|
96
101
|
|
97
102
|
def restore_data(type, name)
|
98
|
-
source = File.expand_path(File.join(config[
|
99
|
-
|
100
|
-
destination = manifest[type.to_s][name][
|
103
|
+
source = File.expand_path(File.join(config["restore_dir"],
|
104
|
+
manifest[type.to_s][name]["data_dir"]))
|
105
|
+
destination = manifest[type.to_s][name]["data_dir"]
|
101
106
|
FileUtils.mkdir_p(destination) unless File.directory?(destination)
|
102
107
|
cmd = "rsync -chaz --delete #{source}/ #{destination}"
|
103
108
|
log "Restoring the #{name} data"
|
@@ -105,51 +110,76 @@ class TarRestore
|
|
105
110
|
end
|
106
111
|
|
107
112
|
def backup_name
|
108
|
-
@backup_name ||= Pathname.new(tarball_path).basename.sub_ext(
|
113
|
+
@backup_name ||= Pathname.new(tarball_path).basename.sub_ext("").to_s
|
114
|
+
end
|
115
|
+
|
116
|
+
def check_manifest_version
|
117
|
+
unless manifest["versions"]
|
118
|
+
log "no version information in manifest"
|
119
|
+
return true
|
120
|
+
end
|
121
|
+
|
122
|
+
manifest["versions"].each_pair do |name, data|
|
123
|
+
installed = version_from_manifest_file(data["path"])
|
124
|
+
|
125
|
+
if installed == :no_version
|
126
|
+
log "Warning: #{name} @ #{data["version"]} not installed"
|
127
|
+
elsif installed["version"] != data["version"]
|
128
|
+
log "package #{name} #{installed["version"]} installed, but backup was"\
|
129
|
+
" from #{data["version"]}. Please install correct version, restore, then upgrade."
|
130
|
+
return false
|
131
|
+
end
|
132
|
+
end
|
133
|
+
true
|
109
134
|
end
|
110
135
|
|
111
136
|
def fix_ha_plugins
|
112
|
-
log
|
113
|
-
plugins_dir =
|
114
|
-
drbd_plugin = File.join(plugins_dir,
|
137
|
+
log "Fixing HA plugins directory (https://github.com/chef/chef-server/issues/115)"
|
138
|
+
plugins_dir = "/var/opt/opscode/plugins"
|
139
|
+
drbd_plugin = File.join(plugins_dir, "chef-ha-drbd.rb")
|
115
140
|
|
116
141
|
FileUtils.mkdir_p(plugins_dir) unless Dir.exist?(plugins_dir)
|
117
|
-
FileUtils.ln_sf(
|
142
|
+
FileUtils.ln_sf("/opt/opscode/chef-server-plugin.rb", drbd_plugin) unless
|
118
143
|
File.exist?(drbd_plugin)
|
119
144
|
end
|
120
145
|
|
121
146
|
def check_ha_volume
|
122
|
-
log
|
123
|
-
ha_data_dir = manifest[
|
147
|
+
log "Checking that the HA storage volume is mounted"
|
148
|
+
ha_data_dir = manifest["ha"]["path"]
|
124
149
|
|
125
150
|
unless ha_data_dir_mounted?(ha_data_dir)
|
126
|
-
|
151
|
+
raise "Please mount the data directory #{ha_data_dir} and perform any DRBD configuration before continuing"
|
127
152
|
end
|
128
153
|
end
|
129
154
|
|
130
155
|
def ha_data_dir_mounted?(ha_data_dir)
|
131
|
-
File.read(
|
156
|
+
File.read("/proc/mounts").split("\n").grep(/#{ha_data_dir}/).count > 0
|
132
157
|
end
|
133
158
|
|
134
159
|
def touch_drbd_ready
|
135
|
-
log
|
136
|
-
FileUtils.touch(
|
137
|
-
File.exist?(
|
160
|
+
log "Touching drbd_ready file"
|
161
|
+
FileUtils.touch("/var/opt/opscode/drbd/drbd_ready") unless
|
162
|
+
File.exist?("/var/opt/opscode/drbd/drbd_ready")
|
138
163
|
end
|
139
164
|
|
140
165
|
def reconfigure_server
|
141
|
-
log
|
142
|
-
shell_out(
|
166
|
+
log "Reconfiguring the Chef Server"
|
167
|
+
shell_out("#{ctl_command} reconfigure")
|
143
168
|
end
|
144
169
|
|
145
170
|
def cleanse_chef_server(agree)
|
146
|
-
log
|
147
|
-
|
171
|
+
log "Cleaning up any old files"
|
172
|
+
# The chef-server-ctl cleanse command deliberately waits 60 seconds to give
|
173
|
+
# you an option to cancel it. Therefore, don't count it in the timeout that
|
174
|
+
# the user provided. If the user has eagerly dismissed that wait period,
|
175
|
+
# then don't elongate the timeout. The user can do this with the -c flag.
|
176
|
+
timeout = shell_timeout + (agree ? 0 : 60) if shell_timeout
|
177
|
+
shell_out!("#{ctl_command} cleanse #{agree || ""}", "timeout" => timeout)
|
148
178
|
end
|
149
179
|
|
150
180
|
def running_config
|
151
181
|
@running_config ||=
|
152
|
-
JSON.parse(File.read(
|
182
|
+
JSON.parse(File.read(running_filepath)) || {}
|
153
183
|
end
|
154
184
|
|
155
185
|
def update_config
|
data/lib/chef_backup/strategy.rb
CHANGED
@@ -2,16 +2,16 @@
|
|
2
2
|
#
|
3
3
|
# All Rights Reserved
|
4
4
|
|
5
|
-
require
|
6
|
-
require
|
7
|
-
require
|
8
|
-
require
|
9
|
-
require
|
10
|
-
require
|
11
|
-
require
|
12
|
-
require
|
13
|
-
require
|
14
|
-
require
|
5
|
+
require "chef_backup/strategy/backup/tar"
|
6
|
+
require "chef_backup/strategy/backup/lvm"
|
7
|
+
require "chef_backup/strategy/backup/ebs"
|
8
|
+
require "chef_backup/strategy/backup/object"
|
9
|
+
require "chef_backup/strategy/backup/custom"
|
10
|
+
require "chef_backup/strategy/restore/tar"
|
11
|
+
require "chef_backup/strategy/restore/lvm"
|
12
|
+
require "chef_backup/strategy/restore/ebs"
|
13
|
+
require "chef_backup/strategy/restore/object"
|
14
|
+
require "chef_backup/strategy/restore/custom"
|
15
15
|
|
16
16
|
module ChefBackup
|
17
17
|
# ChefBackup::Strategy factory returns an ChefBackup::Strategy object
|
data/lib/chef_backup/version.rb
CHANGED
data/lib/chef_backup.rb
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
#
|
3
3
|
# All Rights Reserved
|
4
4
|
|
5
|
-
require
|
6
|
-
require
|
7
|
-
require
|
8
|
-
require
|
9
|
-
require
|
10
|
-
require
|
11
|
-
require
|
12
|
-
require
|
5
|
+
require "chef_backup/version"
|
6
|
+
require "chef_backup/exceptions"
|
7
|
+
require "chef_backup/config"
|
8
|
+
require "chef_backup/logger"
|
9
|
+
require "chef_backup/data_map"
|
10
|
+
require "chef_backup/helpers"
|
11
|
+
require "chef_backup/runner"
|
12
|
+
require "chef_backup/strategy"
|
metadata
CHANGED
@@ -1,93 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chef_backup
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.2.0.pre1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
7
|
+
- Chef Software, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-12-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: di-ruby-lvm
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - ">="
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '0'
|
20
|
-
type: :runtime
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - ">="
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '0'
|
27
13
|
- !ruby/object:Gem::Dependency
|
28
14
|
name: mixlib-shellout
|
29
15
|
requirement: !ruby/object:Gem::Requirement
|
30
16
|
requirements:
|
31
17
|
- - ">="
|
32
18
|
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
34
|
-
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - ">="
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: highline
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - ">="
|
19
|
+
version: '2.0'
|
20
|
+
- - "<"
|
46
21
|
- !ruby/object:Gem::Version
|
47
|
-
version: '0'
|
48
|
-
type: :runtime
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - ">="
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '0'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: chef
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - ">="
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
22
|
+
version: '4.0'
|
62
23
|
type: :runtime
|
63
24
|
prerelease: false
|
64
25
|
version_requirements: !ruby/object:Gem::Requirement
|
65
26
|
requirements:
|
66
27
|
- - ">="
|
67
28
|
- !ruby/object:Gem::Version
|
68
|
-
version: '0'
|
69
|
-
-
|
70
|
-
name: bundler
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - "~>"
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: '1.6'
|
76
|
-
type: :development
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - "~>"
|
29
|
+
version: '2.0'
|
30
|
+
- - "<"
|
81
31
|
- !ruby/object:Gem::Version
|
82
|
-
version: '
|
32
|
+
version: '4.0'
|
83
33
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
34
|
+
name: pastel
|
85
35
|
requirement: !ruby/object:Gem::Requirement
|
86
36
|
requirements:
|
87
37
|
- - ">="
|
88
38
|
- !ruby/object:Gem::Version
|
89
39
|
version: '0'
|
90
|
-
type: :
|
40
|
+
type: :runtime
|
91
41
|
prerelease: false
|
92
42
|
version_requirements: !ruby/object:Gem::Requirement
|
93
43
|
requirements:
|
@@ -95,98 +45,35 @@ dependencies:
|
|
95
45
|
- !ruby/object:Gem::Version
|
96
46
|
version: '0'
|
97
47
|
- !ruby/object:Gem::Dependency
|
98
|
-
name:
|
48
|
+
name: tty-prompt
|
99
49
|
requirement: !ruby/object:Gem::Requirement
|
100
50
|
requirements:
|
101
51
|
- - "~>"
|
102
52
|
- !ruby/object:Gem::Version
|
103
|
-
version: '
|
104
|
-
type: :
|
53
|
+
version: '0.21'
|
54
|
+
type: :runtime
|
105
55
|
prerelease: false
|
106
56
|
version_requirements: !ruby/object:Gem::Requirement
|
107
57
|
requirements:
|
108
58
|
- - "~>"
|
109
59
|
- !ruby/object:Gem::Version
|
110
|
-
version: '
|
111
|
-
- !ruby/object:Gem::Dependency
|
112
|
-
name: guard-rspec
|
113
|
-
requirement: !ruby/object:Gem::Requirement
|
114
|
-
requirements:
|
115
|
-
- - ">="
|
116
|
-
- !ruby/object:Gem::Version
|
117
|
-
version: '0'
|
118
|
-
type: :development
|
119
|
-
prerelease: false
|
120
|
-
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
requirements:
|
122
|
-
- - ">="
|
123
|
-
- !ruby/object:Gem::Version
|
124
|
-
version: '0'
|
125
|
-
- !ruby/object:Gem::Dependency
|
126
|
-
name: pry-rescue
|
127
|
-
requirement: !ruby/object:Gem::Requirement
|
128
|
-
requirements:
|
129
|
-
- - ">="
|
130
|
-
- !ruby/object:Gem::Version
|
131
|
-
version: '0'
|
132
|
-
type: :development
|
133
|
-
prerelease: false
|
134
|
-
version_requirements: !ruby/object:Gem::Requirement
|
135
|
-
requirements:
|
136
|
-
- - ">="
|
137
|
-
- !ruby/object:Gem::Version
|
138
|
-
version: '0'
|
139
|
-
- !ruby/object:Gem::Dependency
|
140
|
-
name: rubocop
|
141
|
-
requirement: !ruby/object:Gem::Requirement
|
142
|
-
requirements:
|
143
|
-
- - ">="
|
144
|
-
- !ruby/object:Gem::Version
|
145
|
-
version: 0.32.1
|
146
|
-
type: :development
|
147
|
-
prerelease: false
|
148
|
-
version_requirements: !ruby/object:Gem::Requirement
|
149
|
-
requirements:
|
150
|
-
- - ">="
|
151
|
-
- !ruby/object:Gem::Version
|
152
|
-
version: 0.32.1
|
153
|
-
- !ruby/object:Gem::Dependency
|
154
|
-
name: simplecov
|
155
|
-
requirement: !ruby/object:Gem::Requirement
|
156
|
-
requirements:
|
157
|
-
- - ">="
|
158
|
-
- !ruby/object:Gem::Version
|
159
|
-
version: '0'
|
160
|
-
type: :development
|
161
|
-
prerelease: false
|
162
|
-
version_requirements: !ruby/object:Gem::Requirement
|
163
|
-
requirements:
|
164
|
-
- - ">="
|
165
|
-
- !ruby/object:Gem::Version
|
166
|
-
version: '0'
|
60
|
+
version: '0.21'
|
167
61
|
description: A library to backup a Chef Server
|
168
62
|
email:
|
169
|
-
-
|
63
|
+
- oss@chef.io
|
170
64
|
executables: []
|
171
65
|
extensions: []
|
172
66
|
extra_rdoc_files: []
|
173
67
|
files:
|
174
|
-
- ".gitignore"
|
175
|
-
- ".kitchen.yml"
|
176
|
-
- ".rubocop.yml"
|
177
|
-
- ".travis.yml"
|
178
|
-
- Gemfile
|
179
|
-
- Guardfile
|
180
68
|
- LICENSE
|
181
|
-
- README.md
|
182
|
-
- Rakefile
|
183
|
-
- chef_backup.gemspec
|
184
69
|
- lib/chef_backup.rb
|
185
70
|
- lib/chef_backup/config.rb
|
186
71
|
- lib/chef_backup/data_map.rb
|
72
|
+
- lib/chef_backup/deep_merge.rb
|
187
73
|
- lib/chef_backup/exceptions.rb
|
188
74
|
- lib/chef_backup/helpers.rb
|
189
75
|
- lib/chef_backup/logger.rb
|
76
|
+
- lib/chef_backup/mash.rb
|
190
77
|
- lib/chef_backup/runner.rb
|
191
78
|
- lib/chef_backup/strategy.rb
|
192
79
|
- lib/chef_backup/strategy/backup/custom.rb
|
@@ -200,22 +87,9 @@ files:
|
|
200
87
|
- lib/chef_backup/strategy/restore/object.rb
|
201
88
|
- lib/chef_backup/strategy/restore/tar.rb
|
202
89
|
- lib/chef_backup/version.rb
|
203
|
-
- spec/fixtures/chef-server-running.json
|
204
|
-
- spec/spec_helper.rb
|
205
|
-
- spec/unit/data_map_spec.rb
|
206
|
-
- spec/unit/helpers_spec.rb
|
207
|
-
- spec/unit/runner_spec.rb
|
208
|
-
- spec/unit/shared_examples/helpers.rb
|
209
|
-
- spec/unit/strategy/backup/lvm_spec.rb
|
210
|
-
- spec/unit/strategy/backup/shared_examples/backup.rb
|
211
|
-
- spec/unit/strategy/backup/tar_spec.rb
|
212
|
-
- spec/unit/strategy/restore/lvm_spec.rb
|
213
|
-
- spec/unit/strategy/restore/shared_examples/restore.rb
|
214
|
-
- spec/unit/strategy/restore/tar_spec.rb
|
215
|
-
- spec/unit/strategy_spec.rb
|
216
90
|
homepage: https://github.com/chef/chef_backup
|
217
91
|
licenses:
|
218
|
-
-
|
92
|
+
- Apache-2.0
|
219
93
|
metadata: {}
|
220
94
|
post_install_message:
|
221
95
|
rdoc_options: []
|
@@ -232,23 +106,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
232
106
|
- !ruby/object:Gem::Version
|
233
107
|
version: 1.3.1
|
234
108
|
requirements: []
|
235
|
-
|
236
|
-
rubygems_version: 2.2.3
|
109
|
+
rubygems_version: 3.1.6
|
237
110
|
signing_key:
|
238
111
|
specification_version: 4
|
239
112
|
summary: A library to backup a Chef Server
|
240
|
-
test_files:
|
241
|
-
- spec/fixtures/chef-server-running.json
|
242
|
-
- spec/spec_helper.rb
|
243
|
-
- spec/unit/data_map_spec.rb
|
244
|
-
- spec/unit/helpers_spec.rb
|
245
|
-
- spec/unit/runner_spec.rb
|
246
|
-
- spec/unit/shared_examples/helpers.rb
|
247
|
-
- spec/unit/strategy/backup/lvm_spec.rb
|
248
|
-
- spec/unit/strategy/backup/shared_examples/backup.rb
|
249
|
-
- spec/unit/strategy/backup/tar_spec.rb
|
250
|
-
- spec/unit/strategy/restore/lvm_spec.rb
|
251
|
-
- spec/unit/strategy/restore/shared_examples/restore.rb
|
252
|
-
- spec/unit/strategy/restore/tar_spec.rb
|
253
|
-
- spec/unit/strategy_spec.rb
|
254
|
-
has_rdoc:
|
113
|
+
test_files: []
|
data/.gitignore
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
*.gem
|
2
|
-
*.rbc
|
3
|
-
.bundle
|
4
|
-
.config
|
5
|
-
.yardoc
|
6
|
-
Gemfile.lock
|
7
|
-
InstalledFiles
|
8
|
-
_yardoc
|
9
|
-
coverage
|
10
|
-
doc/
|
11
|
-
lib/bundler/man
|
12
|
-
pkg
|
13
|
-
rdoc
|
14
|
-
spec/reports
|
15
|
-
test/tmp
|
16
|
-
test/version_tmp
|
17
|
-
tmp
|
18
|
-
*.bundle
|
19
|
-
*.so
|
20
|
-
*.o
|
21
|
-
*.a
|
22
|
-
mkmf.log
|
23
|
-
*.sw*
|
data/.kitchen.yml
DELETED
@@ -1,30 +0,0 @@
|
|
1
|
-
driver:
|
2
|
-
name: vagrant
|
3
|
-
forward_agent: true
|
4
|
-
customize:
|
5
|
-
cpus: 2
|
6
|
-
memory: 2048
|
7
|
-
synced_folders:
|
8
|
-
- ['.', '/home/vagrant/chef_backup']
|
9
|
-
- ['../../opscode/chef_packages/', '/home/vagrant/chef_packages']
|
10
|
-
|
11
|
-
provisioner:
|
12
|
-
name: chef_zero
|
13
|
-
require_chef_omnibus: 11.16.4
|
14
|
-
|
15
|
-
platforms:
|
16
|
-
- name: ubuntu-14.04
|
17
|
-
run_list: apt::default
|
18
|
-
- name: ubuntu-12.04
|
19
|
-
run_list: apt::default
|
20
|
-
- name: ubuntu-11.04
|
21
|
-
run_list: apt::default
|
22
|
-
- name: ubuntu-10.04
|
23
|
-
run_list: apt::default
|
24
|
-
- name: centos-5.10
|
25
|
-
- name: centos-6.5
|
26
|
-
|
27
|
-
suites:
|
28
|
-
- name: default
|
29
|
-
attributes:
|
30
|
-
run_list:
|
data/.rubocop.yml
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
Style/ClassAndModuleChildren:
|
2
|
-
Enabled: false
|
3
|
-
Style/GuardClause:
|
4
|
-
Enabled: false
|
5
|
-
Metrics/LineLength:
|
6
|
-
Max: 120
|
7
|
-
Metrics/ClassLength:
|
8
|
-
Max: 200
|
9
|
-
Metrics/ModuleLength:
|
10
|
-
Max: 200
|
11
|
-
Metrics/CyclomaticComplexity:
|
12
|
-
Max: 10
|
13
|
-
Metrics/PerceivedComplexity:
|
14
|
-
Max: 10
|
15
|
-
Metrics/MethodLength:
|
16
|
-
Max: 40
|
17
|
-
Metrics/AbcSize:
|
18
|
-
Max: 40
|
19
|
-
AllCops:
|
20
|
-
Exclude:
|
21
|
-
- 'Guardfile'
|
data/.travis.yml
DELETED
data/Gemfile
DELETED
data/Guardfile
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
# A sample Guardfile
|
2
|
-
# More info at https://github.com/guard/guard#readme
|
3
|
-
|
4
|
-
# Note: The cmd option is now required due to the increasing number of ways
|
5
|
-
# rspec may be run, below are examples of the most common uses.
|
6
|
-
# * bundler: 'bundle exec rspec'
|
7
|
-
# * bundler binstubs: 'bin/rspec'
|
8
|
-
# * spring: 'bin/rsspec' (This will use spring if running and you have
|
9
|
-
# installed the spring binstubs per the docs)
|
10
|
-
# * zeus: 'zeus rspec' (requires the server to be started separetly)
|
11
|
-
# * 'just' rspec: 'rspec'
|
12
|
-
guard :rspec, cmd: 'bundle exec rspec -f doc --color', all_after_pass: true do
|
13
|
-
watch(%r{^spec/.+/.+_spec\.rb$})
|
14
|
-
watch(%r{^spec/.+/.+/.+_spec\.rb$})
|
15
|
-
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/unit/#{m[1]}_spec.rb" }
|
16
|
-
watch(%r{^lib/chef_backup/(.+)\.rb$}) { |m| "spec/unit/#{m[1]}_spec.rb" }
|
17
|
-
watch(%r{^lib/chef_backup/(.+)/(.+)\.rb$}) { |m| "spec/unit/#{m[1]}/#{m[2]}_spec.rb" }
|
18
|
-
watch(%r{^lib/chef_backup/(.+)/(.+)/(.+)\.rb$}) { |m| "spec/unit/#{m[1]}/#{m[2]}/#{m[3]}_spec.rb" }
|
19
|
-
watch('spec/spec_helper.rb') { "spec" }
|
20
|
-
end
|
21
|
-
|
22
|
-
notification :tmux
|