danarchy_deploy 0.2.7 → 0.2.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.asdf_versions.json +5 -0
- data/.tool-versions +1 -0
- data/CHANGELOG.md +15 -0
- data/Gemfile.lock +9 -8
- data/bin/danarchy_deploy +0 -1
- data/danarchy_deploy.gemspec +4 -4
- data/lib/danarchy_deploy/applicator/ssl.rb +1 -1
- data/lib/danarchy_deploy/archiver.rb +1 -1
- data/lib/danarchy_deploy/groups.rb +0 -1
- data/lib/danarchy_deploy/services/init/openrc.rb +10 -6
- data/lib/danarchy_deploy/services/init.rb +28 -18
- data/lib/danarchy_deploy/services.rb +0 -1
- data/lib/danarchy_deploy/system/centos.rb +7 -0
- data/lib/danarchy_deploy/system/debian.rb +6 -0
- data/lib/danarchy_deploy/system/fstab.rb +15 -5
- data/lib/danarchy_deploy/system/gentoo.rb +84 -23
- data/lib/danarchy_deploy/system/opensuse.rb +6 -0
- data/lib/danarchy_deploy/system.rb +14 -9
- data/lib/danarchy_deploy/templater.rb +1 -2
- data/lib/danarchy_deploy/users.rb +50 -42
- data/lib/danarchy_deploy/version.rb +1 -1
- data/lib/danarchy_deploy.rb +63 -20
- data/templates/applications/nginx/domain.conf.erb +38 -0
- data/templates/applications/php/phpfpm.conf.erb +19 -0
- data/templates/applications/php/user.conf.erb +19 -0
- data/templates/applications/wordpress/mysql_user_privileges.sql.erb +2 -0
- data/templates/applications/wordpress/wp-config.php.erb +82 -0
- data/templates/asdf/asdf.sh.erb +52 -0
- data/templates/deploy_template.json +6 -7
- data/templates/distcc/distccd.erb +14 -0
- data/templates/distcc/hosts.erb +2 -0
- data/templates/portage/make.conf.erb +30 -0
- data/templates/portage/package.use/bindist +3 -0
- data/templates/portage/package.use/documentation +3 -0
- data/templates/services/memcached/memcached.erb +40 -0
- data/templates/services/mysql/my.cnf.erb +143 -0
- data/templates/services/mysql/root_my.cnf.erb +11 -0
- data/templates/services/mysql/user_db_grants.sql.erb +33 -0
- data/templates/services/mysql/user_db_grants.sql.erb_cleanupUsers +52 -0
- data/templates/services/nginx/nginx.conf.erb +48 -0
- data/templates/services/php/php-fpm.conf.erb +2 -0
- data/templates/services/postfix/localmail.initial_setup.sh +19 -0
- data/templates/services/postfix/localmail.main.cf.erb +41 -0
- data/templates/services/postfix/mailname.erb +1 -0
- data/templates/services/postfix/mailrelayhost_main.cf.erb +33 -0
- data/templates/services/postfix/main.cf.erb +28 -0
- data/templates/services/postfix/master.cf.erb +124 -0
- data/templates/services/postfix/mysql-virtual-alias-maps.cf.erb +5 -0
- data/templates/services/postfix/mysql-virtual-mailbox-domains.cf.erb +5 -0
- data/templates/services/postfix/mysql-virtual-mailbox-maps.cf.erb +5 -0
- data/templates/system/authorized_keys.erb +5 -0
- data/templates/system/crontab.erb +8 -0
- data/templates/system/dmcrypt.erb +17 -0
- data/templates/system/exports.erb +4 -0
- data/templates/system/fstab.erb +4 -0
- data/templates/system/sudoers.erb +5 -0
- metadata +44 -11
- data/.ruby-gemset +0 -1
- data/.ruby-version +0 -1
- /data/bin/{setup → setup-dd} +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1cebdd523daec796bb3189d1fce8b0f48296e575a0c84ec731a3983acf856868
|
4
|
+
data.tar.gz: aaf5be0aa79434f6982051ab9472b868f591c4e0025a2fe076210fccf94fa4be
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0a08ce041b150b6033e6a6d644cd4f90682479fca8c214ede36c440e02eed573a3a9508ec432d219e9ba8097e73d901253c6ed1da9c12527c590f079dcf44395
|
7
|
+
data.tar.gz: ddbcf529c9b5a5612d3e6f455017e82fa98c870244fbfe6709e480bb07b9c787ffc5fd0ed53d686de796e3256646b309fa3dbb5493d4d9d55607fdf77b8ec8d9
|
data/.tool-versions
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
ruby 3.2.2
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,18 @@
|
|
1
|
+
patch_0.2.9
|
2
|
+
- cleanup emerge --sync output
|
3
|
+
- change Date to Time
|
4
|
+
- fix hostnamectl set-hostname
|
5
|
+
- Fstab: skip formatting NFS mountpoints
|
6
|
+
|
7
|
+
patch_0.2.8
|
8
|
+
- Switch support from RVM to ASDF
|
9
|
+
- users.rb: use Templater to handle authorized_users and sudoers
|
10
|
+
- danarchy_deploy.rb: ignore WARNs in gem install
|
11
|
+
- danarchy_deploy.rb: use sudo -i to load environment
|
12
|
+
- Templater: add builtin templates
|
13
|
+
- Gentoo: wait_for_sync
|
14
|
+
- System::Init: OpenRC runlevel support
|
15
|
+
|
1
16
|
patch_0.2.7
|
2
17
|
- Patch Templater ERB.new for Ruby versions higher than 2.6
|
3
18
|
- Allow builtin:: templates in Templater
|
data/Gemfile.lock
CHANGED
@@ -1,26 +1,27 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
danarchy_deploy (0.2.
|
4
|
+
danarchy_deploy (0.2.8)
|
5
5
|
danarchy_couchdb (~> 0.1)
|
6
|
-
mongo (~> 2.
|
6
|
+
mongo (~> 2.20)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
|
-
bson (
|
11
|
+
bson (5.0.1)
|
12
12
|
danarchy_couchdb (0.1.3)
|
13
|
-
mongo (2.
|
14
|
-
bson (>= 4.
|
15
|
-
rake (13.
|
13
|
+
mongo (2.20.1)
|
14
|
+
bson (>= 4.14.1, < 6.0.0)
|
15
|
+
rake (13.2.1)
|
16
16
|
|
17
17
|
PLATFORMS
|
18
|
+
ruby
|
18
19
|
x86_64-linux
|
19
20
|
|
20
21
|
DEPENDENCIES
|
21
|
-
bundler (~> 2.
|
22
|
+
bundler (~> 2.5)
|
22
23
|
danarchy_deploy!
|
23
24
|
rake (~> 13.0)
|
24
25
|
|
25
26
|
BUNDLED WITH
|
26
|
-
2.
|
27
|
+
2.5.11
|
data/bin/danarchy_deploy
CHANGED
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
|
31
|
+
spec.add_dependency 'danarchy_couchdb', '~> 0.1'
|
32
32
|
|
33
|
-
spec.add_development_dependency
|
34
|
-
spec.add_development_dependency
|
33
|
+
spec.add_development_dependency 'bundler', '~> 2.5'
|
34
|
+
spec.add_development_dependency 'rake', '~> 13.0'
|
35
35
|
|
36
|
-
spec.add_runtime_dependency
|
36
|
+
spec.add_runtime_dependency 'mongo', '~> 2.20'
|
37
37
|
end
|
@@ -10,7 +10,7 @@ module DanarchyDeploy
|
|
10
10
|
|
11
11
|
tmparchive = false
|
12
12
|
if !archive[:source] && archive[:data]
|
13
|
-
archive[:source] = options[:deploy_dir] + "/.tmp_archive_#{
|
13
|
+
archive[:source] = options[:deploy_dir] + "/.tmp_archive_#{Time.now.strftime("%Y%m%d_%H%M%S")}"
|
14
14
|
tmparchive = true
|
15
15
|
data = DanarchyDeploy::Helpers.decode_base64(archive[:data])
|
16
16
|
write_tmp_archive(archive[:source], data)
|
@@ -3,9 +3,10 @@ module DanarchyDeploy
|
|
3
3
|
module Services
|
4
4
|
class Init
|
5
5
|
class Openrc
|
6
|
-
def initialize(service, options)
|
7
|
-
@service
|
8
|
-
@
|
6
|
+
def initialize(service, runlevel, options)
|
7
|
+
@service = service
|
8
|
+
@runlevel = runlevel
|
9
|
+
@options = options
|
9
10
|
end
|
10
11
|
|
11
12
|
def status
|
@@ -58,13 +59,16 @@ module DanarchyDeploy
|
|
58
59
|
end
|
59
60
|
|
60
61
|
def enable
|
61
|
-
cmd = "rc-update add #{@service}
|
62
|
+
cmd = "rc-update add #{@service} #{@runlevel}"
|
62
63
|
DanarchyDeploy::Helpers.run_command(cmd, @options)
|
63
64
|
end
|
64
65
|
|
65
66
|
def disable
|
66
|
-
|
67
|
-
|
67
|
+
Dir["/etc/runlevels/*/#{@service}"].each do |svc|
|
68
|
+
runlevel, service = svc.split('/')[3,4]
|
69
|
+
cmd = "rc-update del #{service} #{runlevel}"
|
70
|
+
DanarchyDeploy::Helpers.run_command(cmd, @options)
|
71
|
+
end
|
68
72
|
end
|
69
73
|
end
|
70
74
|
end
|
@@ -10,42 +10,52 @@ module DanarchyDeploy
|
|
10
10
|
|
11
11
|
deployment[:services].each do |service, params|
|
12
12
|
next if ! params[:init]
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
13
|
+
if params[:init].class == Array
|
14
|
+
# one-time update for :init to new format
|
15
|
+
params[:init] = if deployment[:os] == 'gentoo'
|
16
|
+
{ runlevel: 'default', actions: params[:init] }
|
17
|
+
else
|
18
|
+
{ actions: params[:init] }
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
init_manager(deployment[:os], service, params[:init][:runlevel], options)
|
23
|
+
puts "\n > Init actions for #{service}: #{params[:init][:actions].join(', ')}"
|
24
|
+
params[:init][:actions].each do |action|
|
25
|
+
puts " |> Taking action: #{action} on #{service}"
|
17
26
|
if options[:pretend]
|
18
|
-
puts "
|
27
|
+
puts " |- Fake run: #{action} #{service}"
|
19
28
|
else
|
20
|
-
|
29
|
+
init_run(action)
|
21
30
|
end
|
22
31
|
end
|
23
|
-
|
24
|
-
params[:init] = orig_actions
|
25
32
|
end
|
26
33
|
|
27
34
|
deployment
|
28
35
|
end
|
29
36
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
37
|
+
private
|
38
|
+
def self.init_manager(os, service, runlevel='default', options)
|
39
|
+
@init = if os == 'gentoo'
|
40
|
+
DanarchyDeploy::Services::Init::Openrc.new(service, runlevel, options)
|
41
|
+
else
|
42
|
+
DanarchyDeploy::Services::Init::Systemd.new(service, options)
|
43
|
+
end
|
44
|
+
end
|
36
45
|
|
37
|
-
|
46
|
+
def self.init_run(action)
|
47
|
+
init_result = @init.send(action)
|
38
48
|
|
39
49
|
if stderr = init_result[:stderr]
|
40
50
|
if stderr.include?('unknown function')
|
41
|
-
puts " ! Action: #{action} not available for service
|
51
|
+
puts " ! Action: #{action} not available for service.\n" +
|
42
52
|
" ! A restart may be needed! Otherwise, remove this action from the deployment.\n" +
|
43
53
|
" ! Not taking any action here.\n"
|
44
54
|
else
|
45
|
-
abort(" ! Action: #{action}
|
55
|
+
abort(" ! Action: #{action} failed!")
|
46
56
|
end
|
47
57
|
else
|
48
|
-
puts " |+ Action: #{action}
|
58
|
+
puts " |+ Action: #{action} succeeded."
|
49
59
|
end
|
50
60
|
end
|
51
61
|
end
|
@@ -6,12 +6,19 @@ module DanarchyDeploy
|
|
6
6
|
puts "\n" + self.name
|
7
7
|
puts "#{deployment[:os].capitalize} detected! Using yum."
|
8
8
|
# needs more testing
|
9
|
+
|
10
|
+
set_hostname(deployment[:hostname]) if !options[:pretend]
|
9
11
|
installer = 'yum install -y '
|
10
12
|
updater = 'yum upgrade -y'
|
11
13
|
cleaner = 'yum clean all'
|
12
14
|
|
13
15
|
[installer, updater, cleaner]
|
14
16
|
end
|
17
|
+
|
18
|
+
private
|
19
|
+
def set_hostname(hostname)
|
20
|
+
`hostnamectl set-hostname #{hostname}`
|
21
|
+
end
|
15
22
|
end
|
16
23
|
end
|
17
24
|
end
|
@@ -7,6 +7,7 @@ module DanarchyDeploy
|
|
7
7
|
puts "\n" + self.name
|
8
8
|
puts "#{deployment[:os].capitalize} detected! Using apt."
|
9
9
|
|
10
|
+
set_hostname(deployment[:hostname]) if !options[:pretend]
|
10
11
|
if deployment[:apt]
|
11
12
|
if deployment[:apt][:templates]
|
12
13
|
puts "\nChecking Apt configs."
|
@@ -56,6 +57,11 @@ module DanarchyDeploy
|
|
56
57
|
end
|
57
58
|
end
|
58
59
|
end
|
60
|
+
|
61
|
+
private
|
62
|
+
def set_hostname(hostname)
|
63
|
+
`hostnamectl set-hostname #{hostname}`
|
64
|
+
end
|
59
65
|
end
|
60
66
|
end
|
61
67
|
end
|
@@ -39,11 +39,7 @@ module DanarchyDeploy
|
|
39
39
|
puts "\n > Formatting mountpoints"
|
40
40
|
|
41
41
|
fstab[:mounts].each do |mount|
|
42
|
-
fs_check
|
43
|
-
"file -sL #{mount[:filesystem]}", options
|
44
|
-
)
|
45
|
-
|
46
|
-
if fs_check[:stdout] && fs_check[:stdout] =~ /.*data$/
|
42
|
+
if fs_check(mount, options) == true
|
47
43
|
puts "\n > Formatting #{mount[:filesystem]}"
|
48
44
|
mkfs = DanarchyDeploy::Helpers.run_command(
|
49
45
|
"mkfs -t #{mount[:type]} #{mount[:filesystem]}", options
|
@@ -55,6 +51,20 @@ module DanarchyDeploy
|
|
55
51
|
!Dir.exist?(mount[:mountpoint])
|
56
52
|
end
|
57
53
|
end
|
54
|
+
|
55
|
+
def self.fs_check(mount, options)
|
56
|
+
return false if mount[:type] =~ /^nfs/
|
57
|
+
|
58
|
+
fs_check = DanarchyDeploy::Helpers.run_command(
|
59
|
+
"file -sL #{mount[:filesystem]}", options
|
60
|
+
)
|
61
|
+
|
62
|
+
if fs_check[:stdout] && fs_check[:stdout] =~ /.*data$/
|
63
|
+
return true
|
64
|
+
else
|
65
|
+
return false
|
66
|
+
end
|
67
|
+
end
|
58
68
|
end
|
59
69
|
end
|
60
70
|
end
|
@@ -6,12 +6,7 @@ module DanarchyDeploy
|
|
6
6
|
puts "\n" + self.name
|
7
7
|
puts 'Gentoo detected! Using emerge.'
|
8
8
|
|
9
|
-
hostname
|
10
|
-
if check_hostname(hostname) == false
|
11
|
-
puts "Setting hostname to: #{hostname}"
|
12
|
-
set_hostname(hostname)
|
13
|
-
end
|
14
|
-
|
9
|
+
set_hostname(deployment[:hostname]) if !options[:pretend]
|
15
10
|
installer = 'emerge --usepkg --buildpkg --quiet --noreplace '
|
16
11
|
# This needs cpuid2cpuflags to build make.conf; don't --pretend here.
|
17
12
|
system("qlist -I cpuid2cpuflags &>/dev/null || #{installer} cpuid2cpuflags &>/dev/null")
|
@@ -23,43 +18,109 @@ module DanarchyDeploy
|
|
23
18
|
cleaner = 'emerge --depclean --quiet '
|
24
19
|
cleaner += '--pretend ' if options[:pretend]
|
25
20
|
|
21
|
+
if emerge_sync_in_progress
|
22
|
+
puts "\n > Waiting for emerge sync to complete."
|
23
|
+
emerge_sync_wait
|
24
|
+
end
|
25
|
+
|
26
26
|
if deployment[:portage]
|
27
27
|
if deployment[:portage][:templates]
|
28
28
|
puts "\nChecking Portage configs."
|
29
29
|
DanarchyDeploy::Templater.new(deployment[:portage][:templates], options)
|
30
30
|
end
|
31
31
|
|
32
|
-
emerge_sync(
|
32
|
+
emerge_sync(deployment[:portage][:sync], options)
|
33
33
|
end
|
34
34
|
|
35
35
|
[installer, updater, cleaner]
|
36
36
|
end
|
37
37
|
|
38
38
|
private
|
39
|
+
def self.emerge_sync_in_progress
|
40
|
+
repo_path = `emerge --info | grep location`.chomp.split(': ').last
|
41
|
+
Dir.exist?(repo_path + '/.tmp-unverified-download-quarantine')
|
42
|
+
end
|
39
43
|
|
40
|
-
def self.
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
DanarchyDeploy::Helpers.run_command('emerge --sync --quiet 2>/dev/null', options)
|
47
|
-
f.truncate(0)
|
48
|
-
f.write DateTime.now
|
49
|
-
end
|
44
|
+
def self.emerge_sync_wait
|
45
|
+
while emerge_sync_in_progress
|
46
|
+
sleep 3
|
47
|
+
end
|
48
|
+
puts " |> Continuing with emerge!"
|
49
|
+
end
|
50
50
|
|
51
|
-
|
51
|
+
def self.emerge_sync(sync, options)
|
52
|
+
puts "\n > Gentoo Emerge Sync"
|
53
|
+
if sync.nil?
|
54
|
+
install_sync_cron(sync, options)
|
55
|
+
elsif sync == false
|
56
|
+
puts "\n - Not running emerge sync; set to: #{sync}"
|
57
|
+
install_sync_cron(sync, options)
|
58
|
+
elsif sync == true
|
59
|
+
File.delete('/var/spool/cron/crontabs/portage') if File.exist?('/var/spool/cron/crontabs/portage')
|
60
|
+
DanarchyDeploy::Helpers.run_command('emerge --sync &>/var/log/emerge-sync.log', options)
|
61
|
+
elsif sync =~ /([0-9]{1,2}|\*|\@[a-z]{4,7})/i
|
62
|
+
install_sync_cron(sync, options)
|
63
|
+
else
|
64
|
+
puts "\n ! Unknown sync cron time: #{sync}. Not running emerge sync!"
|
52
65
|
end
|
53
66
|
end
|
54
67
|
|
55
68
|
def self.set_hostname(hostname)
|
56
|
-
|
57
|
-
|
58
|
-
|
69
|
+
if `hostname`.chomp != hostname
|
70
|
+
puts "Setting hostname to: #{hostname}"
|
71
|
+
confd_hostname = "hostname=\"#{hostname}\""
|
72
|
+
File.write('/etc/conf.d/hostname', confd_hostname)
|
73
|
+
`hostname #{hostname}`
|
74
|
+
end
|
59
75
|
end
|
60
76
|
|
61
|
-
def self.
|
62
|
-
|
77
|
+
def self.install_sync_cron(sync, options)
|
78
|
+
templates = if sync.nil? || sync == false
|
79
|
+
[
|
80
|
+
{
|
81
|
+
target: '/var/spool/cron/crontabs/portage',
|
82
|
+
remove: true
|
83
|
+
}
|
84
|
+
]
|
85
|
+
else
|
86
|
+
[
|
87
|
+
{
|
88
|
+
source: 'builtin::system/crontab.erb',
|
89
|
+
target: '/var/spool/cron/crontabs/portage',
|
90
|
+
dir_perms: {
|
91
|
+
owner: 'root',
|
92
|
+
group: 'crontab',
|
93
|
+
mode: '1730'
|
94
|
+
},
|
95
|
+
file_perms: {
|
96
|
+
owner: 'portage',
|
97
|
+
group: 'crontab',
|
98
|
+
mode: '0600'
|
99
|
+
},
|
100
|
+
variables: {
|
101
|
+
shell: '/bin/bash',
|
102
|
+
path: '/usr/local/sbin:/usr/local/bin:/usr/bin',
|
103
|
+
env: '',
|
104
|
+
jobs: [
|
105
|
+
{
|
106
|
+
schedule: sync,
|
107
|
+
command: 'emerge --sync &>/var/log/emerge-sync.log'
|
108
|
+
},
|
109
|
+
{
|
110
|
+
schedule: '@daily',
|
111
|
+
command: 'eclean-dist &>/dev/null'
|
112
|
+
},
|
113
|
+
{
|
114
|
+
schedule: '@daily',
|
115
|
+
command: 'eclean-pkg &>/dev/null'
|
116
|
+
}
|
117
|
+
]
|
118
|
+
}
|
119
|
+
}
|
120
|
+
]
|
121
|
+
end
|
122
|
+
|
123
|
+
DanarchyDeploy::Templater.new(templates, options)
|
63
124
|
end
|
64
125
|
end
|
65
126
|
end
|
@@ -6,6 +6,7 @@ module DanarchyDeploy
|
|
6
6
|
puts "\n" + self.name
|
7
7
|
puts "#{deployment[:os].capitalize} detected! Using zypper."
|
8
8
|
|
9
|
+
set_hostname(deployment[:hostname]) if !options[:pretend]
|
9
10
|
puts "Updating zypper repositories..."
|
10
11
|
DanarchyDeploy::Helpers.run_command('sudo zypper refresh', options)
|
11
12
|
|
@@ -17,6 +18,11 @@ module DanarchyDeploy
|
|
17
18
|
|
18
19
|
[installer, updater, cleaner]
|
19
20
|
end
|
21
|
+
|
22
|
+
private
|
23
|
+
def set_hostname(hostname)
|
24
|
+
`hostnamectl set-hostname #{hostname}`
|
25
|
+
end
|
20
26
|
end
|
21
27
|
end
|
22
28
|
end
|
@@ -3,7 +3,7 @@ require_relative 'system/debian'
|
|
3
3
|
require_relative 'system/gentoo'
|
4
4
|
require_relative 'system/opensuse'
|
5
5
|
|
6
|
-
require_relative 'system/cryptsetup'
|
6
|
+
# require_relative 'system/cryptsetup'
|
7
7
|
require_relative 'system/fstab'
|
8
8
|
|
9
9
|
module DanarchyDeploy
|
@@ -13,10 +13,11 @@ module DanarchyDeploy
|
|
13
13
|
puts "\n" + self.name
|
14
14
|
|
15
15
|
installer, updater, cleaner = prep_operating_system(deployment, options)
|
16
|
-
install_result = nil
|
16
|
+
install_result, updater_result = nil, nil
|
17
17
|
|
18
18
|
puts "\n > Package Installation"
|
19
|
-
if
|
19
|
+
if [true, 'all', 'selected', nil].include?(deployment[:system][:update]) &&
|
20
|
+
deployment[:packages].any?
|
20
21
|
packages = deployment[:packages].join(' ')
|
21
22
|
puts "\n - Installing packages..."
|
22
23
|
install_result = DanarchyDeploy::Helpers.run_command("#{installer} #{packages}", options)
|
@@ -24,20 +25,23 @@ module DanarchyDeploy
|
|
24
25
|
else
|
25
26
|
puts "\n - Not installing packages."
|
26
27
|
puts " |_ Packages selected: #{deployment[:packages].count}"
|
27
|
-
puts " |_
|
28
|
+
puts " |_ Install/Update: #{deployment[:system][:update]}"
|
28
29
|
end
|
29
30
|
|
30
31
|
puts "\n > #{deployment[:os].capitalize} System Updates"
|
31
|
-
if ['all', 'system', nil].include?(deployment[:system][:update])
|
32
|
+
if [true, 'all', 'system', nil].include?(deployment[:system][:update])
|
32
33
|
puts "\n - Running system updates..."
|
33
34
|
updater_result = DanarchyDeploy::Helpers.run_command(updater, options)
|
34
35
|
puts updater_result[:stdout] if updater_result[:stdout]
|
36
|
+
else
|
37
|
+
puts "\n - Not running #{deployment[:os].capitalize} system updates."
|
38
|
+
puts " |_ Install/Update: #{deployment[:system][:update]}"
|
39
|
+
end
|
40
|
+
|
41
|
+
if install_result || updater_result
|
35
42
|
puts "\n - Cleaning up unused packages..."
|
36
43
|
cleanup_result = DanarchyDeploy::Helpers.run_command(cleaner, options)
|
37
44
|
puts cleanup_result[:stdout] if cleanup_result[:stdout]
|
38
|
-
else
|
39
|
-
puts "\n - Not running #{deployment[:os].capitalize} system updates."
|
40
|
-
puts " |_ Updates selected: #{deployment[:system][:update]}"
|
41
45
|
end
|
42
46
|
|
43
47
|
deployment
|
@@ -59,7 +63,8 @@ module DanarchyDeploy
|
|
59
63
|
DanarchyDeploy::Templater.new(deployment[:system][:templates], options)
|
60
64
|
end
|
61
65
|
|
62
|
-
|
66
|
+
# Disabled due to Init changes; re-writing and splitting LVM/CryptSetup
|
67
|
+
# DanarchyDeploy::System::Cryptsetup.new(deployment[:os], deployment[:system][:cryptsetup], options)
|
63
68
|
|
64
69
|
if deployment[:system][:fstab]
|
65
70
|
DanarchyDeploy::System::Fstab.new(deployment[:os], deployment[:system][:fstab], options)
|
@@ -95,13 +95,12 @@ module DanarchyDeploy
|
|
95
95
|
chmod = nil
|
96
96
|
puts "\n > Verifying ownership and permissions for '#{target}'"
|
97
97
|
if perms
|
98
|
-
puts " |+ Setting file mode to: #{perms[:mode]}"
|
99
98
|
(owner, group, mode) = perms[:owner], perms[:group], perms[:mode]
|
100
99
|
else
|
101
100
|
if File.stat(target).mode & 07777 == '0777'.to_i(8)
|
102
101
|
puts " ! '#{target}' has 0777 permissions! Setting those to something more sane."
|
103
102
|
if File.ftype(target) == 'directory'
|
104
|
-
puts " |+ Setting
|
103
|
+
puts " |+ Setting directory mode to: 0775"
|
105
104
|
chmod = File.chmod(0775, target) ? true : false if !options[:pretend]
|
106
105
|
elsif File.ftype(target) == 'file'
|
107
106
|
puts " |+ Setting file mode to: 0644"
|