Skip to content

Commit

Permalink
Add support for diplomat to install at compiletime.
Browse files Browse the repository at this point in the history
  • Loading branch information
John Bellone committed Mar 17, 2016
1 parent 8d46fd6 commit 72de606
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
1 change: 0 additions & 1 deletion metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
version '2.0.0'

recipe 'consul::default', 'Installs and configures the Consul service.'
recipe 'consul::web_ui', 'Installs and configures the Consul Web UI.'
recipe 'consul::client_gem', 'Installs the Consul Ruby client as a gem.'

supports 'centos', '>= 6.4'
Expand Down
13 changes: 10 additions & 3 deletions recipes/client_gem.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,14 @@
# Copyright 2014-2016, Bloomberg Finance L.P.
#

chef_gem 'diplomat' do
version node['consul']['diplomat_version'] if node['consul']['diplomat_version']
action :install
if Chef::Resource::ChefGem.instance_methods(false).include?(:compile_time)
chef_gem 'diplomat' do
version node['consul']['diplomat_version'] if node['consul']['diplomat_version']
compile_time true
end
else
chef_gem 'diplomat' do
version node['consul']['diplomat_version'] if node['consul']['diplomat_version']
action :nothing
end.run_action(:install)
end

0 comments on commit 72de606

Please sign in to comment.