From bae82b14b4382c4acfa254e6117c7748091a6727 Mon Sep 17 00:00:00 2001 From: Juana De La Cuesta Date: Tue, 14 Nov 2023 14:53:43 +0100 Subject: [PATCH] docs: Add section for disable restart (#19083) * docs: add section for disable restart that mirrors what is on disable reschedule * Update restart.mdx --- .../content/docs/job-specification/restart.mdx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/website/content/docs/job-specification/restart.mdx b/website/content/docs/job-specification/restart.mdx index 5b0883665..7347deba6 100644 --- a/website/content/docs/job-specification/restart.mdx +++ b/website/content/docs/job-specification/restart.mdx @@ -122,6 +122,21 @@ defaults by job type: } ``` +### Disabling restart + +To disable restarting, set the `attempts` parameter to zero and `mode` to `"fail"`. + +```hcl +job "docs" { + group "example" { + restart { + attempts = 0 + mode = "fail" + } + } +} +``` + ### `mode` Values This section details the specific values for the "mode" parameter in the Nomad