> For AI agents: the complete documentation index is available at https://www.jumpserver.com/docs/llms.txt, the full documentation bundle is available at https://www.jumpserver.com/docs/llms-full.txt.

# Templates

**Templates** keeps the scripts and Playbooks that Adhoc commands and jobs reuse.
Write the content once and reference it from many jobs: when the template changes,
the jobs that use it pick up the new version, so the same command does not have to
be maintained in several places. This is the recommended way to standardize
routine checks and configuration scripts.

![Figure 1: The Templates page](/images/v5/jumpserver/v5_admin_wb_tpl_01.png)

The page has two tabs: **Script** for command templates and **Playbook** for
Playbook templates.

## Prerequisites

- The **Job Center** feature is enabled in
  [Feature Settings](https://www.jumpserver.com/docs/features/system-settings/general/features.md).
- Your role grants the permissions for the template type you want to manage.

## Create a script template


1

Open the **Script** tab and click **Create**.

2

Enter a **name** and choose the **scope**. A public template is available to
everyone; a private template is visible only to its creator.

3

Choose the **module**, for example Shell, and write the script in the content
editor.

4

Add any **variables** the script uses, with a default value for each.

5

Optionally add a comment, then click **Submit**. Use **Save and continue** to
create several templates in a row.

![Figure 2: Creating a script template](/images/v5/jumpserver/v5_admin_wb_tpl_02.png)

## Create a Playbook template


1

Open the **Playbook** tab and click **Create**.

2

Enter a name, choose the scope, and upload a ZIP archive of the Playbook.

3

Make sure the archive contains a `main.yml` entry file at its root. Directories
such as `roles/`, `vars/`, and optional files such as `set_env.yml` are allowed
next to it.

After upload, the Playbook can be selected when creating a Playbook job in
[Jobs](https://www.jumpserver.com/docs/features/workbench/job-center/jobs.md).

## Template parameters

| Parameter | Applies to       | Description                                 |
| --------- | ---------------- | ------------------------------------------- |
| Name      | Script, Playbook | Template name                               |
| Scope     | Script, Playbook | Public (everyone) or private (creator only) |
| Module    | Script           | Script module, such as Shell                |
| Content   | Script           | Script body                                 |
| Variables | Script           | Variables and their default values          |
| File      | Playbook         | ZIP archive with `main.yml` at the root     |
| Comment   | Script, Playbook | Optional description                        |

## Column reference

| Column       | Description                                      |
| ------------ | ------------------------------------------------ |
| Name         | Template name                                    |
| Module       | Script module; Playbook templates show no module |
| Content      | Script body preview                              |
| Comment      | Optional note                                    |
| Scope        | Public or private visibility                     |
| Created by   | Account that created the template                |
| Date created | Creation time                                    |
| Actions      | Edit, clone, or delete the template              |


Tip

Script templates can be loaded from **Open command** on the
[Adhoc](https://www.jumpserver.com/docs/features/workbench/job-center/adhoc.md) page and from the **Template** field
of a script job. Variables are requested each time the command runs.


Warning

Editing a public template affects every job and Adhoc command that references it.
Check existing usage before changing a shared template, and prefer cloning it into
a private template when you need a variant.
