From 0594aa9141397bcc47f66f67698dad0790c4b9d4 Mon Sep 17 00:00:00 2001 From: Jeff McCune Date: Tue, 16 Aug 2011 16:09:01 -0700 Subject: Docs: Update file_line documentation This commit clarifies the behavior of the file_line resource type. --- lib/puppet/type/file_line.rb | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) (limited to 'lib') diff --git a/lib/puppet/type/file_line.rb b/lib/puppet/type/file_line.rb index aacd6d9..8b45897 100644 --- a/lib/puppet/type/file_line.rb +++ b/lib/puppet/type/file_line.rb @@ -1,14 +1,25 @@ Puppet::Type.newtype(:file_line) do desc <<-EOT - Type that can append whole a line to a file if it does not already contain it. - - Example: - - file_line { 'sudo_rule': - path => '/etc/sudoers', - line => '%admin ALL=(ALL) ALL', - } + Ensures that a given line is contained within a file. The implementation + matches the full line, including whitespace at the beginning and end. If + the line is not contained in the given file, Puppet will add the line to + ensure the desired state. Multiple resources may be declared to manage + multiple lines in the same file. + + Example: + + file_line { 'sudo_rule': + path => '/etc/sudoers', + line => '%sudo ALL=(ALL) ALL', + } + file_line { 'sudo_rule_nopw': + path => '/etc/sudoers', + line => '%sudonopw ALL=(ALL) NOPASSWD: ALL', + } + + In this example, Puppet will ensure both of the specified lines are + contained in the file /etc/sudoers. EOT -- cgit v1.2.3