Skip to content
This repository has been archived by the owner on Jan 30, 2021. It is now read-only.

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
jtimberman committed Oct 22, 2012
0 parents commit 9b5cbfc
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
17 changes: 17 additions & 0 deletions gem.rb
@@ -0,0 +1,17 @@
require 'chef/knife'

module KnifePlugins
class GemInstall < Chef::Knife
deps do
require 'chef/mixin/shell_out'
include Chef::Mixin::ShellOut
end

banner "knife gem install GEMNAME"

def run
knife_gem = shell_out("#{Gem.bindir}/gem install #{name_args[0]}")
ui.info knife_gem.stdout
end
end
end
32 changes: 32 additions & 0 deletions nukular.rb
@@ -0,0 +1,32 @@
require 'chef/knife'

module KnifePlugins
class Nukular < Chef::Knife
deps do
require 'fission'
require 'chef/node'
require 'chef/api_client'
end

banner "knife nukular VM SNAPSHOT [NODE]"

def run
vm, snapshot = @name_args
node = @name_args[2].nil? ? vm : @name_args[2]
Fission::Command::SnapshotRevert.new(args=[vm, snapshot]).execute
Fission::Command::Start.new(args=[vm]).execute
begin
Chef::Node.load(node).destroy
ui.msg "Deleted node #{node}"
rescue
ui.msg "Could not find node #{node}"
end
begin
Chef::ApiClient.load(node).destroy
ui.msg "Deleted client #{node}"
rescue
ui.msg "Could not find client #{node}"
end
end
end
end

0 comments on commit 9b5cbfc

Please sign in to comment.