Skip to main content
Version: 3.22

Registering a template

Templates are the set of commands to execute an activity through a plugin.

Some activities require a specific order and commands, we can explain this as follows:

A template that has the objective of installing update packages will have different execution steps from a template to stop or restart a service.

It is important to emphasize that although they are different templates can use the same plugin to run or not, since one must take into account the technologies and types of systems involved.

To insert a new template task manager access the template report: Executions ➔ Settings ➔ Templates

Follow the instructions:

  1. Click the Show actions button on the report

  2. Click on the New template option

  3. In the registration form displayed enter the name that this template will have in the field Name.

    info

    Choose a name that refers to the objective of the template so that it is easy to find it whenever you need it. E.g. Linux - Restart service

    Template registration form
  4. Select the plugin that this template will use in the options box of the Executor field.

  5. Select the Task Manager option from the options box3 from the Execution type field.

  6. Select from the options if you want the template to be active or not in the Active? field. So when creating a task this template can be chosen or omitted from the available options.

  7. In the Content field enter the commands that will be executed in the task.

    info

    The View TAGs button, as shown in the figure template-enus presents a description for the use of TAGs in templates

    To exemplify the syntaxes used in the templates we present below an example template of service restart:

    info

    For comments use the sharp character '#' at the beginning of the line.

    This is an example of a comment

    #Checks the status of all services
    expect "*$"
    exec "service --status-all"

    #Root user access
    expect "*$"
    exec "sudo su"

    #Enter the root user password
    expect "*:"
    exec "[#AUTH_PASSWORD#]"

    #Stop the service
    expect "*#"
    exec "service [#VARIABLE#] stop"

    #Displays the status of the service
    expect "*#"
    exec "service [#VARIABLE#] status"

    #Restart the service
    expect "*#"
    exec "service [#VARIABLE#] restart"

    #Finalizes the execution of the task
    expect "*#"
    end

    Note that the service to be restarted is not mentioned in the template, this is because we are using the tags option here, which we will see in the next chapter. However, in your template, if you wish, insert all the details of the desired execution.

  8. After filling the fields click on Save

Editing an template

To change the content of any template, follow the instructions:

  1. Access the template report: Executions ➔ Settings ➔ Templates

  2. Choose the template you want to edit.

    You can use the filter at the top of the report and find the template through its: Execute, Type and other items.

  3. When you find the template click on the respective action button and select the option Edit template

  4. Change the information you want and when you are done click Save.

Viewing the change history

All the modifications in the templates are registered by senhasegura that stores a history that helps in the consultation of what was changed and even the restoration of the template of a certain period.

To view the change history of a template, follow the instructions:

  1. Access the template report: Executions ➔ Settings ➔ Templates

  2. Choose the template you want to view the changes.

    You can use the filter at the top of the report and find the template through its: Execute, Type and other items.

  3. When you find the template click on the respective action button and select the option Template changes history

    Template change report
  4. In the displayed report you can see the change date and its versions.

  5. Click on the action button of the version you want to view the content as shown in the picture templatehis-enus.

    When you view an old template a button to restore the template will appear. If you want to restore version click the Clone button and automatically the template will be updated to the previous version you want.

    info

    When restoring a template the senhasegura will register this restoration a new version of the template, allowing you not to lose any version even after some restoration.