-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgemconf.rb
42 lines (38 loc) · 889 Bytes
/
gemconf.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
command = Mixlib::ShellOut.new('echo ~root')
command.run_command
root_home_dir = command.stdout.to_s.strip
puts 'Homedir:' + root_home_dir
directory '/opt/chef/embedded/etc' do
owner 'root'
group 'root'
mode 00755
recursive true
end.run_action(:create)
file '/opt/chef/embedded/etc/gemrc' do
content <<-EOF
---
:backtrace: false
:bulk_threshold: 1000
:sources:
- #{node['bnhp-gems']['source']}
:update_sources: true
:verbose: true
:ssl_verify_mode: 0
install: "--user --no-document"
update: "--user --no-document"
EOF
end.run_action(:create)
file "#{root_home_dir}/.gemrc" do
content <<-EOF
---
:backtrace: false
:bulk_threshold: 1000
:sources:
- #{node['bnhp-gems']['source']}
:update_sources: true
:verbose: true
:ssl_verify_mode: 0
install: "--user --no-document"
update: "--user --no-document"
EOF
end.run_action(:create)