terraform/website/source/docs/providers/ignition/r/systemd_unit.html.md

1.4 KiB

layout page_title sidebar_current description
ignition Ignition: ignition_systemd_unit docs-ignition-resource-systemd-unit Describes the desired state of the systemd units.

ignition_systemd_unit

Describes the desired state of the systemd units.

Example Usage

resource "ignition_systemd_unit" "example" {
	name = "example.service"
	content = "[Service]\nType=oneshot\nExecStart=/usr/bin/echo Hello World\n\n[Install]\nWantedBy=multi-user.target"
}

Argument Reference

The following arguments are supported:

  • name - (Required) Tthe name of the unit. This must be suffixed with a valid unit type (e.g. thing.service).

  • enable - (Optional) Whether or not the service shall be enabled. When true, the service is enabled. In order for this to have any effect, the unit must have an install section. (default true)

  • mask - (Optional) Whether or not the service shall be masked. When true, the service is masked by symlinking it to /dev/null.

  • content - (Required) The contents of the unit. Optional when a dropin is provided.

  • dropin - (Optional) The list of drop-ins for the unit.

The dropin block supports:

  • name - (Required) The name of the drop-in. This must be suffixed with .conf.

  • content - (Optional) The contents of the drop-in.

Attributes Reference

The following attributes are exported:

  • id - ID used to reference this resource in ignition_config.