Learning Chef: A Configuration Management and Automation Framework
Mischa Taylor, Seth Vargo
clear up configuration administration concerns in organizations huge and small with Chef, the software program software that is helping approach directors get to the bottom of configuration difficulties and discover new avenues in automation, deployment, and orchestration. With this sensible consultant, you’ll quick study the fundamentals of Chef sooner than diving into advanced use cases.
Not will this e-book help you clear up precise matters, reminiscent of easy methods to deal with four hundred EC2 nodes, however it also will assist you comprehend the altering organizational politics and thought-processes that include infrastructure automation.
Gain a company knowing of Chef: Who created it and what difficulties does it solve?
Set up your laptop and workflow: fitting Chef could be a headache. There's no prescribed workflow that’s beneficial for everyone.
Write customized recipes: simply because each infrastructure is various, you'll have to write a customized recipe. Writing solid cookbooks is essential for having a sustainable infrastructure.
Tailor Chef in your infrastructure: ultimately, even customized recipes won't be sufficient. You’ll are looking to expand the Chef’s middle performance.
periods, tools, periods, and Modules reviews, reviews conditionals, Conditionals and Flow–Conditionals and circulation move, Conditionals and Flow–Conditionals and stream gemstones, outlined, set up try out Kitchen on Linux (Chef customer basically) hashes, Hashes–Hashes heredoc notation, Heredoc Notation IDEs that paintings with Chef, set up a Programmer’s textual content Editor Math module, Mathematical Operations mathematical operations, Mathematical Operations tools, tools, periods, and.
'git://github.com/username/app.git' finish listing deal with a listing or listing tree, dealing with permissions and possession: # Recursively be certain a listing exists listing '/opt/my/deep/directory' do proprietor 'root' crew 'root' mode '0644' recursive actual finish execute Execute an arbitrary one-line command (as if it have been entered at the command line): # Write contents to a dossier execute 'write prestige' do command 'echo "delicious" > /tmp/bacon' finish dossier deal with a dossier already current (but.
Chef-apply to execute code in a Chef recipe dossier such as you did in bankruptcy four, the chef-client instrument is frequently utilized in creation environments. chef-client presents the power to execute Chef code throughout a number of recipe records, which we’ll see extra of in bankruptcy 7. to be able to deal with real-world creation environments, you’ll be working loads of Chef code. with the intention to make upkeep more straightforward, one in general spreads construction code throughout a number of recipe documents. even supposing chef-apply will do in a.
disbursed to nodes. even though, the documents used are Embedded Ruby templates. A template is obvious textual content which may include Ruby code, that is evaluated by means of the Embedded Ruby template engine sooner than being rendered on a node. Templates are beneficial in case you are looking to generate records with variable or selective content material. templates follows a similar directory-naming constitution scheme as records to regulate no matter if the generated template records are copied to specific nodes. we are going to hide a lot of these constructions within the.
evaluation a string). additionally, if the ultimate tag has a minus check in it, corresponding to -%>, the road is faraway from the ensuing template output while it really is evaluated. for that reason, in instance 15-10, those 3 strains are processed whilst the template dossier is evaluated: <% if @port != eighty -%>, hear <%= @port %>, and <% finish -%>. whilst the evaluated output is written to the consequent template dossier, it turns into only one line, simply because there are -%> symbols at the first and the 3rd traces: pay attention <%= @port %>.