Chef :11

DevOps Classroom Series – 22/Jan/2021

Just Enough ruby for Chef

  • Chef is developed in ruby language, all the recipes which we work are ruby files, so we can use ruby to enhance chef.
  • Refer Here for the chef ruby guide
  • Ensure you install ruby extension to visual studio code Preview
  • Refer Here for ruby sample

Lets try to apply ruby in our cookbook

  • Applied loops for existing cookbook Refer Here
  • Now lets optimize further by create a new recipe called as lamp Refer Here
  • Our cookbook still has improvements
    • i’m hardcoding the package names and changes in recipes might lead to new versions so we need to handle this better Preview
    • During every convergance our apache server is getting restarted, this should not be the case