I'm getting acquainted with chef and want to build my workflow without central server (using chef-zero and knife zero). Everything works fine, however, chef-zero stores information about nodes in .json files that are rather big and changed too often to be stored in git repository, and i would like to rescan servers at each working day rather than store their definitions in repository - this should be easily automatable as we don't have many servers. Is there any command that would let me add existing converged nodes to chef-zero just by providing their ssh credentials? I know that knife zero bootstrap <node-ip> will do the trick, but it also triggers extra converge i don't want to happen.
Knife zero existing node discovery
116 views Asked by Etki At
2
The whole question was based around wrong assumptions:
run_list, so i was confused seeing my roles not apply; that makes "discovery" i was talking about not necessary at all.The following structure is sufficient for chef-zero to see the node and successfully converge it:
If you store definitions like that in git, you always have your infrastructure at hand and may do
knife converge name:sonarqube.srv.company.myat any moment, and that beats all my needs. My personal workflow contains directory namedmanaged-nodeswith node specs like above that overwritesnodesdirectory onbin/resetincluded bash script. As long as i keep them stored with proper run lists and attributes, everything works like a charm. However, if you choose similar workflow, remember that you don't have to full attribute list without successful chef run on node.The necessity of purely git-based chef workflow with no persistent server is dictated by some internal reasons i would like not to disclose. Ok, i just wanted idempotent ansible.
Kudos go to @Tensibai for all effort.