summaryrefslogtreecommitdiff
path: root/lib/puppet/type/file_line.rb
AgeCommit message (Collapse)Author
2013-08-29Update file_line resource to support 'after'.Dan Prince
When adding new lines to a file the 'after' option can be useful when you need to insert file lines into the middle of a file. This is particularly helpful when using file_line with sectioned config files. NOTE: the after option only works when adding new lines. If you are updating an existing (matched) line it will simply modify it in place. This assumes it was in the right place to begin with.
2013-07-11(#21416) Allow file_line to match multiple linesAlex O'Rielly
Without this commit the file_line type will outright fail if multiple lines match the given regex. This commit allows the file_line type and provider to optionally match and modify all matching lines. Changeset rebased into a single commit by Adrien Thebo <adrien@puppetlabs.com>
2012-11-26(#14670) autorequire a file_line resource's pathPeter Meier
If we manage a file we edit with file_line, it should be autorequired by file_line. Without this patch applied the relationship is not automatically setup and the user is forced to manually manage the relationship.
2012-08-14Add support for a 'match' parameter to file_lineChris Price
This commit adds a new parameter called "match" to the file_line resource type, and support for this new parameter to the corresponding ruby provider. This parameter is optional; file_line should work just as before if you do not specify this parameter... so this change should be backwards-compatible. If you do specify the parameter, it is treated as a regular expression that should be used when looking through the file for a line. This allows you to do things like find a line that begins with a certain prefix (e.g., "foo=.*"), and *replace* the existing line with the line you specify in your "line" parameter. Without this capability, if you already had a line "foo=bar" in your file and your "line" parameter was set to "foo=baz", you'd end up with *both* lines in the final file. In many cases this is undesirable.
2012-05-23fix regression in #11017 properlyPeter Meier
We need the defaultvalues for that.
2012-05-10Make file_line default to ensure => presentJeff McCune
The examples in the file_line resource documentation state the following resource should work: file_line { 'sudo_rule': path => '/etc/sudoers', line => '%sudo ALL=(ALL) ALL', } Without this patch the example does not work because ensure is not set to present. This patch fixes the problem by setting the default value of ensure to present.
2012-02-09implement #11017 - make file_line type ensurablePeter Meier
* Implement a simple destroy method. * Add tests for it * Refactor code, so file is actually read only once. However, due to the nature how provider tests are run, we need to ensure that the file is read before we open it to write it.
2011-08-18Docs: Update file_line documentationJeff McCune
This commit clarifies the behavior of the file_line resource type.
2011-08-04(#8792) Rename whole_line type to file_lineJeff McCune
Without this patch the resource whole_line would be included in the stable stdlib module shipping in PE 1.2. Ideally the name will be stable and unchanging in the future. There was quite a bit of concern over whole_line being an unwise name. file_line appears to be the most suitable name and least likely to need another rename in the future.