From the course: Learning Chef
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Test and repair
- [Instructor] With your more formal understanding of the definition of a resource in place, let's take a look at that more concrete example we used before. Now, we had the Chef client generate a file for us called hello.txt. What do you think would happen if we were to go and modify the content of that file directly? So I'm going to do this thought experiment with you. You should understand that when the Chef client runs your recipe, it's going to enforce the state you defined for that resource. Remember what I wrote before, taking a look at my hello recipe. In this recipe, we wrote the content of the hello.txt file should say, 'Hello, world!' Now, I'm going to modify that file that it created, /hello.txt. If I were to add some random content to this file, what do you think would happen the next time the Chef client takes a look at it? I'm going to save this file, and I'm going to verify that it took my changes, just by catenating out its contents. There's my random content that I've…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
(Locked)
Resources and recipes6m 8s
-
(Locked)
Test and repair8m 27s
-
(Locked)
Organize recipes with cookbooks7m 13s
-
(Locked)
The Apache cookbook9m 50s
-
(Locked)
Apply cookbooks and include_recipe7m 18s
-
(Locked)
Ruby and resources3m 59s
-
(Locked)
Ohai – I'm the node object9m
-
(Locked)
Templates and embedded Ruby7m 11s
-
(Locked)
-
-
-