Add a recipe to install the zerotier ohai plugin #647
@@ -4,7 +4,8 @@ maintainer_email 'mail@kosmos.org'
|
||||
license 'MIT'
|
||||
description 'Installs/Configures zerotier'
|
||||
long_description 'Installs/Configures zerotier'
|
||||
version '0.1.0'
|
||||
version '0.2.0'
|
||||
chef_version '>= 14.0'
|
||||
|
||||
depends 'kosmos-base'
|
||||
depends 'zerotier'
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
#
|
||||
# Cookbook:: kosmos_zerotier
|
||||
# Recipe:: ohai_plugin
|
||||
#
|
||||
|
||||
include_recipe "zerotier::ohai_plugin"
|
||||
|
||||
ohai "reload_zerotier" do
|
||||
action :reload
|
||||
plugin "zerotier"
|
||||
notifies :run, "ruby_block[save_chef_zero_node]", :delayed
|
||||
end
|
||||
|
||||
# Force save the node back to disk in Chef Zero
|
||||
ruby_block "save_chef_zero_node" do
|
||||
block do
|
||||
node.save
|
||||
Chef::Log.info("Node #{node.name} saved to disk with ZeroTier data")
|
||||
end
|
||||
action :nothing
|
||||
end
|
||||
Reference in New Issue
Block a user