File tree Expand file tree Collapse file tree 1 file changed +19
-8
lines changed Expand file tree Collapse file tree 1 file changed +19
-8
lines changed Original file line number Diff line number Diff line change 11Puppet ::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
You can’t perform that action at this time.
0 commit comments