line
manage one line in a file
Keys
| Key | Type | Default | Meaning |
|---|---|---|---|
path | string | required | absolute |
line | string | - | line to keep |
match | string | required | regular expression for the line |
validate | string | - | check command, as for file |
absent | boolean | false | remove the matching lines |
line.path
string, required
Absolute. A missing file is a change in the plan, since an earlier step can create it. Apply fails when it is still missing.
line.line
string
Line to keep. It replaces the one line that match finds, or goes at the end of the file.
line.match
string, required
Regular expression for the line. More than one matching line fails the check.
line.validate
string
Check command, as for file. It runs with absent too.
line.absent
boolean, default false
Remove the matching lines.
Example
- line:
path: /etc/default/grub
match: ^GRUB_TIMEOUT=
line: GRUB_TIMEOUT=2
then: update-grub