VPS上のUbuntuでheadlessのchromeを使うためのインストールレシピ
chrome_recipe.rb
package 'gdebi'
execute 'install chrome' do
deb_name = 'google-chrome-stable_current_amd64.deb'
commands = [
'cd /tmp',
"wget https://dl.google.com/linux/direct/#{deb_name}",
"gdebi --n ./#{deb_name}"
]
command commands.join(' && ')
not_if 'command -v google-chrome'
end
execute 'install chromedriver' do
commands = [
'cd /tmp',
'wget https://chromedriver.storage.googleapis.com/2.44/chromedriver_linux64.zip',
'unzip chromedriver_linux64.zip -d /usr/local/bin'
]
command commands.join(' && ')
not_if 'command -v chromedriver'
end