diff options
author | Jeff McCune <jeff@puppetlabs.com> | 2011-08-16 16:09:01 -0700 |
---|---|---|
committer | nfagerlund <nick.fagerlund@gmail.com> | 2011-08-18 12:39:04 -0700 |
commit | 0594aa9141397bcc47f66f67698dad0790c4b9d4 (patch) | |
tree | 0f69ab7bdc2100800e78049b04d935d72ca76924 /lib/puppet | |
parent | 27c3b644b00bb2eca0cb819c55d7d348a1caa01b (diff) | |
download | puppet-stdlib-0594aa9141397bcc47f66f67698dad0790c4b9d4.tar.gz puppet-stdlib-0594aa9141397bcc47f66f67698dad0790c4b9d4.tar.bz2 |
Docs: Update file_line documentation
This commit clarifies the behavior of the file_line resource type.
Diffstat (limited to 'lib/puppet')
-rw-r--r-- | lib/puppet/type/file_line.rb | 27 |
1 files changed, 19 insertions, 8 deletions
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 |