# link

manage a symbolic link

The step creates missing parent directories, owned by root with mode 0755.

## Keys

| Key | Type | Default | Meaning |
| --- | --- | --- | --- |
| [`path`](#link.path) | string | required | absolute |
| [`target`](#link.target) | string | - | relative or absolute; need not exist |
| [`validate`](#link.validate) | string | - | check command, as for file |
| [`absent`](#link.absent) | boolean | false |  |
| [`replace`](#link.replace) | boolean | false | remove another kind of thing at path first |

### `link.path` {#link.path}

string, required

Absolute. The step creates missing parent directories, owned by root with mode 0755.

### `link.target` {#link.target}

string

Relative or absolute; need not exist.

### `link.validate` {#link.validate}

string

Check command, as for file.

### `link.absent` {#link.absent}

boolean, default false

Remove the link. A path of another kind fails the check.

### `link.replace` {#link.replace}

boolean, default false

Remove another kind of thing at path first, such as a file or a directory. Without it, such a thing fails the check.

## Example

```yaml
- link:
    path: /etc/nginx/sites-enabled/app
    target: /etc/nginx/sites-available/app
```
