Limited Time Offer!

For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly.
Master DevOps, SRE, DevSecOps Skills!

Enroll Now

Chef Tutorials: Chef in-built and common resource types with example

  • package: Used to manage packages on a node
  • service: Used to manage services on a node
  • user: Manage users on the node
  • group: Manage groups
  • template: Manage files with embedded ruby templates
  • cookbook_file: Transfer files from the files subdirectory in the cookbook to a location on the node
  • file: Manage contents of a file on node
  • directory: Manage directories on node
  • execute: Execute a command on the node. Use the script resource to execute a script using a specific interpreter (Ruby, Python, Perl, csh, or Bash).
  • cron: Edit an existing cron file on the node
  • bash: Use the bash resource to execute scripts using the Bash interpreter.
  • log: A log resource block adds messages to the log file based on events that occur during a Chef Infra Client run:

Bash vs execute

For a single script, use an execute. The bash resource is for including the script contents inline in the recipe code.

Use the bash resource to execute scripts using the Bash interpreter. Commands that are executed with this resource are (by their nature) not idempotent, as they are typically unique to the environment in which they are run.

Use the execute resource to execute a single command. Commands that are executed with this resource are (by their nature) not idempotent, as they are typically unique to the environment in which they are run.Use the script resource to execute a script using a specific interpreter (Ruby, Python, Perl, csh, or Bash).

Chef in-built and common resource types

Rajesh Kumar
Follow me
Latest posts by Rajesh Kumar (see all)
Subscribe
Notify of
guest
0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x