Adoptable Cookbooks List

Looking for a cookbook to adopt? You can now see a list of cookbooks available for adoption!
List of Adoptable Cookbooks

Supermarket Belongs to the Community

Supermarket belongs to the community. While Chef has the responsibility to keep it running and be stewards of its functionality, what it does and how it works is driven by the community. The chef/supermarket repository will continue to be where development of the Supermarket application takes place. Come be part of shaping the direction of Supermarket by opening issues and pull requests or by joining us on the Chef Mailing List.

Select Badges

Select Supported Platforms

Select Status


line (85) Versions 0.6.3

Provides line editing resources for use by recipes

cookbook 'line', '= 0.6.3', :supermarket
cookbook 'line', '= 0.6.3'
knife supermarket install line
knife supermarket download line
Quality 57%

line cookbook


Quite often, the need arises to do line editing instead of managing an
entire file with a template resource. This cookbook supplies various
resources that will help you do this.


Add "depends 'line'" to your cookbook's metadata.rb to gain access to
the resoures.

append_if_no_line "make sure a line is in dangerfile" do
  path "/tmp/dangerfile"

replace_or_add "spread the love" do
  path "/some/file"
  pattern "Why hello there.*"
  line "Why hello there, you beautiful person, you."

delete_lines "remove hash-comments from /some/file" do
  path "/some/file"
  pattern "^#.*"

add_to_list "add entry to a list"
  path "/some/file"
  pattern "People to call: "
  delim [","]
  entry "Bobby"

delete_from_list "delete entry from a list"
  path "/some/file"
  pattern "People to call: "
  delim [","]
  entry "Bobby"


So far, the only resource implemented are


delim must be an array of 1, 2 or 3 multi-character elements.
If one delimiter is given, it is assumed that either the delimiter or the given search pattern will proceed each entry and
each entry will be followed by either the delimeter or a new line character:
People to call: Joe, Bobby
delim [","]
entry 'Karen'
People to call: Joe, Bobby, Karen

  If two delimiters are given, the first is used as the list element delimiter and the second as entry delimiters:
      my @net1918 = ("", "");
  delim [", ", "\""]
  entry ""
      my @net1918 = ("", "", "");

  if three delimiters are given, the first is used as the list element delimiter, the second as the leading entry delimiter and the third as the trailing delimiter:
      multi = ([310], [818])
  delim [", ", "[", "]"]
  entry "425"
      multi = ([310], [818], [425])

Works exactly the same way as add_to_list, see above.

More to follow.


tester - A recipe to exercise the resources


Author:: Sean OMeara (
Contributor:: Antek S. Baranski (

Dependent cookbooks

This cookbook has no specified dependencies.

Contingent cookbooks

al_agents Applicable Versions
apparmor Applicable Versions
autofs Applicable Versions
aws-kinesis-agent Applicable Versions
bash_history_timestamp Applicable Versions
cerner_splunk Applicable Versions
chamber-kibana Applicable Versions
checkmk Applicable Versions
chefdk_bootstrap Applicable Versions
cis-el7-l1-hardening Applicable Versions
codenamephp_chef Applicable Versions
dynatrace Applicable Versions
dynatrace-appmon Applicable Versions
elk Applicable Versions
elkstack Applicable Versions
fipsify Applicable Versions
fqdn Applicable Versions
hdp-cloud Applicable Versions
java Applicable Versions
jenkinsstack Applicable Versions
linux-tweak Applicable Versions
mondoo Applicable Versions
network_interfaces Applicable Versions
nfs Applicable Versions
nyan-cat Applicable Versions
ocserv Applicable Versions
openvpnas Applicable Versions
percona Applicable Versions
ps1 Applicable Versions
puncha-kibana Applicable Versions
pyload Applicable Versions
r1337-linux-users Applicable Versions
rails_ubuntu Applicable Versions
rc Applicable Versions
starship Applicable Versions
vpn Applicable Versions
websrv Applicable Versions
yum-plugin-versionlock Applicable Versions
zf2 Applicable Versions

line Cookbook CHANGELOG

v0.6.3 (2015-10-27)

  • Fixing Ruby and Chef deprecation warnings
  • Cleaning up tests a bit
  • Adding support for source_url and issues_url
  • delete_from_list resource

v0.6.2 (2015-07-15)

  • Catch lines missed by strict patterns
  • Add rspec tests for the replace_or_add provider. The existing chefspec tests don't step into the provider code and so don't check the provider functionality.
  • Change the Gemfile to reflect the need for berkshelf 3, chefspec v4.2, rspec 3 for the tests.
  • Update provider_replace_or_add to handle cases where the pattern does not match the replacement line.
  • Fix notification problem where updated_by_last_action was set when nothing changed.

v0.6.1 (2015-02-24)

  • Adding CHANGELOG
  • Adding ChefSpec matchers

Collaborator Number Metric

0.6.3 passed this metric

Contributing File Metric

0.6.3 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of, and your repo must contain a file

Foodcritic Metric

0.6.3 passed this metric

License Metric

0.6.3 failed this metric

line does not have a valid open source license.
Acceptable licenses include Apache-2.0, apachev2, Apache 2.0, MIT, mit, GPL-2.0, gplv2, GNU Public License 2.0, GPL-3.0, gplv3, GNU Public License 3.0.

No Binaries Metric

0.6.3 passed this metric

Testing File Metric

0.6.3 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of, and your repo must contain a file

Version Tag Metric

0.6.3 passed this metric