Move nodejs install to separate recipe.

This commit is contained in:
James Barnett 2017-04-20 15:50:02 -05:00
parent c03cbe633e
commit 1eae27f271
No known key found for this signature in database
GPG Key ID: 647983861A4EC5EA
4 changed files with 25 additions and 7 deletions

View File

@ -1,18 +1,22 @@
# #
# Cookbook:: chatbot # Cookbook:: metasploitable
# Recipe:: chatbot # Recipe:: chatbot
# #
# Copyright:: 2017, Rapid7, All Rights Reserved. # Copyright:: 2017, Rapid7, All Rights Reserved.
# #
# #
include_recipe 'metasploitable::chatbot' include_recipe 'metasploitable::ruby23'
include_recipe 'metasploitable::nodejs'
package 'unzip' package 'unzip'
package 'npm' bash "Install dependencies" do
code <<-EOH
package 'bundler' npm install express
npm install cors
EOH
end
cookbook_file '/tmp/chatbot.zip' do cookbook_file '/tmp/chatbot.zip' do
source 'chatbot/chatbot.zip' source 'chatbot/chatbot.zip'

View File

@ -0,0 +1,14 @@
#
# Cookbook:: metasploitable
# Recipe:: nodejs
#
# Copyright:: 2017, Rapid7, All Rights Reserved.
#
#
execute "apt-get update" do
command "apt-get update"
end
package 'nodejs'
package 'npm'

View File

@ -7,9 +7,9 @@
# #
include_recipe 'metasploitable::ruby23' include_recipe 'metasploitable::ruby23'
include_recipe 'metasploitable::nodejs'
package 'git' package 'git'
package 'nodejs'
directory '/opt/readme_app' do directory '/opt/readme_app' do
mode '0777' mode '0777'

View File

@ -1,5 +1,5 @@
# #
# Cookbook:: sinatra # Cookbook:: metasploitable
# Recipe:: sinatra # Recipe:: sinatra
# #
# Copyright:: 2017, Rapid7, All Rights Reserved. # Copyright:: 2017, Rapid7, All Rights Reserved.