cookbook 'augeas', '= 0.5.4'
augeas (7) Versions 0.5.4 Follow2
Installs/Configures augeas
cookbook 'augeas', '= 0.5.4', :supermarket
knife supermarket install augeas
knife supermarket download augeas
augeas cookbook
Augeas is a library that allows files of different formats to be
edited in a mostly generic manner. It does this by using a lens
to transform the file
into a generic tree like structure which can then be modified and transformed back into
the original format of the file. This cookbook provides a resource that allows recipes to
modify files using augeas.
Requirements
Platforms:
- RHEL Family
- Debian
- Ubuntu
- FreeBSD
Resources and Providers
augeas
The augeas
provider is used to make changes to files using the augeas library.
Attributes
-
changes
(required) - A string or list of strings that contain augeas commands to run -
lens
(optional) - A specific lens to use to transform the file being modified -
incl
(optional) - Only include the specified file in the augeas context. If this is set lens must also be specified. -
run_if
(optional) - Only run if the given augeas matcher is true
Examples
Set the sysconfig variable TEST
in the /etc/sysconfig/test
file to b
augeas 'sysconfig_test' do
changes 'set /files/etc/sysconfig/test/TEST b'
end
In the above case augeas already knows which lens to use to transform files
in /etc/sysconfig
. If it didn't we could tell it more explicitly like
augeas 'sysconfig_lens' do
changes 'set /files/etc/sysconfig/test/TEST b'
lens 'Sysconfig.lns'
incl '/etc/sysconfig/test'
end
I can also make changes conditionaly based on augeas match statements. The following will set TEST to c only if it is currently set to a.
augeas 'sysconfig_get_equal_test' do
changes 'set /files/etc/sysconfig/test/TEST c'
run_if 'get /files/etc/sysconfig/test/TEST == a'
end
Recipes
augeas::geminstall
This recipe will install the augeas development libraries and then use chef_gem
to
make the ruby-augeas
gem available to the resource.
Author
Author:: Nathan Huff (nhuff@acm.org)
Contributor:: Pierre Rambaud
Acknowledgements
The interface for this resource is pretty much a copy of the Puppet resource of the same
name. While the code is rewritten the general flow of how it interacts with augeas is
also highly influenced by what the Puppet provider does.
Collaborator Number Metric
0.5.4 failed this metric
Failure: Cookbook has 0 collaborators. A cookbook must have at least 2 collaborators to pass this metric.
Contributing File Metric
0.5.4 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 https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Foodcritic Metric
0.5.4 failed this metric
FC122: Use the build_essential resource instead of the recipe: augeas/recipes/geminstall.rb:1
Run with Foodcritic Version 14.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
No Binaries Metric
0.5.4 passed this metric
Testing File Metric
0.5.4 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 https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
0.5.4 passed this metric
0.5.4 failed this metric
0.5.4 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 https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Foodcritic Metric
0.5.4 failed this metric
FC122: Use the build_essential resource instead of the recipe: augeas/recipes/geminstall.rb:1
Run with Foodcritic Version 14.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
No Binaries Metric
0.5.4 passed this metric
Testing File Metric
0.5.4 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 https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
0.5.4 passed this metric
0.5.4 failed this metric
Run with Foodcritic Version 14.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
0.5.4 passed this metric
Testing File Metric
0.5.4 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 https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
0.5.4 passed this metric
0.5.4 failed this metric
0.5.4 passed this metric