-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserver_app.rb
41 lines (36 loc) · 894 Bytes
/
server_app.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
#
# DB basic template
#
dep 'server_app', :password do
require 'ostruct'
require 'yaml'
conf_file = 'babushka.yml'
if conf_file.p.exists?
conf = OpenStruct.new(YAML.load_file(conf_file)['server_app'])
password.ask("New password")
requires 'general'
requires 'user'.with(conf.user, password, conf.authorized_keys)
requires 'debian_custom'
requires 'network_ip_failover'.with(conf.network_ip_failover) if conf.network_ip_failover
else
requires 'server_app_yml'
log "Please edit babushka.yml file before continue", as: :warning
end
end
# generate blank babushka yml file
dep 'server_app_yml' do
met? do
path.p.exists?
end
meet do
path.p.append <<-EOF.gsub(/^ {6}/, '')
server_app:
user: LINUX USERNAME
authorized_keys: priit
network_ip_failover:
EOF
end
def path
'babushka.yml'
end
end