Sha256: 526269df1800225896f4499adcf0b3681bb8b6614fa5b2a27bc8b4396a6c377e

Contents?: true

Size: 847 Bytes

Versions: 58

Compression:

Stored size: 847 Bytes

Contents

api_root_dir = "/var/opt/data_collector_api"

directory api_root_dir do
  recursive true
end

cookbook_file ::File.join(api_root_dir, "Gemfile") do
  source "apigemfile"
end

cookbook_file ::File.join(api_root_dir, "config.ru")

cookbook_file ::File.join(api_root_dir, "api.rb")

execute "bundle install --binstubs" do
  cwd api_root_dir
end

pid_file    = "/var/run/api.pid"
running_pid = ::File.exist?(pid_file) ? ::File.read(pid_file).strip : nil

execute "kill existing API process" do
  command "kill #{running_pid}"
  not_if { running_pid.nil? }
end

execute "start API" do
  command "bin/rackup -D -P #{pid_file}"
  cwd api_root_dir
end

directory "/etc/chef"

["both-mode", "client-mode", "no-endpoint", "solo-mode"].each do |config_file|
  cookbook_file "/etc/chef/#{config_file}.rb" do
    source "client-rb-#{config_file}.rb"
  end
end

Version data entries

58 entries across 58 versions & 1 rubygems

Version Path
chef-12.22.5 acceptance/data-collector/.acceptance/data-collector-test/recipes/default.rb
chef-12.22.5-universal-mingw32 acceptance/data-collector/.acceptance/data-collector-test/recipes/default.rb
chef-12.22.3 acceptance/data-collector/.acceptance/data-collector-test/recipes/default.rb
chef-12.22.3-universal-mingw32 acceptance/data-collector/.acceptance/data-collector-test/recipes/default.rb
chef-12.21.31 acceptance/data-collector/.acceptance/data-collector-test/recipes/default.rb
chef-12.21.31-universal-mingw32 acceptance/data-collector/.acceptance/data-collector-test/recipes/default.rb
chef-12.21.26 acceptance/data-collector/.acceptance/data-collector-test/recipes/default.rb
chef-12.21.26-universal-mingw32 acceptance/data-collector/.acceptance/data-collector-test/recipes/default.rb
chef-12.21.20-universal-mingw32 acceptance/data-collector/.acceptance/data-collector-test/recipes/default.rb
chef-12.21.20 acceptance/data-collector/.acceptance/data-collector-test/recipes/default.rb
chef-12.21.14-universal-mingw32 acceptance/data-collector/.acceptance/data-collector-test/recipes/default.rb
chef-12.21.14 acceptance/data-collector/.acceptance/data-collector-test/recipes/default.rb
chef-12.21.12-universal-mingw32 acceptance/data-collector/.acceptance/data-collector-test/recipes/default.rb
chef-12.21.12 acceptance/data-collector/.acceptance/data-collector-test/recipes/default.rb
chef-12.21.10 acceptance/data-collector/.acceptance/data-collector-test/recipes/default.rb
chef-12.21.10-universal-mingw32 acceptance/data-collector/.acceptance/data-collector-test/recipes/default.rb
chef-12.21.4 acceptance/data-collector/.acceptance/data-collector-test/recipes/default.rb
chef-12.21.4-universal-mingw32 acceptance/data-collector/.acceptance/data-collector-test/recipes/default.rb
chef-13.2.20-universal-mingw32 acceptance/data-collector/.acceptance/data-collector-test/recipes/default.rb
chef-13.2.20 acceptance/data-collector/.acceptance/data-collector-test/recipes/default.rb