Skip to content

Instantly share code, notes, and snippets.

@bscott
Created December 16, 2014 22:38
Show Gist options
  • Select an option

  • Save bscott/f6d32bc9a6dbaafbfe22 to your computer and use it in GitHub Desktop.

Select an option

Save bscott/f6d32bc9a6dbaafbfe22 to your computer and use it in GitHub Desktop.
chef_osp
# TODO, make this more dynamic
region = node[:domain]
ext_ip = node[:cloud_v2][:public_ipv4]
ext_ip = ext_ip.gsub!(".",",")
if region.include?("us")
osp_public_queue_name = "osp_US_public_queue"
elsif region.include?("ap")
osp_public_queue_name = "osp_AP_public_queue"
elsif region.include?("eu")
osp_public_queue_name = "osp_EU_public_queue"
else
osp_public_queue_name = "osp_US_public_queue"
end
#Setup Config
template "/etc/osp/osp_server.config" do
source "osp_server.config.erb"
variables(
:osp_public_queue_name => osp_public_queue_name,
:external_ip => ext_ip
)
notifies :restart, "service[osp_server]", :immediately
end
service "osp_server" do
action [:enable, :start]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment