Skip to content

Commit 0594aa9

Browse files
Jeff McCunenfagerlund
authored andcommitted
Docs: Update file_line documentation
This commit clarifies the behavior of the file_line resource type.
1 parent 27c3b64 commit 0594aa9

File tree

1 file changed

+19
-8
lines changed

1 file changed

+19
-8
lines changed

lib/puppet/type/file_line.rb

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,25 @@
11
Puppet::Type.newtype(:file_line) do
22

33
desc <<-EOT
4-
Type that can append whole a line to a file if it does not already contain it.
5-
6-
Example:
7-
8-
file_line { 'sudo_rule':
9-
path => '/etc/sudoers',
10-
line => '%admin ALL=(ALL) ALL',
11-
}
4+
Ensures that a given line is contained within a file. The implementation
5+
matches the full line, including whitespace at the beginning and end. If
6+
the line is not contained in the given file, Puppet will add the line to
7+
ensure the desired state. Multiple resources may be declared to manage
8+
multiple lines in the same file.
9+
10+
Example:
11+
12+
file_line { 'sudo_rule':
13+
path => '/etc/sudoers',
14+
line => '%sudo ALL=(ALL) ALL',
15+
}
16+
file_line { 'sudo_rule_nopw':
17+
path => '/etc/sudoers',
18+
line => '%sudonopw ALL=(ALL) NOPASSWD: ALL',
19+
}
20+
21+
In this example, Puppet will ensure both of the specified lines are
22+
contained in the file /etc/sudoers.
1223
1324
EOT
1425

0 commit comments

Comments
 (0)