danarchy_deploy 0.2.1 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +10 -10
- data/bin/danarchy_deploy +6 -4
- data/danarchy_deploy.gemspec +3 -3
- data/lib/danarchy_deploy/services/mongodb.rb +10 -10
- data/lib/danarchy_deploy/system/cryptsetup.rb +140 -0
- data/lib/danarchy_deploy/system/fstab.rb +60 -0
- data/lib/danarchy_deploy/system.rb +23 -19
- data/lib/danarchy_deploy/version.rb +1 -1
- data/lib/danarchy_deploy.rb +2 -2
- data/templates/deploy_template.json +3 -3
- metadata +14 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f00a848b7b3326a27f07e661d2a0f79593cd8bb4140664e7fd86de1429a428a5
|
4
|
+
data.tar.gz: 91d62fdeff9560e8178bfe00b214c15740d53f785003f33a38d10c22878e5be5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: afb687e9d4df549f12bb3d14d6acf235020d288617ceba418eee50d7806da84d002491b1beb62056484a71e047aa91cac02b40d60afe7b8a073980550dc52af9
|
7
|
+
data.tar.gz: 8db9fa38eaedc05cc48074a690176764be983cdf9b18538773ee63d55de1c039a835f3c962df23d6970b725a0299cee9ea81f3aaee0e02c3244451caf46d6552
|
data/Gemfile.lock
CHANGED
@@ -1,26 +1,26 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
danarchy_deploy (0.2.
|
5
|
-
danarchy_couchdb (~> 0.1
|
6
|
-
mongo (~> 2.
|
4
|
+
danarchy_deploy (0.2.5)
|
5
|
+
danarchy_couchdb (~> 0.1)
|
6
|
+
mongo (~> 2.17)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
|
-
bson (4.
|
12
|
-
danarchy_couchdb (0.1.
|
13
|
-
mongo (2.
|
11
|
+
bson (4.14.0)
|
12
|
+
danarchy_couchdb (0.1.3)
|
13
|
+
mongo (2.17.0)
|
14
14
|
bson (>= 4.8.2, < 5.0.0)
|
15
|
-
rake (13.0.
|
15
|
+
rake (13.0.6)
|
16
16
|
|
17
17
|
PLATFORMS
|
18
|
-
|
18
|
+
x86_64-linux
|
19
19
|
|
20
20
|
DEPENDENCIES
|
21
|
-
bundler (~> 2.
|
21
|
+
bundler (~> 2.3)
|
22
22
|
danarchy_deploy!
|
23
23
|
rake (~> 13.0)
|
24
24
|
|
25
25
|
BUNDLED WITH
|
26
|
-
2.
|
26
|
+
2.3.3
|
data/bin/danarchy_deploy
CHANGED
@@ -5,7 +5,7 @@ require 'date'
|
|
5
5
|
require 'optparse'
|
6
6
|
|
7
7
|
deployment = nil
|
8
|
-
options = { couchdb: "#{ENV['HOME']}/.danarchy/danarchy_deploy/
|
8
|
+
options = { couchdb: "#{ENV['HOME']}/.danarchy/danarchy_deploy/danarchy_couchdb.json",
|
9
9
|
deploy_dir: '/danarchy/deploy',
|
10
10
|
deploy_file: nil,
|
11
11
|
first_run: false,
|
@@ -15,7 +15,8 @@ options = { couchdb: "#{ENV['HOME']}/.danarchy/danarchy_deploy/danarchy_deploy.j
|
|
15
15
|
|
16
16
|
ARGV.push('--help') if ARGV.empty?
|
17
17
|
optparse = OptionParser.new do |opts|
|
18
|
-
opts.banner
|
18
|
+
opts.banner = "Usage: danarchy_deploy (local|remote) --json #{options[:deploy_dir]}/<HOSTNAME>/<HOSTNAME>.json [options]"
|
19
|
+
opts.banner += "\n Local deployments require danarchy_deploy to be run as sudo/root.\n\n"
|
19
20
|
|
20
21
|
opts.on('-j=file', '--json=file', 'Read configuration from JSON file.') do |file|
|
21
22
|
require 'json'
|
@@ -65,7 +66,7 @@ optparse = OptionParser.new do |opts|
|
|
65
66
|
end.parse!
|
66
67
|
|
67
68
|
puts "DanarchyDeploy: #{DanarchyDeploy::VERSION}"
|
68
|
-
location = ARGV.delete('remote') || ARGV.delete('local') || abort("ERROR: Need
|
69
|
+
location = ARGV.delete('remote') || ARGV.delete('local') || abort("ERROR: Need a deployment type: 'local' or 'remote'!")
|
69
70
|
cdb_config = File.exist?(options[:couchdb]) ? JSON.parse(File.read(options[:couchdb]), symbolize_names: true)[:couchdb] : nil
|
70
71
|
cdb = DanarchyCouchDB::Connection.new(cdb_config) if cdb_config
|
71
72
|
|
@@ -94,7 +95,7 @@ end
|
|
94
95
|
if location == 'remote'
|
95
96
|
deployment = DanarchyDeploy::RemoteDeploy.new(deployment, options)
|
96
97
|
elsif location == 'local'
|
97
|
-
abort('Exiting!
|
98
|
+
abort('Exiting! Local deployment be run with sudo!') if Process.uid != 0
|
98
99
|
puts "Deploying #{deployment[:hostname]} locally to #{`hostname`.chomp}."
|
99
100
|
|
100
101
|
if !options[:pretend]
|
@@ -113,6 +114,7 @@ end
|
|
113
114
|
|
114
115
|
if deployment && cdb && !options[:pretend] && options[:deploy_file] !~ /.*(json|yaml)$/
|
115
116
|
puts "Saving deployment to CouchDB."
|
117
|
+
deployment[:_attachments].values.map { |v| v.delete(:data) } if deployment[:_attachments]
|
116
118
|
old_rev = cdb.get(cdb_config[:database], deployment_name)[:_rev]
|
117
119
|
save = cdb.put(cdb_config[:database], deployment[:_id], deployment)
|
118
120
|
|
data/danarchy_deploy.gemspec
CHANGED
@@ -28,10 +28,10 @@ Gem::Specification.new do |spec|
|
|
28
28
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
29
29
|
spec.require_paths = ["lib"]
|
30
30
|
|
31
|
-
spec.add_dependency "danarchy_couchdb", "~> 0.1
|
31
|
+
spec.add_dependency "danarchy_couchdb", "~> 0.1"
|
32
32
|
|
33
|
-
spec.add_development_dependency "bundler", "~> 2.
|
33
|
+
spec.add_development_dependency "bundler", "~> 2.3"
|
34
34
|
spec.add_development_dependency "rake", "~> 13.0"
|
35
35
|
|
36
|
-
spec.add_runtime_dependency "mongo", "~> 2.
|
36
|
+
spec.add_runtime_dependency "mongo", "~> 2.17"
|
37
37
|
end
|
@@ -48,9 +48,7 @@ module DanarchyDeploy
|
|
48
48
|
private
|
49
49
|
def self.load_mongodb_conf
|
50
50
|
updated_conf = false
|
51
|
-
@mongodb[:mongodb_conf]
|
52
|
-
@mongodb[:mongodb_conf] :
|
53
|
-
'/etc/mongodb.conf'
|
51
|
+
@mongodb[:mongodb_conf] ||= '/etc/mongodb.conf'
|
54
52
|
mongodb_conf = File.exist?(@mongodb[:mongodb_conf]) ? YAML.load_file(@mongodb[:mongodb_conf]) : Hash.new
|
55
53
|
|
56
54
|
generated_mongodb_conf = self.generate_mongodb_conf
|
@@ -59,13 +57,15 @@ module DanarchyDeploy
|
|
59
57
|
end
|
60
58
|
|
61
59
|
def self.generate_mongodb_conf
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
60
|
+
security_limits = '/etc/security/limits.d/mongodb.conf'
|
61
|
+
limits = <<~EOF
|
62
|
+
mongodb soft nofile 64000
|
63
|
+
mongodb hard nofile 64000
|
64
|
+
mongodb soft nproc 64000
|
65
|
+
mongodb hard nproc 64000
|
66
|
+
EOF
|
67
|
+
|
68
|
+
File.write(security_limits, limits) if !File.exist?(security_limits)
|
69
69
|
|
70
70
|
mongodb_conf = {
|
71
71
|
'net' => { 'port' => 27017, 'bindIp' => '127.0.0.1' },
|
@@ -0,0 +1,140 @@
|
|
1
|
+
|
2
|
+
module DanarchyDeploy
|
3
|
+
module System
|
4
|
+
class Cryptsetup
|
5
|
+
def self.new(os, cryptsetup, options)
|
6
|
+
return false if cryptsetup.nil?
|
7
|
+
puts "\n" + self.name
|
8
|
+
|
9
|
+
# expects object: { "cryptsetup": { "source": "/danarchy/deploy/templates/system/cryptsetup.erb", (optional)
|
10
|
+
# "volumes": { "vg_name:vg0:/dev/vdb": { "target": "dm-vg0-mongodb",
|
11
|
+
# "source": "/dev/mapper/vg0-mongodb",
|
12
|
+
# "key": "/root/vdb_mongodb.key" } } } }
|
13
|
+
|
14
|
+
if os == 'gentoo'
|
15
|
+
DanarchyDeploy::Services::Init.init_manager(os, 'lvmetad', 'enable', options)
|
16
|
+
DanarchyDeploy::Services::Init.init_manager(os, 'lvmetad', 'start', options)
|
17
|
+
end
|
18
|
+
|
19
|
+
service, target, source = set_config(cryptsetup, options)
|
20
|
+
lvm_result, crypt_result = nil
|
21
|
+
cryptsetup[:volumes].each do |device, volume|
|
22
|
+
lvm_result = lvm_setup(device, volume, options)
|
23
|
+
crypt_result = encrypt_volume(volume, options)
|
24
|
+
end
|
25
|
+
|
26
|
+
deploy_template(target, source, cryptsetup[:volumes], options)
|
27
|
+
if os == 'gentoo'
|
28
|
+
DanarchyDeploy::Services::Init.init_manager(os, service, 'enable', options)
|
29
|
+
DanarchyDeploy::Services::Init.init_manager(os, service, 'start', options)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
private
|
34
|
+
def self.set_config(cryptsetup, options)
|
35
|
+
service, target = File.exist?('/etc/conf.d/dmcrypt') ?
|
36
|
+
['dmcrypt','/etc/conf.d/dmcrypt'] :
|
37
|
+
['cryptsetup','/etc/crypttab']
|
38
|
+
|
39
|
+
source = if cryptsetup[:source]
|
40
|
+
cryptsetup[:source]
|
41
|
+
elsif target == '/etc/conf.d/dmcrypt'
|
42
|
+
options[:deploy_dir] + '/templates/system/dmcrypt.erb'
|
43
|
+
elsif target == '/etc/crypttab'
|
44
|
+
options[:deploy_dir] + '/templates/system/crypttab.erb'
|
45
|
+
else
|
46
|
+
nil
|
47
|
+
end
|
48
|
+
|
49
|
+
[service, target, source]
|
50
|
+
end
|
51
|
+
|
52
|
+
def self.lvm_setup(device, volume, options)
|
53
|
+
puts "\n > Configuring LVM"
|
54
|
+
name, vg, pv = device.to_s.split(/:/)
|
55
|
+
|
56
|
+
# Create physical volume
|
57
|
+
pvdisplay = DanarchyDeploy::Helpers.run_command("pvdisplay #{pv}", options)
|
58
|
+
if pvdisplay[:stderr]
|
59
|
+
puts "Creating physical volume: #{pv}"
|
60
|
+
pvcreate = DanarchyDeploy::Helpers.run_command("pvcreate -f #{pv}", options)
|
61
|
+
abort(" ! Failed to run pvcreate: #{pvcreate[:stderr]}") if pvcreate[:stderr]
|
62
|
+
puts pvcreate[:stdout]
|
63
|
+
pvdisplay = DanarchyDeploy::Helpers.run_command("pvdisplay #{pv}", options)
|
64
|
+
end
|
65
|
+
puts pvdisplay[:stderr] || pvdisplay[:stdout]
|
66
|
+
|
67
|
+
# Create volume group
|
68
|
+
vgdisplay = DanarchyDeploy::Helpers.run_command("vgdisplay #{vg}", options)
|
69
|
+
if vgdisplay[:stderr]
|
70
|
+
puts "Creating volume group: #{vg} with #{pv}"
|
71
|
+
vgcreate = DanarchyDeploy::Helpers.run_command("vgcreate #{vg} #{pv}", options)
|
72
|
+
abort(" ! Failed to run vgcreate: #{vgcreate[:stderr]}") if vgcreate[:stderr]
|
73
|
+
puts vgcreate[:stdout]
|
74
|
+
vgdisplay = DanarchyDeploy::Helpers.run_command("vgdisplay #{vg}", options)
|
75
|
+
end
|
76
|
+
puts vgdisplay[:stderr] || vgdisplay[:stdout]
|
77
|
+
|
78
|
+
# Create logical volume
|
79
|
+
lvdisplay = DanarchyDeploy::Helpers.run_command("lvdisplay #{vg}/#{name}", options)
|
80
|
+
if lvdisplay[:stderr]
|
81
|
+
puts "Creating volume group: #{vg}/#{name} with #{pv}"
|
82
|
+
lvcreate = DanarchyDeploy::Helpers.run_command("lvcreate -y -l 100%FREE -n #{name} #{vg}", options)
|
83
|
+
abort(" ! Failed to run lvcreate: #{lvcreate[:stderr]}") if lvcreate[:stderr]
|
84
|
+
puts lvcreate[:stdout]
|
85
|
+
lvdisplay = DanarchyDeploy::Helpers.run_command("lvdisplay #{vg}/#{name}", options)
|
86
|
+
end
|
87
|
+
puts lvdisplay[:stderr] || lvdisplay[:stdout]
|
88
|
+
|
89
|
+
[pvdisplay, vgdisplay, lvdisplay]
|
90
|
+
end
|
91
|
+
|
92
|
+
def self.encrypt_volume(volume, options)
|
93
|
+
puts "\n > Configuring Cryptsetup"
|
94
|
+
deploy_key(volume, options)
|
95
|
+
target = volume[:variables][:target]
|
96
|
+
source = volume[:variables][:source]
|
97
|
+
key = volume[:variables][:key]
|
98
|
+
abort(" ! Failed to find key: #{key}") if !File.exist?(key) && !options[:pretend]
|
99
|
+
|
100
|
+
# Encrypt logical volume with key
|
101
|
+
luksdump = DanarchyDeploy::Helpers.run_command("cryptsetup luksDump #{source}", options)
|
102
|
+
if luksdump[:stderr]
|
103
|
+
puts "\n > Encrypting volume: #{source}"
|
104
|
+
luksformat = DanarchyDeploy::Helpers.run_command("cryptsetup luksFormat #{source} #{key}", options)
|
105
|
+
abort(" ! Failed to run luksFormat: #{luksformat[:stderr]}") if luksformat[:stderr]
|
106
|
+
puts luksformat[:stdout]
|
107
|
+
luksdump = DanarchyDeploy::Helpers.run_command("cryptsetup luksDump #{source}", options)
|
108
|
+
end
|
109
|
+
puts luksdump[:stderr] || luksdump[:stdout]
|
110
|
+
|
111
|
+
# Open luks target
|
112
|
+
luksopen = { stderr: nil }
|
113
|
+
if !File.exist?("/dev/mapper/#{target}")
|
114
|
+
puts "\n > Opening volume: #{source}"
|
115
|
+
luksopen = DanarchyDeploy::Helpers.run_command("cryptsetup luksOpen -d #{key} #{source} #{target}", options)
|
116
|
+
abort(" ! Failed to run luksOpen: #{luksopen[:stderr]}") if luksopen[:stderr]
|
117
|
+
puts luksopen[:stdout]
|
118
|
+
end
|
119
|
+
|
120
|
+
[luksdump, luksopen]
|
121
|
+
end
|
122
|
+
|
123
|
+
def self.deploy_key(volume, options)
|
124
|
+
templates = [{ source: volume[:key_file],
|
125
|
+
target: volume[:variables][:key],
|
126
|
+
file_perms: {
|
127
|
+
owner: 'root',
|
128
|
+
group: 'root',
|
129
|
+
mode: '0400' } }]
|
130
|
+
|
131
|
+
DanarchyDeploy::Templater.new(templates, options)
|
132
|
+
end
|
133
|
+
|
134
|
+
def self.deploy_template(target, source, volumes, options)
|
135
|
+
templates = [{ target: target, source: source, variables: volumes }]
|
136
|
+
DanarchyDeploy::Templater.new(templates, options)
|
137
|
+
end
|
138
|
+
end
|
139
|
+
end
|
140
|
+
end
|
@@ -0,0 +1,60 @@
|
|
1
|
+
|
2
|
+
module DanarchyDeploy
|
3
|
+
module System
|
4
|
+
class Fstab
|
5
|
+
def self.new(os, fstab, options)
|
6
|
+
puts "\n" + self.name
|
7
|
+
target, source = set_config(fstab, options)
|
8
|
+
deploy_template(target, source, fstab[:mounts], options)
|
9
|
+
format_mountpoints(fstab, options)
|
10
|
+
mount_all(options)
|
11
|
+
end
|
12
|
+
|
13
|
+
private
|
14
|
+
def self.set_config(fstab, options)
|
15
|
+
target = '/etc/fstab'
|
16
|
+
source = fstab[:source] ?
|
17
|
+
fstab[:source] :
|
18
|
+
'/danarchy/deploy/templates/system/fstab.erb'
|
19
|
+
|
20
|
+
[target, source]
|
21
|
+
end
|
22
|
+
|
23
|
+
def self.deploy_template(target, source, mounts, options)
|
24
|
+
templates = [{ target: target,
|
25
|
+
source: source,
|
26
|
+
variables: mounts }]
|
27
|
+
|
28
|
+
DanarchyDeploy::Templater.new(templates, options)
|
29
|
+
end
|
30
|
+
|
31
|
+
def self.format_mountpoints(fstab, options)
|
32
|
+
return false if fstab.nil?
|
33
|
+
puts "\n > Formatting mountpoints"
|
34
|
+
|
35
|
+
fstab[:mounts].each do |mount|
|
36
|
+
fs_check = DanarchyDeploy::Helpers.run_command(
|
37
|
+
"file -sL #{mount[:filesystem]}", options
|
38
|
+
)
|
39
|
+
|
40
|
+
if fs_check[:stdout] && fs_check[:stdout] =~ /.*data$/
|
41
|
+
puts "\n > Formatting #{mount[:filesystem]}"
|
42
|
+
mkfs = DanarchyDeploy::Helpers.run_command(
|
43
|
+
"mkfs -t #{mount[:type]} #{mount[:filesystem]}", options
|
44
|
+
)
|
45
|
+
abort(" ! Failed to run mkfs: #{mkfs[:stderr]}") if mkfs[:stderr]
|
46
|
+
end
|
47
|
+
|
48
|
+
FileUtils.mkdir_p(mount[:mountpoint]) if !options[:pretend] &&
|
49
|
+
!Dir.exist?(mount[:mountpoint])
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
def self.mount_all(options)
|
54
|
+
puts "\n > Mounting Filesystems"
|
55
|
+
mount_result = DanarchyDeploy::Helpers.run_command('mount -a', options)
|
56
|
+
abort(' ! Failed to mount filesystems!') if mount_result[:stderr]
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
@@ -3,6 +3,9 @@ require_relative 'system/debian'
|
|
3
3
|
require_relative 'system/gentoo'
|
4
4
|
require_relative 'system/opensuse'
|
5
5
|
|
6
|
+
require_relative 'system/cryptsetup'
|
7
|
+
require_relative 'system/fstab'
|
8
|
+
|
6
9
|
module DanarchyDeploy
|
7
10
|
module System
|
8
11
|
def self.new(deployment, options)
|
@@ -29,6 +32,8 @@ module DanarchyDeploy
|
|
29
32
|
puts cleanup_result[:stdout] if cleanup_result[:stdout]
|
30
33
|
end
|
31
34
|
|
35
|
+
DanarchyDeploy::System::Cryptsetup.new(deployment[:os], deployment[:system][:cryptsetup], options)
|
36
|
+
DanarchyDeploy::System::Fstab.new(deployment[:os], deployment[:system][:fstab], options)
|
32
37
|
deployment
|
33
38
|
end
|
34
39
|
|
@@ -46,28 +51,9 @@ module DanarchyDeploy
|
|
46
51
|
if deployment[:system][:templates]
|
47
52
|
puts "\n > Configuring system templates for #{deployment[:os]}"
|
48
53
|
DanarchyDeploy::Templater.new(deployment[:system][:templates], options)
|
49
|
-
|
50
|
-
# Add deployment[:system][:dmcrypt], deployment[:system][:lvm], and deployment[:system][:fstab] here
|
51
|
-
deployment[:system][:templates].each do |t|
|
52
|
-
if t[:target] == '/etc/fstab'
|
53
|
-
t[:variables].each do |v|
|
54
|
-
if !Dir.exist?(v[:mountpoint])
|
55
|
-
puts "Creating mountpoint: #{v[:mountpoint]}"
|
56
|
-
FileUtils.mkdir_p(v[:mountpoint]) if !options[:pretend]
|
57
|
-
end
|
58
|
-
end
|
59
|
-
end
|
60
|
-
end
|
61
|
-
|
62
54
|
end
|
63
55
|
end
|
64
56
|
|
65
|
-
puts "\n > Mounting Filesystems"
|
66
|
-
if !options[:pretend]
|
67
|
-
mount_result = DanarchyDeploy::Helpers.run_command('mount -a', options)
|
68
|
-
abort(' |! Failed to mount filesystems!') if mount_result[:stderr]
|
69
|
-
end
|
70
|
-
|
71
57
|
if os.downcase == 'gentoo'
|
72
58
|
(installer, updater, cleaner) = DanarchyDeploy::System::Gentoo.new(deployment, options)
|
73
59
|
elsif %w[debian ubuntu].include?(os.downcase)
|
@@ -82,5 +68,23 @@ module DanarchyDeploy
|
|
82
68
|
|
83
69
|
[installer, updater, cleaner]
|
84
70
|
end
|
71
|
+
|
72
|
+
def self.fstab_mount(deployment, options)
|
73
|
+
fstab = deployment[:system][:templates].collect { |t| t if t[:target] == '/etc/fstab' }.compact
|
74
|
+
fstab.each do |t|
|
75
|
+
t[:variables].each do |v|
|
76
|
+
if !Dir.exist?(v[:mountpoint])
|
77
|
+
puts "Creating mountpoint: #{v[:mountpoint]}"
|
78
|
+
FileUtils.mkdir_p(v[:mountpoint]) if !options[:pretend]
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
puts "\n > Mounting Filesystems"
|
84
|
+
if !options[:pretend]
|
85
|
+
mount_result = DanarchyDeploy::Helpers.run_command('mount -a', options)
|
86
|
+
abort(' |! Failed to mount filesystems!') if mount_result[:stderr]
|
87
|
+
end
|
88
|
+
end
|
85
89
|
end
|
86
90
|
end
|
data/lib/danarchy_deploy.rb
CHANGED
@@ -79,10 +79,10 @@ module DanarchyDeploy
|
|
79
79
|
private
|
80
80
|
def self.remote_mkdir(connector, options)
|
81
81
|
puts "\n > Creating directory: #{options[:working_dir]}"
|
82
|
-
mkdir_cmd = _ssh_command(connector, "test -d #{options[:working_dir]} || sudo mkdir -vp #{options[:working_dir]}")
|
82
|
+
mkdir_cmd = _ssh_command(connector, "test -d #{options[:working_dir]} && echo 'Directory exists!' || sudo mkdir -vp #{options[:working_dir]}")
|
83
83
|
mkdir_result = DanarchyDeploy::Helpers.run_command(mkdir_cmd, options)
|
84
84
|
|
85
|
-
if mkdir_result[:stderr]
|
85
|
+
if mkdir_result[:stderr] && ! mkdir_result[:stdout]
|
86
86
|
abort(' ! Directory creation failed!')
|
87
87
|
else
|
88
88
|
puts " |+ Created directory: '#{options[:deploy_dir]}'"
|
@@ -37,8 +37,8 @@
|
|
37
37
|
],
|
38
38
|
"groups": [
|
39
39
|
{
|
40
|
-
|
41
|
-
|
40
|
+
"groupname": "groupname",
|
41
|
+
"gid": int
|
42
42
|
}
|
43
43
|
],
|
44
44
|
"services": {
|
@@ -48,7 +48,7 @@
|
|
48
48
|
"enable",
|
49
49
|
"restart"
|
50
50
|
]
|
51
|
-
}
|
51
|
+
},
|
52
52
|
"archives": [
|
53
53
|
{
|
54
54
|
"target": "/path/to/extract/to/",
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: danarchy_deploy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dan James
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-01-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: danarchy_couchdb
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.1
|
19
|
+
version: '0.1'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.1
|
26
|
+
version: '0.1'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '2.
|
33
|
+
version: '2.3'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '2.
|
40
|
+
version: '2.3'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rake
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -58,14 +58,14 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '2.
|
61
|
+
version: '2.17'
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '2.
|
68
|
+
version: '2.17'
|
69
69
|
description: DanarchyDeploy intends to simplify Gentoo Linux (and other distro) deployments
|
70
70
|
down to a single template from an input JSON or YAML file, or from a CouchDB file.
|
71
71
|
email:
|
@@ -115,7 +115,9 @@ files:
|
|
115
115
|
- lib/danarchy_deploy/services/mysql/privileges.rb
|
116
116
|
- lib/danarchy_deploy/system.rb
|
117
117
|
- lib/danarchy_deploy/system/centos.rb
|
118
|
+
- lib/danarchy_deploy/system/cryptsetup.rb
|
118
119
|
- lib/danarchy_deploy/system/debian.rb
|
120
|
+
- lib/danarchy_deploy/system/fstab.rb
|
119
121
|
- lib/danarchy_deploy/system/gentoo.rb
|
120
122
|
- lib/danarchy_deploy/system/opensuse.rb
|
121
123
|
- lib/danarchy_deploy/templater.rb
|
@@ -127,7 +129,7 @@ licenses:
|
|
127
129
|
- MIT
|
128
130
|
metadata:
|
129
131
|
allowed_push_host: https://rubygems.org
|
130
|
-
post_install_message:
|
132
|
+
post_install_message:
|
131
133
|
rdoc_options: []
|
132
134
|
require_paths:
|
133
135
|
- lib
|
@@ -142,8 +144,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
142
144
|
- !ruby/object:Gem::Version
|
143
145
|
version: '0'
|
144
146
|
requirements: []
|
145
|
-
rubygems_version: 3.
|
146
|
-
signing_key:
|
147
|
+
rubygems_version: 3.2.33
|
148
|
+
signing_key:
|
147
149
|
specification_version: 4
|
148
150
|
summary: Pushes deployments locally or remotely based on a JSON/YAML/CouchDB template.
|
149
151
|
test_files: []
|