Coder Social home page Coder Social logo

Comments (13)

sawanoboly avatar sawanoboly commented on September 24, 2024 1

@patcon

I found little hack for tighter integration.
in knife.rb

## knife.rb will be read twice at run. (before launch chef-zero locally and before run knife.)
## And configuration for chef-zero doesn't has key `color`.
if ARGV[0..1] == ["zero", "converge"] && ! Chef::Config.has_key?(:color)
  system('bundle exec berks vendor')
end

And I have a cheap idea for integrate with other tools. That is adding option zero.before_command to add hook before connect via ssh. How do you feel about it?

from knife-zero.

sawanoboly avatar sawanoboly commented on September 24, 2024

I think that the feature should be supported by chef-zero. #21 (And I don't like Berkshelf very much.)
Then, A workflow based on Berkshelf will be replaced by Policyfile.

But, If you implement it and create PR, I can merge it.

EDIT===

Or, an other plan. We'll create knife-zero-berkshelf as another plugin which work together with `knife-zero. An in this case, I'll possible to cooperate.

from knife-zero.

sawanoboly avatar sawanoboly commented on September 24, 2024

@patcon
BTW, what do you think about librarian-chef ? I often use it.
It has much less depends on other gems than Berkshelf depends on.

from knife-zero.

daften avatar daften commented on September 24, 2024

I think both should be supported properly actually. I use berkshelf myself, but librarian-chef has a lot of users as well.

from knife-zero.

sawanoboly avatar sawanoboly commented on September 24, 2024

F.Y.I

Librarian could relatively tighter integration with knife.

https://knife-zero.github.io/tips/with_cookbook_manager/

This setting checks Cheffile and Cheffile.lock before knife command running to avoid unintended behavior.

from knife-zero.

patcon avatar patcon commented on September 24, 2024

Just realized I never answered the original question on librarian-chef:

I always liked librarian much much more than berkshelf, but the lead developer seems to have been hired by facebook and disappeared from the FOSS community. He unfortunately hadn't been pushing librarian features as much as the berkshelf folks were. Librarian strikes me as the better-designed tool that is no longer maintained.

from knife-zero.

patcon avatar patcon commented on September 24, 2024

That seems nifty :) I'm hiding knife-zero in rake tasks anyhow, so I've got this solved as far as I need it, but I'm sure newcomers would appreciate the before_command feature!

from knife-zero.

sawanoboly avatar sawanoboly commented on September 24, 2024

I've added hooks before_bootstrap and before_converge to run any command before the chef-client running. v1.11.1
It probably can be make tighter integration with cookbook managers.

http://knife-zero.github.io/tips/with_cookbook_manager/

How do you think ? I'm going to close this issue as resolve.

from knife-zero.

patcon avatar patcon commented on September 24, 2024

Ah, this looks really cool @sawanoboly :) I've got a tooling that works for me now, so I'll probably stick with that, but I think your solution will be perfect for the next person

from knife-zero.

dfang avatar dfang commented on September 24, 2024

@sawanoboly

Hi, why knife-zero depends on chef 12.6.0( spec.add_runtime_dependency "chef", "~> 12.6.0" in gemspec), the latest version chef embedded in chefdk is 12.5.1, in order to run knife converge, i need to change 12.6.0 to 12.5.1 on my local.

before_bootstrap and before_converge hooks released in chef 12.6.0 ?

thanks !

from knife-zero.

sawanoboly avatar sawanoboly commented on September 24, 2024

@dfang Ah.. this dependency need to support #37 . And, I came up with idea of before_hooks after implement it.

Please wait chef-dk πŸ˜” . Or, try to install new gems by bundler.

from knife-zero.

dfang avatar dfang commented on September 24, 2024

@sawanoboly How to replace chef 12.5.1 in chefdk with chef 12.6.0, chef gem install chef -v 12.6.0 seems not work.

thanks !

from knife-zero.

sawanoboly avatar sawanoboly commented on September 24, 2024

@dfang
I have workaround for it. But don't reccomend strongly.

(edited)

$ cd your_chef_repo/
$ /opt/chefdk/embedded/bin/bundle init
$ echo "gem 'knife-zero'" >> Gemfile 
$ /opt/chefdk/embedded/bin/bundle install --binstubs --path=vendor/bundle --shebang=/opt/chefdk/embedded/bin/ruby


$ ./bin/knife -v
=> Chef: 12.6.0

$ /opt/chefdk/embedded/bin/bundle list knife-zero
=> /root/chefdk/work/vendor/bundle/ruby/2.1.0/gems/knife-zero-1.12.0

$ knife -v
=> Chef: 12.5.1

It's just first aid, please return to using chef-dk when new version released.

from knife-zero.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.