Skip to content

block

Part of a text file: a block that should, or should not, be there.

step "example" {
block {
path = "..."
}
}
Name Type Required Description
content string No Lines of the block.
create bool No Create the file when it is missing. Otherwise a missing file is an error.
insert_after string No Where a new block goes: after the last match of this regexp, or “EOF” (default).
insert_before string No Where a new block goes: before the first match of this regexp, or “BOF”.
marker string No Marker line with {mark}, which becomes BEGIN and END. Defaults to “# {mark} CONN3X MANAGED BLOCK”.
on_remove string No “forget” (default) leaves the file as it is, “delete” takes the edit back out.
path string Yes Absolute path of the file.
state string No “present” (default) or “absent”.

Conn3x sets these; reference them as conn3x_block.<circuit>__<step>["<host>"].<name>.

Name Type Description
in_sync bool Whether the file already matches.

A step lowers to the conn3x_block resource, one instance per host, and connects with its circuit’s ssh block.