Configuration > Resources

symlink


Description

This resource manages a symlink within the fileystem hierarchy of the client. Its main parameter is path.

Relationship to other resources

The value of the path parameter must be unique among all symlink, file and directory resources.

A symlink implicitly depends on any other symlinks or directory resources whose path parameters are ancestors to the symlink path. For example when the path parameter of this symlink is set to /my/very/elaborate/example and there is a directory whose path is /my/very/elaborate, then the former implicitly depends on the latter.

If the target parameter of the symlink resource contains a path that matches the path parameters of a managed file or directory resource, the symlink resource depends on the latter.

Parameters

To declare a resource within the [[resources]] array as a symlink, set the type meta-parameter to symlink.

In addition to the meta-parameters listed in Resources, this table lists all resource-specific parameters:

Name TOML type Description Mandatory Default
ensure string

Determines the desired state of the resource. One of:

  • present, meaning the resource is created and kept up-to-date
  • absent, meaning the resource is deleted and kept absent
yes present
path string Primary parameter. An absolute filesystem path. yes
target string An absolute filesystem path that the symlink at path should point to. yes

Examples

	    
[[resources]]
type = "symlink"
path = "/my/elaborate/example"
target = "/my/target/file/or/directory"