From 110c64fa93eca18b918a7e7f1656f1147f0adff7 Mon Sep 17 00:00:00 2001 From: Florian Holzhauer Date: Thu, 23 Oct 2014 08:37:40 +0200 Subject: [PATCH] Updating to new qafoo version, now with env flag --- qafoo-profiler/attributes/default.rb | 4 ++-- qafoo-profiler/recipes/default.rb | 16 ++++++++++++---- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/qafoo-profiler/attributes/default.rb b/qafoo-profiler/attributes/default.rb index db3f101a8..8b7b8538a 100644 --- a/qafoo-profiler/attributes/default.rb +++ b/qafoo-profiler/attributes/default.rb @@ -1,5 +1,5 @@ default['qafoo-profiler'] = {} -default['qafoo-profiler']['ppa'] = 'https://packagecloud.io/qafoo/profiler/ubuntu/' -default['qafoo-profiler']['key'] = 'https://packagecloud.io/gpg.key' +default['qafoo-profiler']['ppa'] = 'https://s3-eu-west-1.amazonaws.com/qafoo-profiler/packages/' +default['qafoo-profiler']['key'] = 'https://s3-eu-west-1.amazonaws.com/qafoo-profiler/packages/EEB5E8F4.gpg' default['qafoo-profiler']['flags'] = ['--debug'] default['qafoo-profiler']['log_file'] = '/var/log/qprofd/qprofd.log' diff --git a/qafoo-profiler/recipes/default.rb b/qafoo-profiler/recipes/default.rb index e2676a912..7a559b2e9 100644 --- a/qafoo-profiler/recipes/default.rb +++ b/qafoo-profiler/recipes/default.rb @@ -1,8 +1,6 @@ -codename = 'trusty' # node["lsb"]["codename"] - apt_repository 'qafoo' do uri node['qafoo-profiler']['ppa'] - distribution codename + distribution 'debian' components ['main'] key node['qafoo-profiler']['key'] end @@ -15,7 +13,17 @@ qprofd_flags = [] qprofd_flags << node['qafoo-profiler']['flags'] -qprofd_flags << "--hostname='#{get_normalized_cluster_name}.#{node['opsworks']['instance']['hostname']}'" +qprofd_flags << " --hostname='#{node['opsworks']['instance']['hostname']}.#{get_normalized_cluster_name}'" + +unless node.fetch('easybib_deploy', {})['envtype'].nil? + map = { + 'vagrant' => 'development', + 'playground' => 'staging', + 'production' => 'production' + } + env = map[node['easybib_deploy']['envtype']] + qprofd_flags << " --env=#{env}" +end template '/etc/default/qprofd' do mode 0644