{"id":4997,"date":"2018-06-06T10:18:06","date_gmt":"2018-06-06T10:18:06","guid":{"rendered":"http:\/\/www.scmgalaxy.com\/tutorials\/?p=4997"},"modified":"2021-11-17T10:29:06","modified_gmt":"2021-11-17T10:29:06","slug":"understand-the-chefignore-file","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/understand-the-chefignore-file\/","title":{"rendered":"Understanding the chef cookbook&#8217;s chefignore file"},"content":{"rendered":"<p>The chefignore file is used to tell knife which cookbook files in the chef-repo should be ignored when uploading data to the Chef server. The type of data that should be ignored includes swap files, version control data, build output data, and so on. .<\/p>\n<p>The chefignore file can be located in any subdirectory of a chef-repo:&nbsp;\/,&nbsp;\/cookbooks,&nbsp;\/cookbooks\/COOKBOOK_NAME\/,&nbsp;roles, etc. It should contain sections similar to the following:<\/p>\n<p><strong>Example of chefignore<\/strong><\/p>\n<p>[code]<\/p>\n<p># Ignore editor swap files<br>\n*~<br>\n*.sw[a-z]<\/p>\n<p># Ignore top-level Subversion data<br>\n*\/.svn\/*<\/p>\n<p># Ignore all files in a directory<br>\nfiles\/default\/subdirectory\/*<br>\nfiles\/default\/subdirectory\/**<\/p>\n<p># OS generated files #<br>\n######################<br>\n.DS_Store<br>\nIcon?<br>\nnohup.out<br>\nehthumbs.db<br>\nThumbs.db<\/p>\n<p># SASS #<br>\n########<br>\n.sass-cache<\/p>\n<p># EDITORS #<br>\n###########<br>\n\\#*<br>\n.#*<br>\n*~<br>\n*.sw[a-z]<br>\n*.bak<br>\nREVISION<br>\nTAGS*<br>\ntmtags<br>\n*_flymake.*<br>\n*_flymake<br>\n*.tmproj<br>\n.project<br>\n.settings<br>\nmkmf.log<\/p>\n<p>## COMPILED ##<br>\n##############<br>\na.out<br>\n*.o<br>\n*.pyc<br>\n*.so<br>\n*.com<br>\n*.class<br>\n*.dll<br>\n*.exe<br>\n*\/rdoc\/<\/p>\n<p># Testing #<br>\n###########<br>\n.watchr<br>\n.rspec<br>\nspec\/*<br>\nspec\/fixtures\/*<br>\ntest\/*<br>\nfeatures\/*<br>\nexamples\/*<br>\nGuardfile<br>\nProcfile<br>\n.kitchen*<br>\n.rubocop.yml<\/p>\n<p># SCM #<br>\n#######<br>\n.git<br>\n*\/.git<br>\n.gitignore<br>\n.gitmodules<br>\n.gitconfig<br>\n.gitattributes<br>\n.svn<br>\n*\/.bzr\/*<br>\n*\/.hg\/*<br>\n*\/.svn\/*<\/p>\n<p># Berkshelf #<br>\n#############<br>\nBerksfile<br>\nBerksfile.lock<br>\ncookbooks\/*<br>\ntmp<\/p>\n<p># Cookbooks #<br>\n#############<br>\nCONTRIBUTING*<br>\nCHANGELOG*<br>\nTESTING*<\/p>\n<p># Strainer #<br>\n############<br>\nColanderfile<br>\nStrainerfile<br>\n.colander<br>\n.strainer<\/p>\n<p># Vagrant #<br>\n###########<br>\n.vagrant<br>\nVagrantfile<\/p>\n<p># Travis #<br>\n##########<br>\n.travis.yml<\/p>\n<p>[\/code]<\/p>\n<p><strong>Reference&nbsp;<\/strong><\/p>\n<p>https:\/\/docs.chef.io\/chef_repo.html#chefignore-files<\/p>\n\n<div class=\"epyt-gallery\" data-currpage=\"1\" id=\"epyt_gallery_56299\"><iframe loading=\"lazy\"  id=\"_ytid_96232\"  width=\"760\" height=\"427\"  data-origwidth=\"760\" data-origheight=\"427\" src=\"https:\/\/www.youtube.com\/embed\/?enablejsapi=1&#038;autoplay=0&#038;cc_load_policy=0&#038;cc_lang_pref=&#038;iv_load_policy=1&#038;loop=0&#038;rel=1&#038;fs=1&#038;playsinline=0&#038;autohide=2&#038;theme=dark&#038;color=red&#038;controls=1&#038;disablekb=0&#038;\" class=\"__youtube_prefs__  no-lazyload\" title=\"YouTube player\"  data-epytgalleryid=\"epyt_gallery_56299\"  allow=\"fullscreen; accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen data-no-lazy=\"1\" data-skipgform_ajax_framebjll=\"\"><\/iframe><div class=\"epyt-gallery-list\"><div>Sorry, there was a YouTube error.<\/div><\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>The chefignore file is used to tell knife which cookbook files in the chef-repo should be ignored when uploading data to the Chef server. The type of data that should&#8230; <\/p>\n","protected":false},"author":1,"featured_media":5021,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[88],"tags":[407,4936],"class_list":["post-4997","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-chef","tag-chef","tag-chefignore"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/4997","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=4997"}],"version-history":[{"count":5,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/4997\/revisions"}],"predecessor-version":[{"id":25602,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/4997\/revisions\/25602"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media\/5021"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=4997"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=4997"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=4997"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}