# Custom Playbooks

## Requirements

Linux Control Center = 2.10.X or higher

## Objective

This manual aims to present all the features that the LCC Playbooks module offers.

## Overview

In the Linux Control Center (LCC), the Playbooks module plays an important role in administration, providing users with the ability to execute custom playbooks on hosts managed by the LCC.

Executing a playbook through the LCC provides a complete view of the process, allowing you to monitor progress in real time and generate detailed reports. In addition, execution can be performed by Workflow, which allows you to make dynamic decisions based on the results of each step.

## Uploading and Configuring Playbooks

1. To get started, access the LCC and click on **Playbooks** in the left side menu.

   ![](/files/KeKgx5kBo4rBbjOaEGaC)
2. Click **Create**

   ![](/files/hra8IxKPgAO7NaSdpXvY)
3. Enter a name to identify the playbook in the **Name** field.
4. Click **Upload File** and choose the desired playbook from your computer.

   ![](/files/QbIHOwWr0yHthQFTaMa7)
5. Note that the playbook name will be displayed in the **Current File** field.
6. Click **Save** and the playbook will be saved in the LCC database.

   ![](/files/nG6gHlhYnU47bHhdYnxf)
7. Click on the Playbook that was created and you will see the following screens:

### General Information

1. Screen that displays the date and time the playbook was created, the date and time of the last change and you can also change the information in the **Name** and **Description** fields. You can also download the file by clicking **Download**, delete it by clicking **Delete** and upload a new file by clicking **Change File**

   ![](/files/5YJxE0Ziz8hzGsYfYDPb)

### Dynamic Variables in the Playbook

Similar to *Customizable Scripts*, playbooks also have the ability to insert variables. This allows the same playbook to be executed at different times with different values, offering adaptability as needed. The variable format is **${:::Variable name:::}**, where *Variable name* is the identifier of that variable.

After creating the playbook with the variable in this format and uploading the file to the console, it will be possible to change its value directly through the LCC web interface whenever necessary. The updated value will be automatically saved in the playbook file saved in the database.

1. See an example of implementation of this variable format

* var\_name: **${:::var\_name:::}**\*

  ![](/files/HkdFbtOSYJ3W3Q5XrsbT)

{% hint style="warning" %}
It is important to note that if variables are written with the same *identifier*/*name*, LCC will replace the value of the last variable entered by the user in all others. Therefore, it is recommended to use different names if the desired execution values ​​are different.
{% endhint %}

### Playbook Content

1. The Content screen displays all the playbook content. The image below shows the variable mentioned in the previous topic.

   ![](/files/wb3069MdY0ycFVUtwAE8)

### Execution Credentials

1. On the **Credentials** screen, the LCC allows the Playbook to be executed with a different credential than the default *lcc.local*. It is possible to use Linux Credentials that are registered in the LCC console, Credentials from the Password Safe password vault by BeyondTrust through integration and through the LCC Hook Bridge Params functionality.

   ![](/files/fJvkPhNj13M2z0tuXAUH)

### OS Release

1. This functionality allows the Playbook to be executed only on a specific Linux Distribution. 1. Click **Create**

   ![](/files/iPaSjbAds7KSlUBEboOp)
2. Click **Release**, choose the Linux Distribution that the playbook will run on, and click **Save**.

   ![](/files/MHb6U3mybKTuqdDBQIcv)

## Running Playbooks

1. To run the playbook, simply access the **Playbooks** screen and click on **Actions** of the desired playbook.

   ![](/files/g2fUgZtmRVy9J4ZasESI)
2. Click **Run**

   ![](/files/V48IPymx7bsHcxRi374q)
3. Choose which **Host** or **Host Group** the playbook will run on
4. Click **Yes** and the playbook will run immediately.

   ![](/files/7Si7zVWauuq8O426swDO)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.linuxcontrolcenter.com.br/en/custom-playbooks.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
