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

Test and repair

From the course: Learning Chef

Start my 1-month free trial

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…

Contents