-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdebian_custom.rb
65 lines (51 loc) · 1.22 KB
/
debian_custom.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# debian specific
# run after you have setup dedicated user
dep 'debian_custom' do
# set locale, US by default
requires 'set_us_locale'
# set server env such as production
requires 'env'
# add root zshrc
requires 'zshrc'.with('root')
# add root gemrc
requires 'gemrc'.with('root')
# add v bin and priit vim
requires 'vimrc_priit.copy'
# cleanup ssh welcome text
requires 'motd_empty'
# sshd origin backup
requires 'sshd_config_day_backup'
# verify ssh root login is off
requires 'sshd_root_login_should_be_off'
# verify ssh password login is off
requires 'sshd_password_should_be_off'
end
# cleanup ssh welcome text
dep 'motd_empty' do
met? do
!"/etc/motd".p.exists?
end
meet do
shell "mv /etc/motd /etc/motd.old"
end
end
# env
dep 'env', :env do
env.default('production').choose(%w[development staging production])
met? do
'/opt/development'.p.exists? ||
'/opt/staging'.p.exists? ||
'/opt/production'.p.exists?
end
meet do
sudo "touch /opt/#{env}"
end
end
# locale
dep 'set_us_locale' do
met? { '/etc/locale.gen'.p.grep(/^en\_US\.UTF\-8 UTF\-8/) }
meet do
'/etc/locale.gen'.p.append('en_US.UTF-8 UTF-8')
shell '/usr/sbin/locale-gen'
end
end