diff --git a/site-cookbooks/kosmos_zerotier/recipes/default.rb b/site-cookbooks/kosmos_zerotier/recipes/default.rb index 12c2304..7e47d0f 100644 --- a/site-cookbooks/kosmos_zerotier/recipes/default.rb +++ b/site-cookbooks/kosmos_zerotier/recipes/default.rb @@ -2,3 +2,15 @@ # Cookbook:: kosmos_zerotier # Recipe:: default # + +zerotier_controller = search(:node, "role:zerotier_controller").first + +controller_url = "http://#{zerotier_controller["knife_zero"]["host"]}:#{node['kosmos_zerotier']['server_port']}" + +credentials = data_bag_item("credentials", "zerotier") + +zerotier_network credentials["network_id"] do + node_name node['fqdn'] + auth_token credentials["auth_token"] + central_url controller_url +end