bmarini / knife-inspect

Inspect your chef repo as is compares to what is on your chef server
MIT License
55 stars 13 forks source link

Initial support for node existence check #30

Closed kamaradclimber closed 9 years ago

kamaradclimber commented 10 years ago

fixes #20

stephenlauck commented 10 years ago

@kamaradclimber do you store node data in your Chef repo?

kamaradclimber commented 10 years ago

yes we do and we do want to compare node definition (run list + normal attributes) with what is stored in chef server

gregkare commented 10 years ago

@kamaradclimber I've just tried your branch (after exporting my nodes to nodes/#{node_name}.json files and I'm getting the following output:

$ ./bin/knife node inspect chef_server
- chef_server
  has the following values mismatched on the server and repo

    chef_type :
      server value = node
      local value  =

I've used knife node show chef_server -Fjson > nodes/chef_server.json to export the node file, are you using another tool?

stephenlauck commented 10 years ago

Why would a node being tracked on the Chef Server differ than what is in your source code? If you need to use inspect to know what is going on do you see this as a problem? You should only use the source code as the actual source of truth and have a one way copy up to the Chef server or you will have some serious scaling and collaboration problems.

kamaradclimber commented 10 years ago

@stephenlauck, inspecting nodes differences between git and chef-server is a powerful way to build a tool to push nodes from git to the chef-server. Our deployemnt bot is currently based on chef_fs libraries which are far too slow, knife-inspect is imho a better starting block to improve it. It also happen to have temporary change in sandbox environment (talking about a dedicated chef-server) in either nodes, roles, cookbooks… that you want to undo after a short test.

You seem judgemental here, don't be. Other may have different workflows.

kamaradclimber commented 10 years ago

@gregkare I have to look into that

gregkare commented 10 years ago

By the way, checking for nodes should be optional, so we need to introduce either a command line switch or a configuration file

kamaradclimber commented 10 years ago

@gregkare all check types should be deactivable nodes are same level citizens as cookbooks, data bags, env and roles

I'll make an independant PR for that

kamaradclimber commented 9 years ago

Closing this PR, feel free to open it again if you want to keep on the exchange.