# line

manage one line in a file

## Keys

| Key | Type | Default | Meaning |
| --- | --- | --- | --- |
| [`path`](#line.path) | string | required | absolute |
| [`line`](#line.line) | string | - | line to keep |
| [`match`](#line.match) | string | required | regular expression for the line |
| [`validate`](#line.validate) | string | - | check command, as for file |
| [`absent`](#line.absent) | boolean | false | remove the matching lines |

### `line.path` {#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` {#line.line}

string

Line to keep. It replaces the one line that match finds, or goes at the end of the file.

### `line.match` {#line.match}

string, required

Regular expression for the line. More than one matching line fails the check.

### `line.validate` {#line.validate}

string

Check command, as for file. It runs with absent too.

### `line.absent` {#line.absent}

boolean, default false

Remove the matching lines.

## Example

```yaml
- line:
    path: /etc/default/grub
    match: ^GRUB_TIMEOUT=
    line: GRUB_TIMEOUT=2
  then: update-grub
```
