]> gitweb.fluxo.info Git - puppet-stdlib.git/commitdiff
Docs: Update file_line documentation
authorJeff McCune <jeff@puppetlabs.com>
Tue, 16 Aug 2011 23:09:01 +0000 (16:09 -0700)
committernfagerlund <nick.fagerlund@gmail.com>
Thu, 18 Aug 2011 19:39:04 +0000 (12:39 -0700)
This commit clarifies the behavior of the file_line resource type.

lib/puppet/type/file_line.rb

index aacd6d9866f2c048c0895dc395ed82656a1a6763..8b458978864edc62c6bc041d1a8257a55a9fdebb 100644 (file)
@@ -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